Skip to content

Commit

Permalink
fix: add mariadb one more case to DatabaseMigrationTests
Browse files Browse the repository at this point in the history
  • Loading branch information
devgor88 committed Dec 7, 2024
1 parent 1b52dfe commit 338926a
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,16 @@ class DatabaseMigrationTests : DatabaseTestsBase() {
withDb(excludeSettings = listOf(TestDB.SQLITE)) { testDb ->
if (currentDialectTest.supportsCreateSequence) {
try {
// MariaDB does not allow to create auto column without defining it as a key
val tableWithAutoIncrement = if (testDb == TestDB.MARIADB) {
object : IdTable<Long>("test_table") {
override val id: Column<EntityID<Long>> = long("id").autoIncrement().entityId()
override val primaryKey = PrimaryKey(id)
}
} else {
tableWithAutoIncrement
}

SchemaUtils.create(tableWithAutoIncrement)

assertEquals(0, MigrationUtils.statementsRequiredForDatabaseMigration(tableWithAutoIncrement, withLogs = false).size)
Expand Down

0 comments on commit 338926a

Please sign in to comment.