aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2015-08-28 11:35:12 +0200
committerYves Senn <yves.senn@gmail.com>2015-08-28 11:35:12 +0200
commitdd118dcc45bfb8e26c023d0ae0492b8208aa03e2 (patch)
tree660256d905f0101b7efb0a4b72891a2bc851ef76 /activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
parent9e2b13ca35656b6604fc28cd02f01f332ae19691 (diff)
downloadrails-dd118dcc45bfb8e26c023d0ae0492b8208aa03e2.tar.gz
rails-dd118dcc45bfb8e26c023d0ae0492b8208aa03e2.tar.bz2
rails-dd118dcc45bfb8e26c023d0ae0492b8208aa03e2.zip
PostgreSQL, add `:if_exists` to `#drop_schema`.
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
index d114cad16b..d1a02991f6 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
@@ -214,8 +214,8 @@ module ActiveRecord
end
# Drops the schema for the given schema name.
- def drop_schema schema_name
- execute "DROP SCHEMA #{schema_name} CASCADE"
+ def drop_schema(schema_name, options = {})
+ execute "DROP SCHEMA#{' IF EXISTS' if options[:if_exists]} #{schema_name} CASCADE"
end
# Sets the schema search path to a string of comma-separated schema names.