mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-04 00:18:01 +01:00
## About the changes Adds the column `created_by_user_id` to `events` table and adds index for it --------- Co-authored-by: Christopher Kolstad <chriswk@getunleash.ai>
22 lines
515 B
JavaScript
22 lines
515 B
JavaScript
'use strict';
|
|
|
|
exports.up = function (db, callback) {
|
|
db.runSql(
|
|
`
|
|
ALTER TABLE events ADD COLUMN IF NOT EXISTS created_by_user_id INTEGER;
|
|
CREATE INDEX events_created_by_user_id_idx ON events(created_by_user_id);
|
|
`,
|
|
callback,
|
|
);
|
|
};
|
|
|
|
exports.down = function (db, callback) {
|
|
db.runSql(
|
|
`
|
|
DROP INDEX IF EXISTS events_created_by_user_id_idx;
|
|
ALTER TABLE events DROP COLUMN IF EXISTS created_by_user_id;
|
|
`,
|
|
callback,
|
|
);
|
|
};
|