From 15eb170f415d500d39bfc78744657a720ef70bdd Mon Sep 17 00:00:00 2001 From: ChengLei Shao Date: Wed, 9 Oct 2024 14:58:38 +0800 Subject: [PATCH] chore: not throw error when drop view without permission (#5377) --- .../core/database/src/query-interface/query-interface.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/core/database/src/query-interface/query-interface.ts b/packages/core/database/src/query-interface/query-interface.ts index f042530fd4..c7d484ccb7 100644 --- a/packages/core/database/src/query-interface/query-interface.ts +++ b/packages/core/database/src/query-interface/query-interface.ts @@ -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);