mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-06 00:07:44 +01:00
4ea4bcfaf4
* Fixes broken down migration
29 lines
923 B
JavaScript
29 lines
923 B
JavaScript
exports.up = function (db, cb) {
|
|
db.runSql(
|
|
`CREATE TABLE IF NOT EXISTS project_stats (
|
|
project VARCHAR(255) NOT NULL,
|
|
avg_time_to_prod_current_window FLOAT DEFAULT 0,
|
|
avg_time_to_prod_past_window FLOAT DEFAULT 0,
|
|
project_changes_current_window INTEGER DEFAULT 0,
|
|
project_changes_past_window INTEGER DEFAULT 0,
|
|
features_created_current_window INTEGER DEFAULT 0,
|
|
features_created_past_window INTEGER DEFAULT 0,
|
|
features_archived_current_window INTEGER DEFAULT 0,
|
|
features_archived_past_window INTEGER DEFAULT 0,
|
|
FOREIGN KEY (project) references projects(id) ON DELETE CASCADE,
|
|
UNIQUE(project)
|
|
);
|
|
`,
|
|
cb,
|
|
);
|
|
};
|
|
|
|
exports.down = function (db, cb) {
|
|
db.runSql(
|
|
`
|
|
DROP TABLE project_stats;
|
|
`,
|
|
cb,
|
|
);
|
|
};
|