Created
October 25, 2016 13:14
-
-
Save marcusshepp/77205c2664b3fe0aa9db9e0c37ffa3ed to your computer and use it in GitHub Desktop.
How to reset an app with an existing migration in production on postgres. Had a problem where I deployed a project with a new app with an initial migration. Then changed the migration in dev. Then redeployed with a different initial migration.
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
psql -h 999.999.99.99 -U web_forms web_forms | |
web_forms=> SELECT * from django_migrations; | |
web_forms=> DELETE FROM django_migrations WHERE id=28; | |
web_forms=> DROP TABLE room_change_request_type; | |
# drop all tables from that app | |
web_forms=> \q | |
./manage.py migrate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment