mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-28 00:06:53 +01:00
d896dbd0c7
Initial architecture for last seen at by environment.
27 lines
629 B
JavaScript
27 lines
629 B
JavaScript
'use strict';
|
|
|
|
exports.up = function (db, callback) {
|
|
db.runSql(
|
|
`
|
|
CREATE TABLE last_seen_at_metrics (
|
|
feature_name VARCHAR(255),
|
|
environment VARCHAR(100),
|
|
last_seen_at TIMESTAMP WITH TIME ZONE NOT NULL,
|
|
PRIMARY KEY (feature_name, environment),
|
|
FOREIGN KEY (environment) REFERENCES environments(name) ON DELETE CASCADE
|
|
);
|
|
|
|
CREATE INDEX idx_feature_name
|
|
ON last_seen_at_metrics (feature_name);`,
|
|
callback(),
|
|
);
|
|
};
|
|
|
|
exports.down = function (db, callback) {
|
|
db.runSql(
|
|
`DROP TABLE last_seen_at_metrics;
|
|
`,
|
|
callback(),
|
|
);
|
|
};
|