chore: not throw error when drop view without permission (#5377)

This commit is contained in:
ChengLei Shao 2024-10-09 14:58:38 +08:00 committed by GitHub
parent 1fc2f388e3
commit 15eb170f41
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -55,7 +55,11 @@ export default abstract class QueryInterface {
removeSql = `DROP VIEW IF EXISTS ${view.name}`;
}
await this.db.sequelize.query(removeSql, { transaction: options.transaction });
try {
await this.db.sequelize.query(removeSql, { transaction: options.transaction });
} catch (e) {
console.log(`can not drop view ${view.name}, ${e.message}`);
}
}
await this.db.sequelize.getQueryInterface().dropAllTables(options);