1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00
unleash.unleash/src/migrations/20230316092547-remove-project-stats-column.js
Fredrik Strand Oseberg e2ad0cae45
fix: refactor calculate time to prod (#3333)
This PR changes how we calculate average time to production. Instead of
calculating fleeting 30 day windows and calculating the past and current
window, we now calculate a flat average across the entire project life.
This is less error prone as each feature will be tied to the earliest
time it was turned on in a production environment.
2023-03-16 15:45:24 +01:00

20 lines
392 B
JavaScript

exports.up = function (db, cb) {
db.runSql(
`
ALTER table project_stats
DROP COLUMN avg_time_to_prod_past_window
`,
cb,
);
};
exports.down = function (db, cb) {
db.runSql(
`
ALTER table project_stats
ADD COLUMN IF NOT EXISTS avg_time_to_prod_past_window INTEGER DEFAULT 0
`,
cb,
);
};