From 85a509920850560a70955d1aebcafc114aa68f80 Mon Sep 17 00:00:00 2001 From: Daniel Wiesmann Date: Mon, 22 May 2017 14:52:15 +0100 Subject: [PATCH] Added emtpy backwards migration to custom data migration. --- raster/migrations/0036_auto_20170509_0548.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/raster/migrations/0036_auto_20170509_0548.py b/raster/migrations/0036_auto_20170509_0548.py index 6306c96b..20166443 100644 --- a/raster/migrations/0036_auto_20170509_0548.py +++ b/raster/migrations/0036_auto_20170509_0548.py @@ -24,6 +24,13 @@ def set_legend_on_entry(apps, schema_editor): entry.save() +def run_backwards(apps, schema_editor): + # The backward migration does not have to do anythign, the data + # is copied to the new fields but not removed. The data gets removed + # in the subsequent migration where the entry through table is dropped. + pass + + class Migration(migrations.Migration): dependencies = [ @@ -31,5 +38,5 @@ class Migration(migrations.Migration): ] operations = [ - migrations.RunPython(set_legend_on_entry), + migrations.RunPython(set_legend_on_entry, run_backwards), ]