Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions packages/core/src/projects/revert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,18 @@ export const revertProject = async (
for (const extension of reversedExtensions) {
try {
if (extensions.external.includes(extension)) {
const msg = `DROP EXTENSION IF EXISTS "${extension}" CASCADE;`;
const msg = `DROP EXTENSION IF EXISTS "${extension}" RESTRICT;`;
log.warn(`⚠️ Dropping external extension: ${extension}`);
log.debug(`> ${msg}`);
await pgPool.query(msg);
try {
await pgPool.query(msg);
} catch (err: any) {
if (err.code === '2BP01') { // dependent_objects_still_exist
log.warn(`⚠️ Cannot drop extension ${extension} due to dependencies, skipping`);
} else {
throw err;
}
}
} else {
const modulePath = resolve(mod.workspacePath, modules[extension].path);
log.info(`📂 Reverting local module: ${extension}`);
Expand Down