From faf6c776df1ad320c274511d1247d4f95393d00f Mon Sep 17 00:00:00 2001 From: David Leek Date: Fri, 26 Jan 2024 08:08:55 +0100 Subject: [PATCH] chore: dont reset already migrated records for unkown, migration and init-api-tokens --- ...25090553-events-fix-incorrectly-assigned-sysuser-id.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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, );