Skip to content
This repository was archived by the owner on Jan 15, 2022. It is now read-only.

Commit 24a7e69

Browse files
committed
Upgrade script tweaked
1 parent 7856865 commit 24a7e69

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

force-migrate.sh

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
#!/bin/bash
22
if [ "$1" = "heroku" ]; then
3-
echo "Migrating Heroku DB in 5 seconds - Ctrl-C to abort."
3+
if [ -z "$2" ]; then
4+
echo "Specify the app you wish to upgrade as a second parameter."
5+
exit
6+
fi
7+
echo "Migrating Heroku DB on $2 in 5 seconds - Ctrl-C to abort."
48
sleep 5s
5-
heroku pg:psql -c "drop table alembic_version"
6-
heroku run "python manage.py db init && python manage.py db migrate && python manage.py db upgrade"
9+
heroku pg:psql -a $2 -c "drop table alembic_version"
10+
heroku run -a $2 "python manage.py db init && python manage.py db migrate && python manage.py db upgrade"
711
else
812
echo "Resetting local DB in 5 seconds - Ctrl-C to abort."
913
echo "(Use 'heroku' argument to migrate Heroku instance)"

0 commit comments

Comments
 (0)