mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01: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:
parent
1c95029319
commit
d632690203
21
src/migrations/20231212094044-event-created-by-user-id.js
Normal file
21
src/migrations/20231212094044-event-created-by-user-id.js
Normal 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,
|
||||
);
|
||||
};
|
Loading…
Reference in New Issue
Block a user