heroku db:reset not heroku rake db:reset
notice the lack of "rake" On Aug 27, 10:17 pm, Keenan Brock <[email protected]> wrote: > $ heroku rake db:reset > XXXX already exists > rake aborted! > no such file to load -- /home/slugs/43604_014bb44_7d48/mnt/tmp/schema.rb > > (See full trace by running task with --trace) > (in /disk1/home/slugs/43604_014bb44_7d48/mnt) > Couldn't drop XXXX : #<ActiveRecord::StatementInvalid: PGError: > ERROR: must be owner of database XXXX > : DROP DATABASE IF EXISTS "XXXX"> > > Instead I wrote: > > namespace :db do > desc 'drops all tables and resets migrations to nothing' > task :reset => :environment do > ActiveRecord::Base.connection.tables.each {|t| > ActiveRecord::Base.connection.drop_table(t) unless > t=='schema_migrations' } > if ActiveRecord::Base.connection.respond_to? :truncate > ActiveRecord::Base.connection.truncate('schema_migrations') > else > ActiveRecord::Base.connection.delete('delete from > schema_migrations') > end > end > > desc 'recreate the database and populate it' > task :reload => %w(db:reset db:migrate) # annotate_models > > desc 'annotates the models and dumps the schema' > task :doc => %w(db:migrate annotate_models db:schema:dump) > end > > On Aug 27, 2009, at 12:44 PM, Ryan Tomayko wrote: > > > > > On Thu, Aug 27, 2009 at 7:54 AM, Keenan Brock<[email protected]> > > wrote: > >> Hi All, > >> How do I wipe out a database and start from scratch on heroku? > >> Locally I run: > >> rake db:migrate:reset > >> (essentially db:drop db:create db:migrate) > >> Unfortunately, rake db:migrate VERSION=0 doesn't quite do what I want > > >> a) Is there a better command? > >> -or- > >> b) Is it possible for someone at Heroku to implement a db:drop that > >> clears > >> the database? > >> Thanks for any insight, > >> Keenan > > > Running "heroku db:reset" will reset the app's database to a blank > > slate. You'll need to run migrations or use "heroku db:push" to > > reinitialize afterward. > > > Thanks, > > Ryan --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
