From df14d03fc27b8574f318674cb65e2faf4879c01c Mon Sep 17 00:00:00 2001 From: "Pavel Turinsky (DebianVM @ Zr)" Date: Wed, 30 Jun 2021 23:48:55 +0000 Subject: [PATCH] Par drobnych zmen --- db_compare.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/db_compare.py b/db_compare.py index 3cdee268..a45406be 100755 --- a/db_compare.py +++ b/db_compare.py @@ -78,7 +78,7 @@ def check_resitel(): 'prijmeni', 'user_id', 'pohlavi_muz', - #'email', #TODO: potřeba dořešit, protože merge řešitele a organizátora + #'email', #vyreseno separatne 'telefon', 'datum_narozeni', 'datum_souhlasu_udaje', @@ -99,6 +99,8 @@ def check_resitel(): fields = fields_keep+fields_osoba for o,n in res: check_same(o,n,fields) + if o['email'] != n['email'] and o['email'] != '': + print(f"WARNING: Emails differ: old: {o['email']}, new: {n['email']}") def check_reseni(): # Migrace 0058 zamerne meni (zmensuje) pocet reseni, aby kazdy clanek mel @@ -183,7 +185,7 @@ def check_organizator(): # Migrace prirazuje aktualni casovou zonu, takze chceme tady rucne vynutit CET. from datetime import timedelta, timezone cet = timezone(timedelta(hours=1)) - if o['organizuje_do_roku'] is None and n['organizuje_do'] is None: + if o['organizuje_od_roku'] is None and n['organizuje_od'] is None: pass elif o['organizuje_od_roku'] != n['organizuje_od'].astimezone(cet).year: raise ValueError(f'Not matching organizuje_od for org id={o["id"]}: old {o["organizuje_od_roku"]}, new {n["organizuje_od"]}') @@ -430,7 +432,7 @@ def check_tema(): def check_konfera(): old_query = "SELECT * FROM seminar_problemy WHERE typ = 'konfera'" - new_query = "SELECT * FROM seminar_konfera AS k JOIN seminar_problemy AS problem ON k.problem_ptr_id = problem.id" + new_query = "SELECT * FROM seminar_konfera" oldcur.execute(old_query) newcur.execute(new_query)