-
-
Notifications
You must be signed in to change notification settings - Fork 732
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}; |