Sha256: efa80823cc92c2c05b215cf5424c9dc051a6ab782bbc7f67c4b0184246f990a8

Contents?: true

Size: 428 Bytes

Versions: 35

Compression:

Stored size: 428 Bytes

Contents

module ActiveRecord
  module Tasks
    class PostgreSQLDatabaseTasks
      def drop
        establish_master_connection
        connection.select_all <<-SQL.squish
          SELECT pg_terminate_backend(pg_stat_activity.pid)
          FROM pg_stat_activity
          WHERE datname='#{configuration['database']}' AND state='idle';
        SQL
        connection.drop_database configuration["database"]
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
renalware-core-2.0.16 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.15 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.14 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.13 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.12 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.11 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.9 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.8 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.7 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.5 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.4 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.3 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.2 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.1 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.0 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.0.pre.rc13 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.0.pre.rc11 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.0.pre.rc10 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.0.pre.rc9 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.0.pre.rc8 config/initializers/postgresql_database_tasks.rb