Method: ActiveRecord::ConnectionAdapters::PostgreSQLAdapter#drop_database
- Defined in:
- lib/active_record/connection_adapters/postgresql_adapter.rb
#drop_database(name) ⇒ Object
Drops a PostgreSQL database
Example:
drop_database 'matt_development'
640 641 642 643 644 645 646 647 648 649 650 |
# File 'lib/active_record/connection_adapters/postgresql_adapter.rb', line 640 def drop_database(name) #:nodoc: if postgresql_version >= 80200 execute "DROP DATABASE IF EXISTS #{quote_table_name(name)}" else begin execute "DROP DATABASE #{quote_table_name(name)}" rescue ActiveRecord::StatementInvalid @logger.warn "#{name} database doesn't exist." if @logger end end end |