aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/errors.rb
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2019-07-29 11:06:27 -0700
committerGitHub <noreply@github.com>2019-07-29 11:06:27 -0700
commit8b0b591296448dd4dff5b85dbbbaf35f01f31e69 (patch)
tree80792c0c18613857ce980df41f01ff1771959a00 /activerecord/lib/active_record/errors.rb
parente0b19a3622e9d6d328dde174165ac03719f565c4 (diff)
parent69700c9ee760c5880fc80af70a89b42bb791cf98 (diff)
downloadrails-8b0b591296448dd4dff5b85dbbbaf35f01f31e69.tar.gz
rails-8b0b591296448dd4dff5b85dbbbaf35f01f31e69.tar.bz2
rails-8b0b591296448dd4dff5b85dbbbaf35f01f31e69.zip
Merge pull request #36782 from jhawthorn/move_database_exists_to_adapter
Move DatabaseAlreadyExists detection to DB adapter
Diffstat (limited to 'activerecord/lib/active_record/errors.rb')
-rw-r--r--activerecord/lib/active_record/errors.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/errors.rb b/activerecord/lib/active_record/errors.rb
index bf7d99449d..509f21c9a5 100644
--- a/activerecord/lib/active_record/errors.rb
+++ b/activerecord/lib/active_record/errors.rb
@@ -187,6 +187,10 @@ module ActiveRecord
class NoDatabaseError < StatementInvalid
end
+ # Raised when creating a database if it exists.
+ class DatabaseAlreadyExists < StatementInvalid
+ end
+
# Raised when PostgreSQL returns 'cached plan must not change result type' and
# we cannot retry gracefully (e.g. inside a transaction)
class PreparedStatementCacheExpired < StatementInvalid