Skip to content

Commit

Permalink
add multiple primary key tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxiqian committed Aug 28, 2024
1 parent b8bf351 commit e6d52c4
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,26 @@ public void testSchemaChangeEvents() throws Exception {
.physicalColumn("id", DataTypes.DECIMAL(20, 0).notNull())
.primaryKey("id")
.build()));

// Test create table DDL with multiple primary keys
statement.execute(
String.format(
"CREATE TABLE `%s`.`newlyAddedTable3`("
+ "id SERIAL,"
+ "name VARCHAR(17),"
+ "notes TEXT,"
+ "PRIMARY KEY (id, name));",
inventoryDatabase.getDatabaseName()));
expected.add(
new CreateTableEvent(
TableId.tableId(
inventoryDatabase.getDatabaseName(), "newlyAddedTable3"),
Schema.newBuilder()
.physicalColumn("id", DataTypes.DECIMAL(20, 0).notNull())
.physicalColumn("name", DataTypes.VARCHAR(17).notNull())
.physicalColumn("notes", DataTypes.STRING())
.primaryKey("id", "name")
.build()));
}
List<Event> actual = fetchResults(events, expected.size());
assertEqualsInAnyOrder(
Expand Down

0 comments on commit e6d52c4

Please sign in to comment.