Skip to content

Commit

Permalink
Patch on start script for validating the existentce of the database
Browse files Browse the repository at this point in the history
  • Loading branch information
jfederico committed Dec 3, 2019
1 parent 81107e8 commit c708f19
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/start
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ if [ "$RAILS_ENV" = "production" ] && [ "$DB_ADAPTER" = "postgresql" ]; then
done
fi

db_create=$(RAILS_ENV=$RAILS_ENV bundle exec rake db:create)
db_create="$(RAILS_ENV=$RAILS_ENV bundle exec rake db:create 2>&1)"
echo $db_create

if [[ $db_create == *"Error"* ]]; then
if [[ $db_create == *"already exists"* ]]; then
echo ">>> Database migration"
bundle exec rake db:migrate
else
Expand Down

0 comments on commit c708f19

Please sign in to comment.