Skip to content
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.

Commit

Permalink
fix(db): safer migration/setup command
Browse files Browse the repository at this point in the history
Resolves #58 (updated)
  • Loading branch information
ajgon committed Jun 18, 2017
1 parent cd44009 commit 19bf034
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@

default['defaults']['framework']['migrate'] = true
default['defaults']['framework']['migration_command'] =
'if /usr/local/bin/bundle exec rake db:version > /dev/null 2>&1; ' \
'then /usr/local/bin/bundle exec rake db:migrate; ' \
'else /usr/local/bin/bundle exec rake db:setup; ' \
'fi'
'case $(/usr/local/bin/bundle exec rake db:version 2>&1) in ' \
'*"ActiveRecord::NoDatabaseError"*) /usr/local/bin/bundle exec rake db:setup;; ' \
'*) /usr/local/bin/bundle exec rake db:migrate;; ' \
'esac'
default['defaults']['framework']['assets_precompile'] = true
default['defaults']['framework']['assets_precompilation_command'] = '/usr/local/bin/bundle exec rake assets:precompile'
default['defaults']['framework']['envs_in_console'] = false
Expand Down

0 comments on commit 19bf034

Please sign in to comment.