From 915c1bd9ed760a58fedbcf8f04f4c70617ea5742 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 83a718ac4d..128155adcd 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 @@ -625,4 +625,20 @@ class CreateMissingTablesAndColumnsTests : DatabaseTestsBase() { SchemaUtils.createMissingTablesAndColumns(CompositePrimaryKeyTable, CompositeForeignKeyTable) } } + + @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) + } + } }