Resolving circular dependencies when squashing migrations

260 views
Skip to first unread message

Nikolas Stevenson-Molnar

unread,
Dec 2, 2015, 5:23:11 PM12/2/15
to 'Tom Evans' via Django users
I'm attempting to squash migrations on my Django 1.8 project and am running into a mess of circular dependencies. The docs suggest in this case to "break out one of the ForeignKeys in the circular dependency loop into a separate migration, and move the dependency on the other app with it." [1] 

I was able to successfully do this, but that presents another problem: now I have an additional migration which Django attempts to run but fails because it's trying to run commands that have already been run and runs into duplicate column errors.

I realize I could --fake the necessary migrations, but that means manual intervention in every environment this is deployed to. Is there some other way I can do this? Or is the only solution to add the extra migration then --fake it everywhere?

_Nik
Reply all
Reply to author
Forward
0 new messages