diff --git a/src/migrations/20240305121702-add-metrics-summary-columns-to-flag-trends.js b/src/migrations/20240305121702-add-metrics-summary-columns-to-flag-trends.js new file mode 100644 index 0000000000..91178f7f12 --- /dev/null +++ b/src/migrations/20240305121702-add-metrics-summary-columns-to-flag-trends.js @@ -0,0 +1,25 @@ +'use strict'; + +exports.up = function(db, cb) { + db.runSql( + ` + ALTER TABLE IF EXISTS flag_trends + ADD COLUMN total_yes integer, + ADD COLUMN total_no integer, + ADD COLUMN total_apps integer, + ADD COLUMN total_environments integer; + `, + cb, + ); +}; + +exports.down = function(db, cb) { + db.runSql(`ALTER TABLE IF EXISTS flag_trends + DROP COLUMN IF EXISTS total_no, + DROP COLUMN IF EXISTS total_apps, + DROP COLUMN IF EXISTS total_environments, + DROP COLUMN IF EXISTS total_yes;` + , + cb + ); +};