1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-19 00:15:43 +01:00
unleash.unleash/src/migrations/20240125100000-events-system-user-old2new.js
David Leek 0045fcbcdf
chore: replace systemUser -1 with new -1337 system user (#5999)
## About the changes
This PR replaces the old systemUser -1 in user-service.ts with the new
SYSTEM_USER -1337 and adds a migration to move events created_by = -1 to
-1337


## Discussion points
Does it make sense to do both of these things? Or should we skip the
migration? How would this behave in a large system with hundreds of
thousands of events, should this be split up?
2024-01-25 11:19:39 +01:00

15 lines
263 B
JavaScript

'use strict';
exports.up = function (db, callback) {
db.runSql(
`
UPDATE events SET created_by_user_id = -1337 WHERE created_by_user_id = -1;
`,
callback,
);
};
exports.down = function (db, callback) {
callback();
};