From f49104a19ea1bcae1974f2d42db2f65f2819501e Mon Sep 17 00:00:00 2001 From: bholmesdev Date: Tue, 6 Feb 2024 17:27:43 -0500 Subject: [PATCH] feat: add pragma when pushing migrations --- packages/db/src/core/cli/commands/push/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/db/src/core/cli/commands/push/index.ts b/packages/db/src/core/cli/commands/push/index.ts index 5809f0e7d1..f2811378f8 100644 --- a/packages/db/src/core/cli/commands/push/index.ts +++ b/packages/db/src/core/cli/commands/push/index.ts @@ -190,7 +190,7 @@ async function pushData({ } async function runMigrateQuery({ - queries, + queries: baseQueries, migrations, snapshot, appToken, @@ -202,6 +202,8 @@ async function runMigrateQuery({ appToken: string; isDryRun?: boolean; }) { + const queries = ['pragma defer_foreign_keys=true;', ...baseQueries]; + const requestBody = { snapshot, migrations,