1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-09 00:18:00 +01:00
unleash.unleash/src/migrations/20240305121702-add-metrics-summary-columns-to-flag-trends.js
andreas-unleash 1915b77b9b
Feat: add metrics summary columns to flag trends (#6440)
Adds the metrics summary trend columns to flag_trends table.
These will be populated with the rest of the weekly aggregations

Closes
[1-2139](https://linear.app/unleash/issue/1-2139/add-the-summary-columns-to-flag-trends-table)

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2024-03-05 16:49:17 +02:00

26 lines
612 B
JavaScript

'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
);
};