summaryrefslogtreecommitdiff
path: root/lib/tasks/database.rake
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tasks/database.rake')
-rw-r--r--lib/tasks/database.rake2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/tasks/database.rake b/lib/tasks/database.rake
index 16038fb3..61c3914c 100644
--- a/lib/tasks/database.rake
+++ b/lib/tasks/database.rake
@@ -7,10 +7,12 @@ namespace :db do
sh "psql #{destination_db} < #{dumpfile}"
#sh "pg_restore --verbose --clean --no-acl --no-owner -h localhost -U #{config[Rails.env]["username"]} -d #{destination_db} #{dumpfile}"
end
+
task :backup do
sh "cap production postgresql:backup"
sh "rm -f latest && ln -s db/backups/`ls -rt db/backups/ | tail -n1` latest"
end
+
task :restore_to_staging => :backup do
sh "cap staging postgresql:restore"
end