MCPcopy
hub / github.com/CapSoftware/Cap / migrateDb

Function migrateDb

packages/database/migrate.ts:23–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21}
22
23export async function migrateDb() {
24 try {
25 await runMigrate();
26 } catch (e) {
27 if (!errorIsOrgIdMigration(e)) throw e;
28
29 console.log("non-null videos.orgId migration failed, running backfill");
30
31 await runOrgIdBackfill();
32
33 try {
34 await runMigrate();
35 } catch (retryError) {
36 if (errorIsOrgIdMigration(retryError)) {
37 throw new Error(
38 "videos.orgId backfill failed, you will need to manually update the videos.orgId column before attempting to migrate again.",
39 );
40 }
41 throw retryError;
42 }
43 }
44
45 await runSpaceMemberRoleBackfill();
46}

Callers 1

runMigrationsFunction · 0.90

Calls 4

runOrgIdBackfillFunction · 0.90
runMigrateFunction · 0.85
errorIsOrgIdMigrationFunction · 0.85

Tested by

no test coverage detected