Browse Source

fix(mysql): fix check if db exists for mysql

tags/v1.0.0
Benjamin Neff 4 years ago
parent
commit
be7281b97c
No account linked to committer's email address
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      diaspora/install.sls

+ 4
- 3
diaspora/install.sls View File

@@ -169,8 +169,9 @@ diaspora_create_database:
- cwd: {{ diaspora.install_path }}
- onlyif: >-
bash -c 'cd {{ diaspora.install_path }}; RAILS_ENV={{ environment }}
rvm ruby-{{ diaspora.ruby_version }}@diaspora do bin/rails runner "ActiveRecord::Base.connection"
|& grep "database \"{{ diaspora.database.database }}\" does not exist (ActiveRecord::NoDatabaseError)"'
rvm ruby-{{ diaspora.ruby_version }}@diaspora do bin/rails runner "ActiveRecord::Base.connection"'
|& grep -E "(Unknown database '{{ diaspora.database.database }}'|database \"{{ diaspora.database.database }}\" does not exist)"
| grep "ActiveRecord::NoDatabaseError"
- env:
- RAILS_ENV: {{ environment }}
- require:
@@ -187,7 +188,7 @@ diaspora_migrate_database:
- cwd: {{ diaspora.install_path }}
- onlyif: >-
bash -c 'cd {{ diaspora.install_path }}; RAILS_ENV={{ environment }}
rvm ruby-{{ diaspora.ruby_version }}@diaspora do bin/rake db:migrate:status | grep -oE "^\s+down"'
rvm ruby-{{ diaspora.ruby_version }}@diaspora do bin/rake db:migrate:status' | grep -oE "^\s+down"
- env:
- RAILS_ENV: {{ environment }}
- require:

Loading…
Cancel
Save