Opened 10 years ago

Closed 10 years ago

#23308 closed Bug (duplicate)

Running a migration fails when adding a foreign key to another app

Reported by: amarsahinovic Owned by: nobody
Component: Migrations Version: 1.7-rc-2
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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

Change History (3)

comment:1 by Collin Anderson, 10 years ago

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

comment:2 by amarsahinovic, 10 years ago

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

comment:3 by Tim Graham, 10 years ago

Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top