瀏覽代碼

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

tags/v1.0.0
Benjamin Neff 4 年之前
父節點
當前提交
be7281b97c
No account linked to committer's email address
共有 1 個文件被更改,包括 4 次插入3 次删除
  1. +4
    -3
      diaspora/install.sls

+ 4
- 3
diaspora/install.sls 查看文件

@@ -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…
取消
儲存