diff --git a/.gitignore b/.gitignore index a9ff8afb..20667ff4 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,5 @@ env config/terms.md coverage* + +/atom-sftp-sync.json diff --git a/bin/start b/bin/start index 2bcb8ca1..d4d775c0 100755 --- a/bin/start +++ b/bin/start @@ -8,10 +8,15 @@ if [ "$RAILS_ENV" = "production" ] && [ "$DB_ADAPTER" = "postgresql" ]; then done fi -bundle exec rake db:create +db_create=$(RAILS_ENV=$RAILS_ENV bundle exec rake db:create) +echo $db_create -if ! bundle exec rake db:migrate ; then - export DB_MIGRATE_FAILED=1 +if [[ $db_create == *"ERROR"* ]]; then + echo ">>> Database migration" + bundle exec rake db:migrate +else + echo ">>> Database initialization" + bundle exec rake db:setup fi bundle exec rake assets:precompile