Skip to content

Commit

Permalink
Use new pg:backups syntax
Browse files Browse the repository at this point in the history
We attempted to do this in 5e789c3, but Heroku Toolbelt had some missing
functionality with respect to the new `pg:backups` syntax, and our code
retained the `--expire` flag, which is now automatic and no longer
allowed.

This change requires that users have version 3.32.0 of the Heroku
Toolbelt installed, but the old `pgbackups:capture / pgbackups:restore`
syntax and addon are being retired in the first week of May 2015, so we
need to do this to move on in any event (users who don't upgrade won't
be able to use the old parity either).

Close #29.
  • Loading branch information
geoffharcourt committed Apr 28, 2015
1 parent 3b9378c commit fb13da9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/parity/backup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def backup_from
end

def db_backup_url
"heroku pgbackups:url --remote #{from}"
"heroku pg:backups public-url --remote #{from}"
end

def development_db
Expand Down
2 changes: 1 addition & 1 deletion lib/parity/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def run_via_cli
end

def backup
Kernel.system "heroku pgbackups:capture --expire --remote #{environment}"
Kernel.system "heroku pg:backups capture --remote #{environment}"
end

def deploy
Expand Down
6 changes: 3 additions & 3 deletions spec/backup_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,20 @@ def database_config_path
end

def curl_piped_to_pg_restore
"curl -s `heroku pgbackups:url --remote production` | #{pg_restore}"
"curl -s `heroku pg:backups public-url --remote production` | #{pg_restore}"
end

def pg_restore
"pg_restore --verbose --clean --no-acl --no-owner -d parity_development"
end

def heroku_pass_through
"heroku pgbackups:restore DATABASE `heroku pgbackups:url "\
"heroku pgbackups:restore DATABASE `heroku pg:backups public-url "\
"--remote production` --remote staging "
end

def additional_argument_pass_through
"heroku pgbackups:restore DATABASE `heroku pgbackups:url "\
"heroku pgbackups:restore DATABASE `heroku pg:backups public-url "\
"--remote production` --remote staging --confirm thisismyapp-staging"
end
end
2 changes: 1 addition & 1 deletion spec/environment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
end

def heroku_backup
"heroku pgbackups:capture --expire --remote production"
"heroku pg:backups capture --remote production"
end

def heroku_console
Expand Down

0 comments on commit fb13da9

Please sign in to comment.