diff --git a/packages/plugins/client/src/server/migrations/20230620203216-admin-ui-schema-uid.ts b/packages/plugins/client/src/server/migrations/20230620203216-admin-ui-schema-uid.ts index 1d93f8eb8..93ad6516f 100644 --- a/packages/plugins/client/src/server/migrations/20230620203216-admin-ui-schema-uid.ts +++ b/packages/plugins/client/src/server/migrations/20230620203216-admin-ui-schema-uid.ts @@ -10,6 +10,10 @@ export default class extends Migration { } const uiRoutes = this.db.getRepository('uiRoutes'); const routes = await uiRoutes.find(); + if (!uiRoutes) { + return; + } + await this.db.getCollection('systemSettings').sync(); for (const route of routes) { if (route.uiSchemaUid && route?.options?.component === 'AdminLayout') { const options = instance.options || {}; diff --git a/packages/plugins/mobile-client/src/server/migrations/20230620203218-mobile-ui-schema-uid.ts b/packages/plugins/mobile-client/src/server/migrations/20230620203218-mobile-ui-schema-uid.ts index e482a1ee0..c5be094ad 100644 --- a/packages/plugins/mobile-client/src/server/migrations/20230620203218-mobile-ui-schema-uid.ts +++ b/packages/plugins/mobile-client/src/server/migrations/20230620203218-mobile-ui-schema-uid.ts @@ -9,6 +9,10 @@ export default class extends Migration { return; } const uiRoutes = this.db.getRepository('uiRoutes'); + if (!uiRoutes) { + return; + } + await this.db.getCollection('systemSettings').sync(); const routes = await uiRoutes.find(); for (const route of routes) { if (route.uiSchemaUid && route?.options?.component === 'MApplication') {