diff --git a/exposed-tests/src/test/kotlin/org/jetbrains/exposed/sql/tests/shared/ddl/DatabaseMigrationTests.kt b/exposed-tests/src/test/kotlin/org/jetbrains/exposed/sql/tests/shared/ddl/DatabaseMigrationTests.kt index b8fac58c78..c47db4866d 100644 --- a/exposed-tests/src/test/kotlin/org/jetbrains/exposed/sql/tests/shared/ddl/DatabaseMigrationTests.kt +++ b/exposed-tests/src/test/kotlin/org/jetbrains/exposed/sql/tests/shared/ddl/DatabaseMigrationTests.kt @@ -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("test_table") { + override val id: Column> = long("id").autoIncrement().entityId() + override val primaryKey = PrimaryKey(id) + } + } else { + tableWithAutoIncrement + } + SchemaUtils.create(tableWithAutoIncrement) assertEquals(0, MigrationUtils.statementsRequiredForDatabaseMigration(tableWithAutoIncrement, withLogs = false).size)