Commit e76c53718df9425e3856636e3d64b87c14b19d72
1 parent
3c914f5e
Exists in
master
and in
23 other branches
ActionItem985: don't start with pending migrations
This way we'll never forget to run them in the production servers.
Showing
1 changed file
with
6 additions
and
0 deletions
Show diff stats
script/production
| @@ -6,6 +6,12 @@ ACTION=$1 | @@ -6,6 +6,12 @@ ACTION=$1 | ||
| 6 | shift | 6 | shift |
| 7 | 7 | ||
| 8 | do_start() { | 8 | do_start() { |
| 9 | + if ! rake db:abort_if_pending_migrations; then | ||
| 10 | + echo "========================================" | ||
| 11 | + echo "There are pending migrations, please upgrade the database before starting the production server" | ||
| 12 | + exit 1 | ||
| 13 | + fi | ||
| 14 | + | ||
| 9 | ./script/ferret_server -e $RAILS_ENV start | 15 | ./script/ferret_server -e $RAILS_ENV start |
| 10 | sleep 1 | 16 | sleep 1 |
| 11 | mongrel_rails cluster::start | 17 | mongrel_rails cluster::start |