From 4a1a434556db9efb668aa070054e662391c66e05 Mon Sep 17 00:00:00 2001 From: William Petit Date: Mon, 4 Mar 2024 09:09:44 +0100 Subject: [PATCH] fix(migrations): disable foreign keys for migrating tenants --- migrations/sqlite/0000003_tenant.up.sql | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/migrations/sqlite/0000003_tenant.up.sql b/migrations/sqlite/0000003_tenant.up.sql index c272199..940bb73 100644 --- a/migrations/sqlite/0000003_tenant.up.sql +++ b/migrations/sqlite/0000003_tenant.up.sql @@ -1,3 +1,5 @@ +PRAGMA foreign_keys = 0; + CREATE TABLE tenants ( id TEXT PRIMARY KEY, label TEXT NOT NULL, @@ -49,4 +51,6 @@ CREATE TABLE specs INSERT INTO specs SELECT id, agent_id, name, revision, data, created_at, updated_at, 0 FROM _specs; -DROP TABLE _specs; \ No newline at end of file +DROP TABLE _specs; + +PRAGMA foreign_keys = 1; \ No newline at end of file