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.62 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.61 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.60 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.58 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.57 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.56 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.55 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.54 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.53 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.52 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.51 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.50 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.48 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.47 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.46 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.45 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.44 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.43 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.42 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.41 config/initializers/postgresql_database_tasks.rb