1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00
unleash.unleash/src/migrations/20210915122001-add-project-and-environment-columns-to-events.js

30 lines
658 B
JavaScript
Raw Normal View History

'use strict';
exports.up = function (db, cb) {
db.runSql(
`
ALTER TABLE events
ADD COLUMN project TEXT;
ALTER TABLE events
ADD COLUMN environment TEXT;
CREATE INDEX events_project_idx ON events(project);
CREATE INDEX events_environment_idx ON events(environment);
`,
cb,
);
};
exports.down = function (db, cb) {
db.runSql(
`
DROP INDEX events_environment_idx;
DROP INDEX events_project_idx;
ALTER TABLE events
DROP COLUMN environment;
ALTER TABLE events
DROP COLUMN project;
`,
cb,
);
};