From 68095916e84461042d0ac56de0f54115316eb1a0 Mon Sep 17 00:00:00 2001 From: Mateusz Kwasniewski Date: Thu, 29 Feb 2024 10:56:14 +0100 Subject: [PATCH] fix: relax trends tables constraints (#6386) --- ...0229093231-drop-fk-and-cascade-in-trends.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/migrations/20240229093231-drop-fk-and-cascade-in-trends.js diff --git a/src/migrations/20240229093231-drop-fk-and-cascade-in-trends.js b/src/migrations/20240229093231-drop-fk-and-cascade-in-trends.js new file mode 100644 index 0000000000..38c566f0e2 --- /dev/null +++ b/src/migrations/20240229093231-drop-fk-and-cascade-in-trends.js @@ -0,0 +1,18 @@ +exports.up = function (db, cb) { + db.runSql( + ` + ALTER TABLE flag_trends DROP CONSTRAINT IF EXISTS flag_trends_project_fkey; + ALTER TABLE project_client_metrics_trends DROP CONSTRAINT IF EXISTS project_client_metrics_trends_project_fkey; + `, + cb, + ); +}; + +exports.down = function (db, cb) { + db.runSql( + ` + + `, + cb, + ); +};