Merge remote-tracking branch 'origin/api-v1.8.2' into dev
This commit is contained in:
commit
ffb62af9e3
2 changed files with 5 additions and 1 deletions
|
|
@ -528,7 +528,7 @@ def delete_member(user_id, tenant_id, id_to_delete):
|
|||
with pg_client.PostgresClient() as cur:
|
||||
cur.execute(
|
||||
cur.mogrify(f"""UPDATE public.users
|
||||
SET deleted_at = timezone('utc'::text, now())
|
||||
SET deleted_at = timezone('utc'::text, now()), role_id=NULL
|
||||
WHERE user_id=%(user_id)s AND tenant_id=%(tenant_id)s;""",
|
||||
{"user_id": id_to_delete, "tenant_id": tenant_id}))
|
||||
cur.execute(
|
||||
|
|
|
|||
|
|
@ -63,4 +63,8 @@ $$ LANGUAGE plpgsql;
|
|||
ALTER TABLE IF EXISTS sessions
|
||||
ADD COLUMN IF NOT EXISTS file_key BYTEA DEFAULT NULL;
|
||||
|
||||
UPDATE users
|
||||
SET role_id=NULL
|
||||
WHERE deleted_at IS NOT NULL;
|
||||
|
||||
COMMIT;
|
||||
Loading…
Add table
Reference in a new issue