Skip to content

Commit

Permalink
fix: EXPOSED-299 [H2 modes] SchemaUtils drops and adds identical comp…
Browse files Browse the repository at this point in the history
…osite foreign key

Remove H2 mode exceptions in foreign key test.
  • Loading branch information
bog-walk committed Feb 22, 2024
1 parent f327dab commit 1f4fa9b
Showing 1 changed file with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
Expand Down

0 comments on commit 1f4fa9b

Please sign in to comment.