So about a year ago I started a project and like all new developers I didn\'t really focus too much on the structure, however now I am further along with Django it has start
I encountered the same problem. Ozan's answer helped me a lot but unfortunately was not enough. Indeed I had several ForeignKey linking to the model I wanted to move. After some headache I found the solution so decided to post it to solve people time.
You need 2 more steps:
ForeignKey
linking to TheModel
into Integerfield
. Then run python manage.py makemigrations
ForeignKey(TheModel)
instead of IntegerField()
. Then make the migrations again (python manage.py makemigrations
). You can then migrate and it should work (python manage.py migrate
)Hope it helps. Of course test it in local before trying in production to avoid bad suprises :)