Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

django, squash migrations, too many circular dependencies

Tags:

django

migrate

I tried to squash migrations.

Unfortunately there are just too many circular dependencies.

Is there a way to start over the migrations (although my project is already deployed in production) than trying to squash the migrations?

I don't have to worry about some unknown developer using my project because it's a private project.

like image 937
eugene Avatar asked Feb 03 '16 10:02

eugene


1 Answers

Yes, there is a way. See this similar question. In a nusthell:

# 1) Fake migrations back to 0
./manage.py migrate app zero --fake

# 2) Delete migrations files
git rm "app/migrations/*"

# 3) Create new migration file
./manage.py makemigrations app

# 4) Pretend to run the new migration
./manage.py migrate app --fake
like image 185
Régis B. Avatar answered Nov 05 '22 20:11

Régis B.