[Django] #23308: Running a migration fails when adding a foreign key to another app

15 views
Skip to first unread message

Django

unread,
Aug 17, 2014, 5:20:09 PM8/17/14
to django-...@googlegroups.com
#23308: Running a migration fails when adding a foreign key to another app
-------------------------------+----------------------
Reporter: amarsahinovic | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 1.7-rc-2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+----------------------
I'm unable to create a foreign key to another application after running
initial migrations to create the models and later adding an additional
foreign key to one of them. It makes the migration, but it fails when I
try to execute it.

I've created an example project to demonstrate:
https://github.com/amarsahinovic/django-migrations-bug-example

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

Django

unread,
Aug 17, 2014, 10:07:34 PM8/17/14
to django-...@googlegroups.com
#23308: Running a migration fails when adding a foreign key to another app
-------------------------------+--------------------------------------

Reporter: amarsahinovic | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 1.7-rc-2
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 collinanderson):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Comment:

Could you try re-generating that 0002 migration with the latest 1.7.x
code? When I re-generated it on my computer with the latest code, it added
`('articles', '0001_initial'),` as a dependency which fixed it.

https://github.com/django/django/archive/stable/1.7.x.tar.gz

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

Django

unread,
Aug 18, 2014, 6:36:27 AM8/18/14
to django-...@googlegroups.com
#23308: Running a migration fails when adding a foreign key to another app
-------------------------------+--------------------------------------

Reporter: amarsahinovic | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 1.7-rc-2
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 amarsahinovic):

It worked when I used the latest git code. Thank you!

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

Django

unread,
Aug 18, 2014, 7:14:16 AM8/18/14
to django-...@googlegroups.com
#23308: Running a migration fails when adding a foreign key to another app
-------------------------------+--------------------------------------
Reporter: amarsahinovic | Owner: nobody
Type: Bug | Status: closed
Component: Migrations | Version: 1.7-rc-2
Severity: Normal | Resolution: duplicate
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 timgraham):

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


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

Reply all
Reply to author
Forward
0 new messages