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
Christopher Kolstad f85f66d4f5
feat: add project and environment columns to events (#942)
* feat: add project and environment columns to events

* Added events for feature_strategy update

* fix duplicate test key for dbInit

* Fix argument list for toggleService calls in tests
2021-09-20 12:13:38 +02:00

30 lines
658 B
JavaScript

'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,
);
};