我如何迁移我的heroku数据库? [英] How do I migrate my heroku database?

查看:86
本文介绍了我如何迁移我的heroku数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试过:

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆