From 82e84ec14de1a6d54149b0eb85e4d660d8384b94 Mon Sep 17 00:00:00 2001 From: Mateusz Kwasniewski Date: Tue, 30 Jan 2024 13:28:10 +0100 Subject: [PATCH] feat: migration for health and time_to_production in flag trends (#6067) --- ...57-flag-trends-health-time-to-production.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/migrations/20240130104757-flag-trends-health-time-to-production.js diff --git a/src/migrations/20240130104757-flag-trends-health-time-to-production.js b/src/migrations/20240130104757-flag-trends-health-time-to-production.js new file mode 100644 index 0000000000..8c308eebb3 --- /dev/null +++ b/src/migrations/20240130104757-flag-trends-health-time-to-production.js @@ -0,0 +1,18 @@ +'use strict'; + +exports.up = function(db, cb) { + db.runSql( + ` + ALTER TABLE flag_trends ADD COLUMN IF NOT EXISTS health INTEGER DEFAULT 100; + ALTER TABLE flag_trends ADD COLUMN IF NOT EXISTS time_to_production FLOAT DEFAULT 0; + `, + cb, + ); +}; + +exports.down = function(db, cb) { + db.runSql(` + ALTER TABLE flag_trends DROP COLUMN IF EXISTS health; + ALTER TABLE flag_trends DROP COLUMN IF EXISTS time_to_production; + `, cb); +};