From 48339a556650b88a756cf80040f762b0a80e1efa Mon Sep 17 00:00:00 2001 From: "Alexis A." Date: Thu, 27 Jun 2024 09:25:43 +0200 Subject: [PATCH] fix(migration): remove failing migration --- .../migrations/0174_auto_20240615_1835.py | 28 +------------------ 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/public_data/migrations/0174_auto_20240615_1835.py b/public_data/migrations/0174_auto_20240615_1835.py index 3a96222d4..09a61b37e 100644 --- a/public_data/migrations/0174_auto_20240615_1835.py +++ b/public_data/migrations/0174_auto_20240615_1835.py @@ -6,32 +6,6 @@ logger = getLogger(__name__) -def fix_commune_mpoly(apps, schema_editor): - Commune = apps.get_model("public_data", "Commune") - Cerema = apps.get_model("public_data", "Cerema") - - to_update = [] - - communes = Commune.objects.all() - communes.count() - - for commune in communes: - cerema = Cerema.objects.get(city_insee=commune.insee) - - if commune.mpoly == cerema.mpoly: - # no need to update - break - commune.mpoly = cerema.mpoly - commune.srid_source = cerema.srid_source - to_update.append(commune) - - Commune.objects.bulk_update( - to_update, - ["mpoly", "srid_source"], - batch_size=1000, - ) - - class Migration(migrations.Migration): atomic = False dependencies = [ @@ -39,5 +13,5 @@ class Migration(migrations.Migration): ] operations = [ - migrations.RunPython(fix_commune_mpoly), + migrations.RunPython(migrations.RunPython.noop, migrations.RunPython.noop), ]