Pred migraci chceme smazat uzivatele bez Organizatoru

prekazeli.
This commit is contained in:
Pavel Turinsky (DebianVM @ Zr) 2021-06-29 22:22:45 +00:00
parent 7be36d0ec6
commit e3a5c4bbeb

View file

@ -23,5 +23,16 @@ def smaz_zle_clanky():
# Nakonec i ty clanky samotne
cursor.execute('DELETE FROM seminar_problemy WHERE id IN (1981, 1970, 2222);')
def smaz_divne_uzivatele():
# U techto uzivatelu neexistuje Organizator s nimi spojeny
# Takze pak delaji akorat neporadek
with connection.cursor() as cursor:
# Jeste je potreba zrusit vazby
cursor.execute('UPDATE django_comments SET user_id = NULL WHERE user_id = 34;')
cursor.execute('UPDATE seminar_problemy SET autor_id = NULL WHERE autor_id = 34;')
cursor.execute('DELETE FROM django_admin_log WHERE user_id = 34;')
cursor.execute('DELETE FROM auth_user_groups WHERE user_id = 34;')
cursor.execute('DELETE FROM auth_user WHERE id IN (34, 40, 30, 50, 54, 58, 43);')
smaz_zle_clanky()
smaz_divne_uzivatele()