Sha256: 831bd76470b1e2dd8365263bb73e5836523c3d18b1d4e29dbaa1e4e4d819f90f

Contents?: true

Size: 796 Bytes

Versions: 16

Compression:

Stored size: 796 Bytes

Contents

namespace :db do
  require "rumination"
  include Rumination::Pg::Commands

  task :create_dump, [:dumpfile_path] => :pg_environment do |t, args|
    create_dump args.dumpfile_path, "-O"
  end

  task :load_dump, [:dumpfile_path] => :pg_environment do |t, args|
    load_dump args.dumpfile_path
  end

  task :pg_environment => :environment do
    db_config = Rails.configuration.database_configuration[Rails.env]
    ENV["PGHOST"]     = db_config["host"].to_s     if db_config["host"]
    ENV["PGPORT"]     = db_config["port"].to_s     if db_config["port"]
    ENV["PGPASSWORD"] = db_config["password"].to_s if db_config["password"]
    ENV["PGUSER"]     = db_config["username"].to_s if db_config["username"]
    ENV["PGDATABASE"] = db_config["database"].to_s if db_config["database"]
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
rumination-0.17.6 lib/rumination/tasks/db/dump.rake
rumination-0.17.5 lib/rumination/tasks/db/dump.rake
rumination-0.17.4 lib/rumination/tasks/db/dump.rake
rumination-0.17.3 lib/rumination/tasks/db/dump.rake
rumination-0.17.2 lib/rumination/tasks/db/dump.rake
rumination-0.17.1 lib/rumination/tasks/db/dump.rake
rumination-0.17 lib/rumination/tasks/db/dump.rake
rumination-0.16.6 lib/rumination/tasks/db/dump.rake
rumination-0.16.5 lib/rumination/tasks/db/dump.rake
rumination-0.16.4 lib/rumination/tasks/db/dump.rake
rumination-0.16.3 lib/rumination/tasks/db/dump.rake
rumination-0.16.2 lib/rumination/tasks/db/dump.rake
rumination-0.16.1 lib/rumination/tasks/db/dump.rake
rumination-0.16 lib/rumination/tasks/db/dump.rake
rumination-0.15.1 lib/rumination/tasks/db/dump.rake
rumination-0.15 lib/rumination/tasks/db/dump.rake