On Mar 25, 2010, at 10:55 AM, Sean Schofield wrote:

> I'm loving the heroku db:pull stuff but its a bit dangerous if you
> accidentally run db:push on a production system.  Would it be possible
> to have db:push warn you that the remote database is not empty?  Maybe
> something like the following:
> 
> WARNING: Remote database is not empty.  Are you sure you want to
> replace its contents with the contents of your local database?  If so
> please use heroku db:push with the --force option.

We tend to use rake tasks for pushing/pulling instead of using the heroku gem 
directly.  Something like:

namespace :db do
  task :refresh => ['db:pull','db:convert','db:test:prepare']
  task :pull => [:drop, :create] do
    system 'heroku db:pull'
  end

  # Include in here any rake tasks needed to seed or modify data for
  # current iteration
  task :convert => ['db:migrate']
end

That's for pulling instead of pushing (now that we're live, we never push - 
only migrate/convert).

Once you get in the habit of doing 'rake db:refresh' instead of 'heroku 
db:pull', it becomes natural.

You could build a rake task that wraps db:push and warns you before doing its 
thing.

Mike

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.

Reply via email to