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

chore: clear scim fields when deleting user + migration for existing cases (#9217)

This commit is contained in:
David Leek 2025-02-05 15:45:51 +01:00 committed by GitHub
parent a15d63672f
commit 9a8607b07e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 0 deletions

View File

@ -197,6 +197,8 @@ class UserStore implements IUserStore {
deleted_at: new Date(),
email: null,
username: null,
scim_id: null,
scim_external_id: null,
name: this.db.raw('name || ?', '(Deleted)'),
});
}

View File

@ -0,0 +1,14 @@
exports.up = (db, cb) => {
db.runSql(`
UPDATE users
SET
scim_id = NULL,
scim_external_id = NULL
WHERE deleted_at IS NOT NULL AND scim_id IS NOT NULL;
`, cb);
};
exports.down = (db, cb) => {
cb();
};