Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save felipe3dfx/ea37e038301e17ab335c742d07eff882 to your computer and use it in GitHub Desktop.
Save felipe3dfx/ea37e038301e17ab335c742d07eff882 to your computer and use it in GitHub Desktop.
Reset django migrations
1. Remove old migrations file
find . -path "*/migrations/*.py" -not -name "__init__.py" -delete
find . -path "*/migrations/*.pyc" -delete
2. Make migrations again
python manage.py makemigrations
3. Truncate django_migrations table
TRUNCATE TABLE django_migrations;
4. Migrate with fake
python manage.py migrate --fake
5. reload services
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment