From a70e95fb7ecae8d5dcf01250df3e7ef9f98934f5 Mon Sep 17 00:00:00 2001 From: Nicolas Meienberger Date: Mon, 16 Feb 2026 23:29:36 +0100 Subject: [PATCH] chore: enable foreign keys constraints in CLI runs --- app/server/cli/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/server/cli/index.ts b/app/server/cli/index.ts index c7d2e15..04638c4 100644 --- a/app/server/cli/index.ts +++ b/app/server/cli/index.ts @@ -4,6 +4,7 @@ import { changeUsernameCommand } from "./commands/change-username"; import { disable2FACommand } from "./commands/disable-2fa"; import { rekey2FACommand } from "./commands/rekey-2fa"; import { resetPasswordCommand } from "./commands/reset-password"; +import { db } from "../db/db"; const program = new Command(); @@ -15,6 +16,8 @@ program.addCommand(rekey2FACommand); program.addCommand(assignOrganizationCommand); export async function runCLI(argv: string[]): Promise { + db.run("PRAGMA foreign_keys = ON;"); + const args = argv.slice(2); const isCLIMode = process.env.ZEROBYTE_CLI === "1";