exposed-migration-jdbc/src/main/kotlin/org/jetbrains/exposed/v1/migration/jdbc/MigrationUtils.kt [241:257]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - val foreignKeyConstraints = currentDialectMetadata.columnConstraints(*tables) val existingIndices = currentDialectMetadata.existingIndices(*tables) @OptIn(InternalApi::class) val filteredIndices = existingIndices.filterAndLogMissingAndUnmappedIndices( foreignKeyConstraints.keys, withDropIndices = true, withLogs, tables = tables ) val (createMissing, dropUnmapped) = filteredIndices @OptIn(InternalApi::class) return createMissing.flatMap { it.createStatement() } + dropUnmapped.flatMap { it.dropStatement() } + foreignKeyConstraints.filterAndLogExcessConstraints(withLogs).flatMap { it.dropStatement() } + existingIndices.filterAndLogExcessIndices(withLogs).flatMap { it.dropStatement() } + checkUnmappedSequences(tables = tables, withLogs).flatMap { it.dropStatement() } + checkMissingCheckConstraints(tables = tables, withLogs).flatMap { it.createStatement() } + checkUnmappedCheckConstraints(tables = tables, withLogs).flatMap { it.dropStatement() } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - exposed-migration-r2dbc/src/main/kotlin/org/jetbrains/exposed/v1/migration/r2dbc/MigrationUtils.kt [241:257]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - val foreignKeyConstraints = currentDialectMetadata.columnConstraints(*tables) val existingIndices = currentDialectMetadata.existingIndices(*tables) @OptIn(InternalApi::class) val filteredIndices = existingIndices.filterAndLogMissingAndUnmappedIndices( foreignKeyConstraints.keys, withDropIndices = true, withLogs, tables = tables ) val (createMissing, dropUnmapped) = filteredIndices @OptIn(InternalApi::class) return createMissing.flatMap { it.createStatement() } + dropUnmapped.flatMap { it.dropStatement() } + foreignKeyConstraints.filterAndLogExcessConstraints(withLogs).flatMap { it.dropStatement() } + existingIndices.filterAndLogExcessIndices(withLogs).flatMap { it.dropStatement() } + checkUnmappedSequences(tables = tables, withLogs).flatMap { it.dropStatement() } + checkMissingCheckConstraints(tables = tables, withLogs).flatMap { it.createStatement() } + checkUnmappedCheckConstraints(tables = tables, withLogs).flatMap { it.dropStatement() } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -