Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running rake db:drop db:create db:migrate on Heroku Cedar stack

When I try to run:

heroku run rake db:drop db:create db:migrate 

I get the error:

Running rake db:drop attached to terminal... up, run.5 Couldn't drop adsfsadfas : #<ActiveRecord::StatementInvalid: PGError: ERROR:  must be owner of database adsfsadfas : DROP DATABASE IF EXISTS "adsfsadfas"> 

I am on the Heroku Cedar stack. Am I allowed to drop databases on Heroku?

Thanks!

John

like image 468
John Avatar asked Nov 17 '11 05:11

John


People also ask

What does Rails db drop do?

db:drop - Drops the database for the current RAILS_ENV environment. If RAILS_ENV is not specified it defaults to the development and test databases. db:drop:all - Drops the database for all environments. db:migrate - Runs migrations for the current environment that have not run yet.


1 Answers

The rake db:reset task is not supported. Heroku apps do not have permission to drop and create databases. Use the heroku pg:reset command instead.

like image 64
Francisco Soto Avatar answered Oct 08 '22 15:10

Francisco Soto