Skip to content

Commit

Permalink
feat: flag trends db migration
Browse files Browse the repository at this point in the history
  • Loading branch information
kwasniew committed Jan 26, 2024
1 parent 32dd377 commit 6ea9e96
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/migrations/20240126095544-add-flag-trends.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'use strict';

exports.up = function(db, cb) {
db.runSql(
`
CREATE TABLE IF NOT EXISTS flag_trends (
id VARCHAR(255) NOT NULL,
project VARCHAR(255) NOT NULL REFERENCES projects (id) ON DELETE CASCADE,
total_flags INTEGER NOT NULL,
stale_flags INTEGER NOT NULL,
potentially_stale_flags INTEGER NOT NULL,
created_at TIMESTAMP default now(),
PRIMARY KEY (id, project)
);`,
cb,
);
};

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

0 comments on commit 6ea9e96

Please sign in to comment.