Module: DB

Defined in:
lib/synchronizer/db.rb

Instance Method Summary collapse

Instance Method Details

#copy_db_cmdObject



9
10
11
12
13
14
15
# File 'lib/synchronizer/db.rb', line 9

def copy_db_cmd
  if dest = fetch(:sync_db_to, nil)
    scp_file(fetch(:db_dump_file), dest)
  else
    raise "missing variable sync_db_to"
  end
end

#copy_db_to_localObject



17
18
19
# File 'lib/synchronizer/db.rb', line 17

def copy_db_to_local
 download! "#{fetch(:db_dump_file)}", "#{fetch(:db_dump_file).split('/')[-1]}"
end

#dump_dbObject



3
4
5
6
7
# File 'lib/synchronizer/db.rb', line 3

def dump_db
  _stage = fetch(:stage, nil).to_s
  cfg = read_db_config(_stage)
  execute pg_dump_cmd(cfg)
end