Sha256: 116ab57956b6923a1a8986e24bf6bf8a202392ab2755cc1446a8630e143c611c

Contents?: true

Size: 459 Bytes

Versions: 142

Compression:

Stored size: 459 Bytes

Contents

# frozen_string_literal: true

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

142 entries across 142 versions & 1 rubygems

Version Path
renalware-core-2.0.147 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.146 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.145 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.144 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.143 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.142 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.141 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.140 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.139 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.138 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.137 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.136 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.135 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.134 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.133 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.132 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.131 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.130 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.129 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.128 config/initializers/postgresql_database_tasks.rb