How to transfer my heroku database?

I tried:

heroku rake db:migrate

and

heroku pg:push

The first gives me a PGerror / rake interrupt error.

Is there a way to completely rebuild / reset my database using heroku? I can not find it in the documentation.

EDIT: before that I had a working database, but my tables and relationships have changed.

+4
source share
4 answers

If you have a working database, you can recreate your tables from the schema:

 heroku run rake db:schema:load 

If you want to simply reset the database to empty:

 heroku run rake db:create 

What mistake gives you? Perhaps it would be more useful to try to solve this problem, rather than erase everything.

+15
source

This needs to be updated as heroku rake deprecated. Now use heroku run rake . See below for each / stderr command-line output to date (March 8, 2013):


Wrong:

  • TELL> heroku rake db:migrate --app myApp

    WARNING: "heroku rake'` is deprecated. Use" heroku run rake "instead.


Right:

  • TELL> heroku run rake db:migrate --app myApp

    Running rake db:migrate connected to the terminal ... up, run.2810

+4
source

Try:

  heroku rake db:migrate VERSION=0 

This will send your database.

+1
source
 heroku run rake db:migrate -a appname 
0
source

All Articles