Patch on start script for validating the existentce of the database

This commit is contained in:
jfederico 2019-12-03 14:11:30 -05:00
parent 81107e8492
commit c708f19f10
1 changed files with 2 additions and 2 deletions

View File

@ -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