forked from dribdat/dribdat
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
15 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
if [ "$1" = "heroku" ]; then | ||
echo "Migrating Heroku DB in 5 seconds - Ctrl-C to abort." | ||
sleep 5s | ||
heroku pg:psql -c "drop table alembic_version" | ||
heroku run "python manage.py db init && python manage.py db migrate && python manage.py db upgrade" | ||
else | ||
echo "Resetting local DB in 5 seconds - Ctrl-C to abort." | ||
echo "(Use 'heroku' argument to migrate Heroku instance)" | ||
sleep 5s | ||
rm -rf dev.db migrations | ||
python manage.py db init | ||
python manage.py db migrate | ||
python manage.py db upgrade | ||
fi |