Skip to content

Commit

Permalink
chore: add a migration that removes incorrectly set sysuserid (#6032)
Browse files Browse the repository at this point in the history
## 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
  • Loading branch information
daveleek authored Jan 29, 2024
1 parent e652af4 commit bbebd29
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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',
'[email protected]');
`,
cb,
);
};

exports.down = function (db, cb) {
cb();
};

0 comments on commit bbebd29

Please sign in to comment.