Class: Bard::Rake::Postgresql
- Inherits:
-
Object
- Object
- Bard::Rake::Postgresql
- Extended by:
- Rake::DSL
- Defined in:
- lib/bard/rake/db_dump_load.rb
Class Method Summary collapse
Class Method Details
.dump ⇒ Object
51 52 53 54 55 |
# File 'lib/bard/rake/db_dump_load.rb', line 51 def dump pg_dump = `which pg_dump`.strip raise RuntimeError, "Cannot find pg_dump." if pg_dump.blank? sh "#{pg_dump} -f#{FILE_PATH} #{database}" end |
.load ⇒ Object
57 58 59 60 61 |
# File 'lib/bard/rake/db_dump_load.rb', line 57 def load psql = `which psql`.strip raise RuntimeError, "Cannot find psql." if psql.blank? sh "#{psql} -q -d#{database} -f#{FILE_PATH}" end |