Skip to content

Commit

Permalink
Feat: add enviroment type trends table (#6432)
Browse files Browse the repository at this point in the history
Creates the environment_type_trends table to store aggregated metrics

Closes: #
[1-2124](https://linear.app/unleash/issue/1-2124/create-the-table-to-store-weekly-aggregation)

Signed-off-by: andreas-unleash <[email protected]>
  • Loading branch information
andreas-unleash authored Mar 5, 2024
1 parent 6cede44 commit 6236184
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/migrations/20240304160659-add-environment-type-trends.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'use strict';

exports.up = function(db, cb) {
db.runSql(
`
CREATE TABLE IF NOT EXISTS environment_type_trends (
id VARCHAR(255) NOT NULL,
environment_type VARCHAR(255) NOT NULL,
total_updates INTEGER NOT NULL,
PRIMARY KEY (id, environment_type)
);`,
cb,
);
};

exports.down = function(db, cb) {
db.runSql('DROP TABLE IF EXISTS environment_type_trends;', cb);
};

0 comments on commit 6236184

Please sign in to comment.