fix: Remove migrations from pending when they fail

This commit is contained in:
zkldi
2022-04-21 18:36:27 +01:00
parent 6941c0707e
commit 960a7e93d3
+3
View File
@@ -166,6 +166,9 @@ export async function ApplyMigration(migrationID: string) {
);
}
// remove the stale migration so it can be re-ran in the future.
await db.migrations.findOneAndDelete({ migrationID });
process.exit(1);
}
}