浏览代码

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

tags/v1.0.0
Benjamin Neff 4 年前
父节点
当前提交
be7281b97c
没有帐户链接到提交者的电子邮件
共有 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:

正在加载...
取消
保存