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.84 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.83 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.82 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.81 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.80 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.79 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.78 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.77 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.76 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.75 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.74 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.73 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.72 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.71 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.70 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.69 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.68 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.67 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.64 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.63 config/initializers/postgresql_database_tasks.rb