[Django] #23392: Django runs all migration operations but only marks 0001 as completed

25 views
Skip to first unread message

Django

unread,
Sep 1, 2014, 5:10:52 AM9/1/14
to django-...@googlegroups.com
#23392: Django runs all migration operations but only marks 0001 as completed
-------------------------------+----------------------
Reporter: owais | Owner: nobody
Type: Uncategorized | Status: new
Component: Migrations | Version: 1.7-rc-3
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+----------------------
I've patched the contrib auth app to add some fields to auth.Group table.
I've created a custom migration module for auth app which has 2
migrations,

0001: The migration supplied by contrib.auth as is.
0002: Migration that adds my custom fields to auth.Group table. ( looks
like this: https://gist.github.com/owais/cabc53a79e7b092457cc)


The problem is that when I run the migrations for auth, django creates the
final schema structure after running 0001 and as a result when django runs
0002, it complains about some fields already being present.


I'm patching the Group model like this:
https://gist.github.com/owais/994e3d2826f225142304

This patch runs right before manage.py calls a command.

--
Ticket URL: <https://code.djangoproject.com/ticket/23392>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Sep 1, 2014, 5:21:26 AM9/1/14
to django-...@googlegroups.com
#23392: Django runs all migration operations but only marks 0001 as completed
----------------------------+--------------------------------------
Reporter: owais | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 1.7-rc-3
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
----------------------------+--------------------------------------
Changes (by owais):

* needs_docs: => 0
* type: Uncategorized => Bug
* needs_tests: => 0
* needs_better_patch: => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/23392#comment:1>

Django

unread,
Sep 1, 2014, 2:45:42 PM9/1/14
to django-...@googlegroups.com
#23392: Django runs all migration operations but only marks 0001 as completed
----------------------------+--------------------------------------
Reporter: owais | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 1.7-rc-3
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
----------------------------+--------------------------------------

Comment (by collinanderson):

I don't think we support adding custom fields to the auth.Group model, but
could it be that the signal is being run on the 0001 migration state,
which makes django think that nothing's changed in 0002?

--
Ticket URL: <https://code.djangoproject.com/ticket/23392#comment:2>

Django

unread,
Sep 5, 2014, 5:47:54 PM9/5/14
to django-...@googlegroups.com
#23392: Django runs all migration operations but only marks 0001 as completed
----------------------------+--------------------------------------
Reporter: owais | Owner: nobody
Type: Bug | Status: closed
Component: Migrations | Version: 1.7-rc-3
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage: Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
----------------------------+--------------------------------------
Changes (by andrewgodwin):

* status: new => closed
* resolution: => invalid


Comment:

We don't support monkeypatching models like this, so I'm going to have to
close as INVALID. If you can reproduce it on a separate, fresh app we can
reopen, but I suspect it's the very overloading of the model itself that's
causing this.

--
Ticket URL: <https://code.djangoproject.com/ticket/23392#comment:3>

Reply all
Reply to author
Forward
0 new messages