exposed-jdbc/src/main/kotlin/org/jetbrains/exposed/v1/jdbc/statements/jdbc/JdbcDatabaseMetadataImpl.kt [486:509]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - allTables: Map, isMysqlDialect: Boolean ): Pair? { val fromTableName = getString("FKTABLE_NAME")!! if (isMysqlDialect && fromTableName !in allTables.keys) return null val fromColumnName = identifierManager.quoteIdentifierWhenWrongCaseOrNecessary( getString("FKCOLUMN_NAME")!! ) val fromColumn = allTables[fromTableName]?.columns?.firstOrNull { val identifier = if (isMysqlDialect) it.nameInDatabaseCase() else it.name identifierManager.quoteIdentifierWhenWrongCaseOrNecessary(identifier) == fromColumnName } ?: return null // Do not crash if there are missing fields in Exposed's tables val constraintName = getString("FK_NAME")!! val targetTableName = getString("PKTABLE_NAME")!! val targetColumnName = identifierManager.quoteIdentifierWhenWrongCaseOrNecessary( if (isMysqlDialect) { getString("PKCOLUMN_NAME")!! } else { identifierManager.inProperCase(getString("PKCOLUMN_NAME")!!) } ) val targetColumn = allTables[targetTableName]?.columns?.firstOrNull { identifierManager.quoteIdentifierWhenWrongCaseOrNecessary(it.nameInDatabaseCase()) == targetColumnName } ?: return null // Do not crash if there are missing fields in Exposed's tables - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - exposed-r2dbc/src/main/kotlin/org/jetbrains/exposed/v1/r2dbc/statements/api/R2dbcDatabaseMetadataImpl.kt [353:376]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - allTables: Map, isMysqlDialect: Boolean ): Pair? { val fromTableName = getString("FKTABLE_NAME")!! if (isMysqlDialect && fromTableName !in allTables.keys) return null val fromColumnName = identifierManager.quoteIdentifierWhenWrongCaseOrNecessary( getString("FKCOLUMN_NAME")!! ) val fromColumn = allTables[fromTableName]?.columns?.firstOrNull { val identifier = if (isMysqlDialect) it.nameInDatabaseCase() else it.name identifierManager.quoteIdentifierWhenWrongCaseOrNecessary(identifier) == fromColumnName } ?: return null // Do not crash if there are missing fields in Exposed's tables val constraintName = getString("FK_NAME")!! val targetTableName = getString("PKTABLE_NAME")!! val targetColumnName = identifierManager.quoteIdentifierWhenWrongCaseOrNecessary( if (isMysqlDialect) { getString("PKCOLUMN_NAME")!! } else { identifierManager.inProperCase(getString("PKCOLUMN_NAME")!!) } ) val targetColumn = allTables[targetTableName]?.columns?.firstOrNull { identifierManager.quoteIdentifierWhenWrongCaseOrNecessary(it.nameInDatabaseCase()) == targetColumnName } ?: return null // Do not crash if there are missing fields in Exposed's tables - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -