old_query='SELECT * FROM seminar_reseni ORDER BY id'
new_query='''SELECT seminar_reseni.id, forma, poznamka, cas_doruceni, hodnoceni.problem_id AS h_problem_id, hodnoceni.body AS h_body, hodnoceni.cislo_body_id AS h_cislo_body_id
# Migrace 0058 zamerne meni (zmensuje) pocet reseni, aby kazdy clanek mel
# jen jedno reseni (s vice resiteli, coz postaru neslo)
# Kvuli tomu je potreba kontrolovat dve veci:
# 1) Ze kazdy resitel dostal za kazdy problem spravne bodu
# 2) Ze detaily reseni zustaly zachovany
# Cast 1)
old_query='SELECT * FROM seminar_reseni ORDER BY problem_id, resitel_id, body, timestamp'
new_query='''SELECT seminar_reseni.id, forma, seminar_reseni.poznamka, cas_doruceni, hodnoceni.problem_id AS problem_id, hodnoceni.body AS body, hodnoceni.cislo_body_id AS cislo_body_id, res.id AS resitel_id
# Řešitelé jsou nově m2m, takže je musíme dohledat
old_query='SELECT id, resitel_id FROM seminar_reseni ORDER BY id'
new_query='SELECT reseni_id, resitele_id FROM seminar_reseni_resitele ORDER BY reseni_id'
# Cast 2)
# Query se lisi tim, ze uz nejoinujeme resitele.
old_query='SELECT * FROM seminar_reseni ORDER BY id'
new_query='''SELECT seminar_reseni.id, forma, poznamka, cas_doruceni AS timestamp, h.problem_id AS problem_id, h.body AS body, h.cislo_body_id AS cislo_body_id