From 21956f096d89ec84bf0a4ec3bc8a32678c326163 Mon Sep 17 00:00:00 2001 From: Keith Williams Date: Mon, 25 Nov 2024 16:33:51 -0300 Subject: [PATCH] chore: Add check to skip DB migrations as part of build (#17827) --- packages/prisma/auto-migrations.ts | 4 ++++ turbo.json | 1 + 2 files changed, 5 insertions(+) diff --git a/packages/prisma/auto-migrations.ts b/packages/prisma/auto-migrations.ts index 3ae7c24a5f..2286f5d801 100644 --- a/packages/prisma/auto-migrations.ts +++ b/packages/prisma/auto-migrations.ts @@ -14,6 +14,10 @@ const exec = promisify(execCb); * @see https://github.com/prisma/prisma/issues/4703#issuecomment-1447354363 */ async function main(): Promise { + if (process.env.SKIP_DB_MIGRATIONS === "1") { + console.info("SKIP_DB_MIGRATIONS set, skipping migrations"); + return; + } if (!process.env.DATABASE_URL) { console.info("No DATABASE_URL found, skipping migrations"); return; diff --git a/turbo.json b/turbo.json index 4ed07ff993..743703ad38 100644 --- a/turbo.json +++ b/turbo.json @@ -403,6 +403,7 @@ "SENTRY_DISABLE_CLIENT_SOURCE_MAPS", "SENTRY_DISABLE_SERVER_SOURCE_MAPS", "SENTRY_DISABLE_SERVER_WEBPACK_PLUGIN", + "SKIP_DB_MIGRATIONS", "SLACK_CLIENT_ID", "SLACK_CLIENT_SECRET", "SLACK_SIGNING_SECRET",