From 8e5c89b965c479e891161d915050ef22c15ebcfe Mon Sep 17 00:00:00 2001 From: Kamil Malinowski Date: Mon, 6 Nov 2023 21:25:26 +0100 Subject: [PATCH] OM-64 fixed municipality type (#13) --- msystems/migrations/0005_fix_ward.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 msystems/migrations/0005_fix_ward.py diff --git a/msystems/migrations/0005_fix_ward.py b/msystems/migrations/0005_fix_ward.py new file mode 100644 index 0000000..9d7410d --- /dev/null +++ b/msystems/migrations/0005_fix_ward.py @@ -0,0 +1,18 @@ +from django.db import migrations + +on_reverse_migration = migrations.RunPython.noop + + +def on_migration(apps, schema_editor): + location_model = apps.get_model('location', 'Location') + location_model.objects.filter(code='MM01').update(type='W') + + +class Migration(migrations.Migration): + dependencies = [ + ('msystems', '0004_add_modal_right'), + ] + + operations = [ + migrations.RunPython(on_migration, on_reverse_migration), + ]