1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00

chore: add created by user id to events (#5621)

## 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>
This commit is contained in:
David Leek 2023-12-12 15:57:59 +01:00 committed by GitHub
parent 1c95029319
commit d632690203
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,21 @@
'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,
);
};