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.1.1 config/initializers/postgresql_database_tasks.rb
renalware-core-2.1.0 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.167 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.166 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.165 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.164 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.163 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.162 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.161 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.160 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.159 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.158 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.157 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.156 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.155 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.153 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.152 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.151 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.149 config/initializers/postgresql_database_tasks.rb
renalware-core-2.0.148 config/initializers/postgresql_database_tasks.rb