在英雄生产现场清理轨道应用数据库 [英] clearing rails app database on heroku production site
问题描述
我基本上创建了几个虚假帐户来测试是否数据库在生产现场工作,但现在我想清除这一点,并从一个新的数据库开始。
这是否可能没有完全删除数据库? / 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屋!