Created
April 30, 2018 22:02
-
-
Save clint74/46730156fe0af5f1fbf21a964ea70755 to your computer and use it in GitHub Desktop.
This file contains 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 if you are in projectroot/scripts | |
find .. -path "*/migrations/*.py" -not -name "__init__.py" -delete | |
find .. -path "*/migrations/*.pyc" -delete | |
#delete records from migrations table | |
psql -d mydatabase -c 'delete from django_migrations;' | |
#create migrations again | |
python manage_local.py makemigrations | |
#Using Django 1.11 > update_contenttypes no longer exists | |
python manage_local.py migrate --fake contenttypes | |
#simulates table creation | |
python manage_local.py migrate --fake-initial |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment