fix: ignore error on insert into PatchRun

This commit is contained in:
18alantom
2023-08-22 11:18:36 +05:30
parent f89f3cbe7b
commit c558ee1fa3
+10 -1
View File
@@ -47,5 +47,14 @@ async function makeEntry(
defaultFieldValueMap.failed = failed;
defaultFieldValueMap.version = version;
await dm.db!.insert('PatchRun', defaultFieldValueMap);
try {
await dm.db!.insert('PatchRun', defaultFieldValueMap);
} catch {
/**
* Error is thrown if PatchRun table hasn't been migrated.
* In this case, PatchRun will migrated post pre-migration-patches
* are run and rerun the patch.
*/
return;
}
}