chore: show constraints query path

This commit is contained in:
Chareice 2023-02-14 21:35:44 +08:00
parent 130fe22704
commit f82be2a207

View File

@ -89,7 +89,13 @@ export function patchSequelizeQueryInterface(db: Database) {
//@ts-ignore
const queryGenerator = db.sequelize.dialect.queryGenerator;
const originalShowConstraintsQuery = queryGenerator.showConstraintsQuery;
queryGenerator.showConstraintsQuery = (tableName, constraintName) => {
if (!constraintName) {
return originalShowConstraintsQuery.call(queryGenerator, tableName, constraintName);
}
const lines = [
'SELECT constraint_catalog AS "constraintCatalog",',
'constraint_schema AS "constraintSchema",',