提交 043f83fe 编写于 作者: R Rafael França 提交者: GitHub

Merge pull request #30193 from zverok/robust-postgres-duplicate-db

More robust PostgreSQL database duplication check
...@@ -22,7 +22,7 @@ def create(master_established = false) ...@@ -22,7 +22,7 @@ def create(master_established = false)
configuration.merge("encoding" => encoding) configuration.merge("encoding" => encoding)
establish_connection configuration establish_connection configuration
rescue ActiveRecord::StatementInvalid => error rescue ActiveRecord::StatementInvalid => error
if /database .* already exists/.match?(error.message) if error.cause.is_a?(PG::DuplicateDatabase)
raise DatabaseAlreadyExists raise DatabaseAlreadyExists
else else
raise raise
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册