diff --git a/db_compare.py b/db_compare.py index 6e594d5f..8ee613e6 100644 --- a/db_compare.py +++ b/db_compare.py @@ -234,6 +234,42 @@ def check_novinky(): raise ValueError("Nesedi autori u novinek") +# Problémy jsou rozdělené podle typů: +def check_uloha(): + raise NotImplementedError() +def check_tema(): + raise NotImplementedError() +def check_konfera(): + old_query = "SELECT * FROM seminar_problemy WHERE typ = 'konfera'" + new_query = "SELECT * FROM seminar_konfera JOIN seminar_problemy as problem ON problem_ptr_id = problem.id" + + oldcur.execute(old_query) + newcur.execute(new_query) + + if oldcur.rowcount != 0 or newcur.rowcount != 0: + raise ValueError('There exists a Konfera!') + +def check_org_clanek(): + old_query = "SELECT * FROM seminar_problemy WHERE typ = 'org-clanek'" + + oldcur.execute(old_query) + + if oldcur.rowcount != 0: + raise ValueError('There exists a Org-clanek!') + +def check_res_clanek(): + raise NotImplementedError() + +def check_untyped_problem(): + old_query = "SELECT * FROM seminar_problemy WHERE typ NOT IN ('uloha', 'tema', 'serial', 'konfera', 'org-clanek', 'res-clanek')" + + oldcur.execute(old_query) + + if oldcur.rowcount != 0: + raise ValueError('There exists a Problem without type!') + + + check_skola() check_resitel() check_reseni() @@ -246,3 +282,10 @@ check_soustredeni_ucastnici() check_soustredeni_organizatori() check_nastaveni() check_novinky() + +check_uloha() +check_tema() +check_konfera() +check_org_clanek() +check_res_clanek() +check_untyped_problem()