class ActiveRecord::Tasks::PostgreSQLDatabaseTasks

Public Instance Methods

drop() click to toggle source
# File lib/postgresql_drop_replacement.rb, line 4
def drop
  establish_master_connection
  connection.select_all "select pg_terminate_backend(pg_stat_activity.pid) from pg_stat_activity where datname='#{configuration['database']}' AND state='idle';"
  connection.drop_database configuration['database']
end