diff --git a/packages/backend-core/src/environment.ts b/packages/backend-core/src/environment.ts index 138dbbd9e0..66c91b19fb 100644 --- a/packages/backend-core/src/environment.ts +++ b/packages/backend-core/src/environment.ts @@ -183,6 +183,7 @@ const environment = { environment[key] = value }, ROLLING_LOG_MAX_SIZE: process.env.ROLLING_LOG_MAX_SIZE || "10M", + SKIP_APP_MIGRATIONS: process.env.SKIP_APP_MIGRATIONS || false, } // clean up any environment variable edge cases diff --git a/packages/server/src/middleware/appMigrations.ts b/packages/server/src/middleware/appMigrations.ts index 36e021c7ed..1fb13094c6 100644 --- a/packages/server/src/middleware/appMigrations.ts +++ b/packages/server/src/middleware/appMigrations.ts @@ -1,9 +1,14 @@ import { UserCtx } from "@budibase/types" import { checkMissingMigrations } from "../appMigrations" +import { env } from "@budibase/backend-core" export default async (ctx: UserCtx, next: any) => { const { appId } = ctx + if (env.SKIP_APP_MIGRATIONS) { + return next() + } + if (!appId) { return next() }