diff --git a/src/migrations/20240125090553-events-fix-incorrectly-assigned-sysuser-id.js b/src/migrations/20240125090553-events-fix-incorrectly-assigned-sysuser-id.js index af1ccbd668b3..52e0cd0d6325 100644 --- a/src/migrations/20240125090553-events-fix-incorrectly-assigned-sysuser-id.js +++ b/src/migrations/20240125090553-events-fix-incorrectly-assigned-sysuser-id.js @@ -4,8 +4,12 @@ exports.up = function (db, cb) { UPDATE events SET created_by_user_id = null WHERE created_by_user_id = -1337 AND - created_by = 'unleash_system_user' OR - created_by = 'systemuser@getunleash.io'; + created_by NOT IN ( + 'unknown', + 'migration', + 'init-api-tokens', + 'unleash_system_user', + 'systemuser@getunleash.io') `, cb, );