From f65ffefb3b2f9cbc545249bf38001e9894b09113 Mon Sep 17 00:00:00 2001 From: "Pavel \"LEdoian\" Turinsky" Date: Tue, 1 Jun 2021 23:30:41 +0200 Subject: [PATCH] =?UTF-8?q?J=C3=A1dro=20ov=C4=9B=C5=99en=C3=AD=20probl?= =?UTF-8?q?=C3=A9m=C5=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db_compare.py | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) 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()