From 1f4fa9b9d1de458892b253bafea1a4d3430182f2 Mon Sep 17 00:00:00 2001 From: Chantal Loncle <82039410+bog-walk@users.noreply.github.com> Date: Thu, 22 Feb 2024 10:03:51 -0500 Subject: [PATCH] fix: EXPOSED-299 [H2 modes] SchemaUtils drops and adds identical composite foreign key Remove H2 mode exceptions in foreign key test. --- .../sql/tests/sqlite/ForeignKeyConstraintTests.kt | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/exposed-tests/src/test/kotlin/org/jetbrains/exposed/sql/tests/sqlite/ForeignKeyConstraintTests.kt b/exposed-tests/src/test/kotlin/org/jetbrains/exposed/sql/tests/sqlite/ForeignKeyConstraintTests.kt index fa76a47a5e..f214ad93d6 100644 --- a/exposed-tests/src/test/kotlin/org/jetbrains/exposed/sql/tests/sqlite/ForeignKeyConstraintTests.kt +++ b/exposed-tests/src/test/kotlin/org/jetbrains/exposed/sql/tests/sqlite/ForeignKeyConstraintTests.kt @@ -184,23 +184,15 @@ class ForeignKeyConstraintTests : DatabaseTestsBase() { override val primaryKey = PrimaryKey(id) } - withTables(category, item) { testDb -> + withTables(category, item) { if (currentDialectTest.supportsOnUpdate) { val constraints = connection.metadata { tableConstraints(listOf(item)) } constraints.values.forEach { list -> list.forEach { - when (testDb) { - TestDB.H2_ORACLE, TestDB.H2_SQLSERVER -> { - assertEquals(ReferenceOption.RESTRICT, it.updateRule) - assertEquals(ReferenceOption.RESTRICT, it.deleteRule) - } - else -> { - assertEquals(currentDialectTest.defaultReferenceOption, it.updateRule) - assertEquals(currentDialectTest.defaultReferenceOption, it.deleteRule) - } - } + assertEquals(currentDialectTest.defaultReferenceOption, it.updateRule) + assertEquals(currentDialectTest.defaultReferenceOption, it.deleteRule) } } }