Opravná migrace, protože to prostě nefungovalo
Kdyby to byl býval RunSQL, byl to oneliner...
This commit is contained in:
parent
21a549af18
commit
3a56eafa59
2 changed files with 20 additions and 1 deletions
|
@ -21,7 +21,7 @@ def vytvor_pohadkanode(apps, schema_editor):
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('seminar', '0058_problem_to_uloha_tema_clanek'),
|
('seminar', 'fix_0058'),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
19
seminar/migrations/fix_0058.py
Normal file
19
seminar/migrations/fix_0058.py
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
def oprav_ulohy(apps, schema_editor):
|
||||||
|
Problem = apps.get_model('seminar', 'Pohadka')
|
||||||
|
|
||||||
|
for p in Problem.objects.filter(typ="b'uloha'"):
|
||||||
|
p.typ = "uloha"
|
||||||
|
p.save()
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('seminar', '0058_problem_to_uloha_tema_clanek'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RunPython(oprav_ulohy, oprav_ulohy),
|
||||||
|
]
|
||||||
|
|
Loading…
Reference in a new issue