How to rake db:drop and rake db:create on Heroku? [duplicate] How to rake db:drop and rake db:create on Heroku? [duplicate] database database

How to rake db:drop and rake db:create on Heroku? [duplicate]


The pg:reset command will recreate the database for you. Example usage:

$ heroku config | grep POSTGRESQLHEROKU_POSTGRESQL_RED_URL: postgres://somedatabaseurl$ heroku pg:reset HEROKU_POSTGRESQL_RED_URL!    WARNING: Destructive Action!    This command will affect the app: myappname!    To proceed, type "myappname" or re-run this command with --confirm> myappnameResetting HEROKU_POSTGRESQL_RED_URL (DATABASE_URL)... done

The db:reset command would try to drop the database, which is not something that Heroku's permissions allow.