From 923e9d8ec462726ec9db3b117e8933eec316727d Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 1 Mar 2023 19:17:45 +0000 Subject: [PATCH] Adding in test check. --- packages/backend-core/src/migrations/migrations.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/backend-core/src/migrations/migrations.ts b/packages/backend-core/src/migrations/migrations.ts index 48d3b14a4a..43d3e7fe72 100644 --- a/packages/backend-core/src/migrations/migrations.ts +++ b/packages/backend-core/src/migrations/migrations.ts @@ -17,6 +17,7 @@ import { MigrationNoOpOptions, App, } from "@budibase/types" +import env from "../environment" export const getMigrationsDoc = async (db: any) => { // get the migrations doc @@ -88,7 +89,8 @@ export const runMigration = async ( const db = getDB(dbName, { skip_setup: true }) // DB doesn't exist - no-op required - if (!(await db.exists())) { + const dbExists = await db.exists() + if (!env.isTest() && !dbExists) { continue } try {