1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-20 00:08:02 +01:00

chore: add a migration that removes incorrectly set sysuserid (#6032)

## About the changes

Resets created_by_user_id on events incorrectly marked as -1337 when an actual user has been set in created_by column, to clean up after a bug
This commit is contained in:
David Leek 2024-01-29 09:16:18 +01:00 committed by GitHub
parent e652af49af
commit bbebd293e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,20 @@
exports.up = function (db, cb) {
db.runSql(
`
UPDATE events SET created_by_user_id = null
WHERE
created_by_user_id = -1337 AND
created_by NOT IN (
'unknown',
'migration',
'init-api-tokens',
'unleash_system_user',
'systemuser@getunleash.io');
`,
cb,
);
};
exports.down = function (db, cb) {
cb();
};