exposed-jdbc/src/main/kotlin/org/jetbrains/exposed/v1/jdbc/SchemaUtils.kt [85:122]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (tables.isEmpty()) return emptyList() val statements = ArrayList() @OptIn(InternalApi::class) val existingTablesColumns = logTimeSpent(COLUMNS_LOG_MESSAGE, withLogs) { currentDialectMetadata.tableColumns(*tables) } @OptIn(InternalApi::class) val existingPrimaryKeys = logTimeSpent(PRIMARY_KEYS_LOG_MESSAGE, withLogs) { currentDialectMetadata.existingPrimaryKeys(*tables) } val dbSupportsAlterTableWithAddColumn = TransactionManager.current().db.supportsAlterTableWithAddColumn val isIncorrectType = { columnMetadata: ColumnMetadata, column: Column<*> -> currentDialectMetadata.areEquivalentColumnTypes( columnMetadata.sqlType, columnMetadata.jdbcType, column.columnType.sqlType() ).not() } @OptIn(InternalApi::class) for (table in tables) { table.mapMissingColumnStatementsTo( statements, existingTablesColumns[table].orEmpty(), existingPrimaryKeys[table], dbSupportsAlterTableWithAddColumn, isIncorrectType ) } // While SQLite does allow some ALTER TABLE syntax, ADD/DROP CONSTRAINT is still not supported. // ForeignKeyConstraint statement builders would return empty list at lowest level, but this avoids metadata check entirely. @OptIn(InternalApi::class) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - exposed-r2dbc/src/main/kotlin/org/jetbrains/exposed/v1/r2dbc/SchemaUtils.kt [83:118]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (tables.isEmpty()) return emptyList() val statements = ArrayList() @OptIn(InternalApi::class) val existingTablesColumns = logTimeSpent(COLUMNS_LOG_MESSAGE, withLogs) { currentDialectMetadata.tableColumns(*tables) } @OptIn(InternalApi::class) val existingPrimaryKeys = logTimeSpent(PRIMARY_KEYS_LOG_MESSAGE, withLogs) { currentDialectMetadata.existingPrimaryKeys(*tables) } val dbSupportsAlterTableWithAddColumn = TransactionManager.current().db.supportsAlterTableWithAddColumn val isIncorrectType = { columnMetadata: ColumnMetadata, column: Column<*> -> currentDialectMetadata.areEquivalentColumnTypes( columnMetadata.sqlType, columnMetadata.jdbcType, column.columnType.sqlType() ).not() } @OptIn(InternalApi::class) for (table in tables) { table.mapMissingColumnStatementsTo( statements, existingTablesColumns[table].orEmpty(), existingPrimaryKeys[table], dbSupportsAlterTableWithAddColumn, isIncorrectType ) } @OptIn(InternalApi::class) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -