#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


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 Changed 22 months ago by collinanderson

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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.


comment:2 Changed 22 months ago by amarsahinovic

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

comment:3 Changed 22 months ago by timgraham

  • Resolution set to duplicate
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.
Back to Top