Skip to content

Commit 6c30402

Browse files
authored
[mysql-kit]: handle lowercase information_schema_table_constraints columns
In certain circumstances the information_schema columns are lowercased from the db. This updates the mysqlSerializer to handle this case. Fixes drizzle-team#3884
1 parent f39f885 commit 6c30402

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drizzle-kit/src/serializer/mysqlSerializer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -968,9 +968,9 @@ AND
968968
progressCallback('checks', checksCount, 'fetching');
969969
}
970970
for (const checkConstraintRow of checkConstraints) {
971-
const constraintName = checkConstraintRow['CONSTRAINT_NAME'];
972-
const constraintValue = checkConstraintRow['CHECK_CLAUSE'];
973-
const tableName = checkConstraintRow['TABLE_NAME'];
971+
const constraintName = checkConstraintRow['CONSTRAINT_NAME'] ?? checkConstraintRow['constraint_name'];
972+
const constraintValue = checkConstraintRow['CHECK_CLAUSE'] ?? checkConstraintRow['check_clause'];
973+
const tableName = checkConstraintRow['TABLE_NAME'] ?? checkConstraintRow['table_name'];
974974

975975
const tableInResult = result[tableName];
976976
// if (typeof tableInResult === 'undefined') continue;

0 commit comments

Comments
 (0)