From c708f19f1049e1fd16e5f30f1da220ccd9b1bf97 Mon Sep 17 00:00:00 2001 From: jfederico Date: Tue, 3 Dec 2019 14:11:30 -0500 Subject: [PATCH] Patch on start script for validating the existentce of the database --- bin/start | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/start b/bin/start index dc0b618b..c04c5cab 100755 --- a/bin/start +++ b/bin/start @@ -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