From 236ee3de96696f03981f07d3a7334a37f04b8e11 Mon Sep 17 00:00:00 2001 From: kwasniew Date: Tue, 30 Jan 2024 11:55:01 +0100 Subject: [PATCH] feat: migration for health and time_to_production in flag trends --- ...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 000000000000..8c308eebb372 --- /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); +};