[Python-modules-team] Bug#863267: Bug#863267: Miscalculates MigrationHistory dependencies between multiple django apps - regression from 1.8

Neil Williams codehelp at debian.org
Fri May 26 08:28:49 UTC 2017


On Fri, 26 May 2017 18:20:07 +1000
Brian May <bam at debian.org> wrote:

> Neil Williams <codehelp at debian.org> writes:
> 
> >   Applying linaro_django_xmlrpc.0001_initial... FAKED  
> 
> I am speculating this line might be very relevant. Taken from the
> Django 1.8 migration.
> 
> Looks like this never had a migration before, so now needs to be
> faked. I wonder if this is what is triggering the Django 1.10 bug.
> 
> To the best of my knowledge this should still be supported.
> 
> If I am right, then it should be possible to work around this by
> manually applying the migration in fake mode.

My first thought as well, but once the bug has triggered, django 1.10
refuses to even fake migrations, either linaro_django_xmlrpc or
lava_scheduler_app or any of the other apps in lava-server.

1.8 proceeds happily and as long as the user doesn't tinker too much
with trying to force migrations, downgrading to 1.8 does fix the
problem. Get the attempted fix wrong and the migrations fail to the
point where the database has to be restored from backup. (So if you're
testing this locally, snapshot the VM when you get to the point of
django 1.10 installed with lava-server 2016.12-1 partially installed):

iF  lava-server                   2016.12-1           all
ii  python-django                 1:1.10.7-1          all

I've been thinking it's related to these fixes in 1.10:
https://code.djangoproject.com/ticket/22325
https://code.djangoproject.com/ticket/27004

(as described in python-django-1.10.7/docs/releases/1.10.1.txt)

This is what happens with initial attempts to use --fake

neil at jessie:~$ sudo lava-server manage migrate linaro_django_xmlrpc --fake-initial 
...

django.db.migrations.exceptions.InconsistentMigrationHistory: Migration
lava_scheduler_app.0001_initial is applied before its dependency
linaro_django_xmlrpc.0001_initial on database 'default'.


neil at jessie:~$ sudo lava-server manage migrate linaro_django_xmlrpc --fake-initial
.....
django.db.migrations.exceptions.InconsistentMigrationHistory: Migration
lava_scheduler_app.0001_initial is applied before its dependency
linaro_django_xmlrpc.0001_initial on database 'default'.


neil at jessie:~$ sudo lava-server manage migrate linaro_django_xmlrpc
....
django.db.migrations.exceptions.InconsistentMigrationHistory: Migration
lava_scheduler_app.0001_initial is applied before its dependency
linaro_django_xmlrpc.0001_initial on database 'default'.

neil at jessie:~$ sudo lava-server manage migrate lava_scheduler_app --fake-initial
.....
django.db.migrations.exceptions.InconsistentMigrationHistory: Migration
lava_scheduler_app.0001_initial is applied before its dependency
linaro_django_xmlrpc.0001_initial on database 'default'.

neil at jessie:~$ sudo lava-server manage migrate lava_scheduler_app --fake
....
django.db.migrations.exceptions.InconsistentMigrationHistory: Migration
lava_scheduler_app.0001_initial is applied before its dependency
linaro_django_xmlrpc.0001_initial on database 'default'.



-- 


Neil Williams
=============
http://www.linux.codehelp.co.uk/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/python-modules-team/attachments/20170526/9debf7e7/attachment.sig>


More information about the Python-modules-team mailing list