PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, April 14, 2022

[FIXED] How do I migrate my heroku database?

 April 14, 2022     database, heroku, migration     No comments   

Issue

I've tried:

heroku rake db:migrate

and

heroku pg:push

The first gives me a PGerror / rake aborted error.

Is there a way to completely rebuild/reset my database with heroku? I can't seem to find it in their documentation.

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


Solution

If you had a working database, you could recreate your tables from the schema:

heroku run rake db:schema:load

If you want to just reset the database to empty:

heroku run rake db:create

What is the error it is giving you? It might be more helpful to try to solve that problem rather than wipe everything.



Answered By - Felix
Answer Checked By - Gilberto Lyons (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing