我如何迁移我的heroku数据库? [英] How do I migrate my heroku database?
问题描述
我试过:
heroku rake db:migrate
和
heroku pg:push
第一个给我一个PGerror / rake中止错误。
有没有办法用heroku完全重建/重置我的数据库?我似乎无法在他们的文档中找到它。
编辑:在此之前,我有一个工作数据库,但我的表和关系已更改。 b $ b
如果您有一个工作数据库,则可以从模式中重新创建表:
heroku run rake db:schema:load
如果你想只需将数据库重置为空即可:
heroku run rake db:create
它给你的错误是什么?尝试解决这个问题可能会更有帮助,而不是抹去所有东西。
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.
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.
这篇关于我如何迁移我的heroku数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!