Update GDPR scripts for latest DB schema (#17917)
This commit is contained in:
committed by
GitHub
parent
61332a5814
commit
61f9fe68f4
@@ -12,7 +12,7 @@ import os
|
||||
import psycopg2
|
||||
from uuid import UUID
|
||||
|
||||
LATEST_DB_MIGRATION = "20220816163319_Traits"
|
||||
LATEST_DB_MIGRATION = "20230402214647_BanAutoDelete"
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
@@ -39,6 +39,7 @@ def main():
|
||||
clear_player(cur, user_id)
|
||||
clear_preference(cur, user_id)
|
||||
clear_server_ban(cur, user_id)
|
||||
clear_server_ban_exemption(cur, user_id)
|
||||
clear_server_role_ban(cur, user_id)
|
||||
clear_uploaded_resource_log(cur, user_id)
|
||||
clear_whitelist(cur, user_id)
|
||||
@@ -153,6 +154,17 @@ WHERE
|
||||
""", (user_id,))
|
||||
|
||||
|
||||
def clear_server_ban_exemption(cur: "psycopg2.cursor", user_id: str):
|
||||
print("Clearing server_ban_exemption...")
|
||||
|
||||
cur.execute("""
|
||||
DELETE FROM
|
||||
server_ban_exemption
|
||||
WHERE
|
||||
user_id = %s
|
||||
""", (user_id,))
|
||||
|
||||
|
||||
def clear_server_role_ban(cur: "psycopg2.cursor", user_id: str):
|
||||
print("Clearing server_role_ban...")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user