Sha256: cf333f3c404dbe49ef0ad0fe21109d28f554a87cbbf4ae180bc101ae63ccf850
Contents?: true
Size: 827 Bytes
Versions: 74
Compression:
Stored size: 827 Bytes
Contents
require_relative "restore" module Rumination module Pg configure do |config| config.create_dump_args = %w[--compress=9] config.load_dump_args = %w[--quiet] config.dumpfile_path = "db/postgres_dumps/seeds.sql.gz" end # include this module into something with #sh, e.g. next to Rake::FileUtils module Commands def pg_restore *args Pg::Restore.call *args, "-d", ENV["PGDATABASE"] end def rsync *args sh "rsync #{args.join(" ")}" end def create_dump path, *args args = Pg.config.create_dump_args + args + %W[--file=#{path}] sh "pg_dump #{args.join(" ")}" end def load_dump path, *args args = Pg.config.load_dump_args + args sh "gunzip -c #{path} | psql #{args.join(" ")}" end end end end
Version data entries
74 entries across 74 versions & 1 rubygems