Patch on start script for validating the existentce of the database
This commit is contained in:
parent
81107e8492
commit
c708f19f10
|
@ -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
|
||||
|
|
Reference in New Issue