在英雄生产现场清理轨道应用数据库 [英] clearing rails app database on heroku production site

查看:128
本文介绍了在英雄生产现场清理轨道应用数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我是ROR和Heroku的新手,需要一点帮助。我已经创建了一个应用程序并已部署它;但是,我想清除与之相关联的数据库。意思我想清除迄今为止创建的任何用户(及其附带的数据)。



我基本上创建了几个虚假帐户来测试是否数据库在生产现场工作,但现在我想清除这一点,并从一个新的数据库开始。



这是否可能没有完全删除数据库? / p>

任何帮助都会真诚的感谢。非常感谢你的时间!

解决方案

你可以使用 heroku pg:reset DATABASE 命令重置整个数据库。该命令将简单地删除并创建数据库。



您必须使用 heroku rake db:migrate 来创建



或者您可以在本地使用 rake db:reset 命令,然后运行 heroku db:push 来更新生产数据库。


So I'm new to ROR and Heroku and need a little help. I've created an app and have deployed it; however, I'd like to clear out the database associated with it. Meaning I'd like to clear any users (and their attached data) that have been created thus far.

I've basically created several phony accounts to test out whether the database on the production site works, but now i'd like to clear this out, and start with a fresh database.

Is this possible without deleting the database entirely?

Any help would be sincerely appreciated. Thank you very much for your time!

解决方案

You can use heroku pg:reset DATABASE command to reset the entire database. The command will simply drop and create the database.

You have to use heroku rake db:migrate to create the tables then.

Alternatively you can use rake db:reset command locally and then run heroku db:push to update the production db.

这篇关于在英雄生产现场清理轨道应用数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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