Created
April 2, 2019 13:42
-
-
Save clint74/64151b174109f02e96634ae3d88152b5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#remove migrations files | |
find .. -path "*/migrations/*.py" -not -name "__init__.py" -delete | |
find .. -path "*/migrations/*.pyc" -delete | |
#delete records from migrations table | |
psql -d <nome_projeto> -c 'delete from django_migrations;' | |
#create migrations again | |
python manage.py makemigrations | |
#Using Django 1.11 > update_contenttypes no longer exists | |
python manage.py migrate --fake contenttypes | |
#simulates table creation | |
python manage.py migrate --fake-initial |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment