From 7f653d7bfee2e695530a854a87055f749e7064b4 Mon Sep 17 00:00:00 2001 From: naftalmm Date: Sun, 20 Aug 2023 22:44:49 +0200 Subject: [PATCH] add tests --- .../ddl/CreateMissingTablesAndColumnsTests.kt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/exposed-tests/src/test/kotlin/org/jetbrains/exposed/sql/tests/shared/ddl/CreateMissingTablesAndColumnsTests.kt b/exposed-tests/src/test/kotlin/org/jetbrains/exposed/sql/tests/shared/ddl/CreateMissingTablesAndColumnsTests.kt index e2d041fa0f..3f18da634b 100644 --- a/exposed-tests/src/test/kotlin/org/jetbrains/exposed/sql/tests/shared/ddl/CreateMissingTablesAndColumnsTests.kt +++ b/exposed-tests/src/test/kotlin/org/jetbrains/exposed/sql/tests/shared/ddl/CreateMissingTablesAndColumnsTests.kt @@ -645,4 +645,20 @@ class CreateMissingTablesAndColumnsTests : DatabaseTestsBase() { } } } + + @Test + fun testCreateCompositePrimaryKeyTableAndCompositeForeignKeyInVariousOrder() { + withTables(CompositeForeignKeyTable, CompositePrimaryKeyTable) { + SchemaUtils.createMissingTablesAndColumns(CompositePrimaryKeyTable, CompositeForeignKeyTable) + } + withTables(CompositeForeignKeyTable, CompositePrimaryKeyTable) { + SchemaUtils.createMissingTablesAndColumns(CompositeForeignKeyTable, CompositePrimaryKeyTable) + } + withTables(CompositePrimaryKeyTable, CompositeForeignKeyTable) { + SchemaUtils.createMissingTablesAndColumns(CompositePrimaryKeyTable, CompositeForeignKeyTable) + } + withTables(CompositePrimaryKeyTable, CompositeForeignKeyTable) { + SchemaUtils.createMissingTablesAndColumns(CompositeForeignKeyTable, CompositePrimaryKeyTable) + } + } }