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:
parent
a15d63672f
commit
9a8607b07e
@ -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)'),
|
||||
});
|
||||
}
|
||||
|
@ -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();
|
||||
};
|
Loading…
Reference in New Issue
Block a user