From: Stephen Finucane Date: Mon, 23 Jan 2017 09:07:29 +0000 (+0000) Subject: migrations: Don't use 'noop' X-Git-Tag: v2.0.0-rc1~103 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=177fe832894c10be2a181bf8df88957d6f90ad90;p=thirdparty%2Fpatchwork.git migrations: Don't use 'noop' The 'noop' operation was introduced in Django 1.8, meaning this operation won't work on Django 1.7. Travis caught this, though I don't know how it was missed locally. Signed-off-by: Stephen Finucane Fixes: e3cbe493 ("models: Add 'project' field to Series") --- diff --git a/patchwork/migrations/0016_series_project.py b/patchwork/migrations/0016_series_project.py index ecd8984b..befd6953 100644 --- a/patchwork/migrations/0016_series_project.py +++ b/patchwork/migrations/0016_series_project.py @@ -5,7 +5,7 @@ from django.db import migrations, models import django.db.models.deletion -def copy_series_field(apps, schema_editor): +def forward(apps, schema_editor): """Populate the project field from child cover letter/patches.""" # TODO(stephenfin): Perhaps we'd like to include an SQL variant of the # below though I'd imagine it would be rather tricky @@ -23,6 +23,11 @@ def copy_series_field(apps, schema_editor): # Delete it. series.delete() + +def reverse(apps, schema_editor): + pass + + class Migration(migrations.Migration): dependencies = [ @@ -35,7 +40,7 @@ class Migration(migrations.Migration): name='project', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='series', to='patchwork.Project'), ), - migrations.RunPython(copy_series_field, migrations.RunPython.noop), + migrations.RunPython(forward, reverse), migrations.AlterField( model_name='seriesreference', name='msgid',