Skip to content

Commit

Permalink
Migration helper script
Browse files Browse the repository at this point in the history
  • Loading branch information
loleg committed Jan 24, 2017
1 parent e78ecdf commit 308865b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions force-migrate.sh
@@ -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

0 comments on commit 308865b

Please sign in to comment.