User Tools

Site Tools


Sidebar

code:django

This is an old revision of the document!


Django

Reset migrations

Source: https://simpleisbetterthancomplex.com/tutorial/2016/07/26/how-to-reset-migrations.html

1. Remove all migrations

find . -path "*/migrations/*.py" -not -name "__init__.py" -delete
find . -path "*/migrations/*.pyc"  -delete

2. Delete and recreate database

3. Make migrations and migrate

./manage.py makemigrations
./manage.py migrate
code/django.1489164406.txt.gz · Last modified: 2017/03/10 17:46 by hansek