[英]Heroku - Need to change the original 'seeded' user
I have a Rails
application deployed to Heroku
. 我有一个部署到Heroku
的Rails
应用程序。 The db/seed
file has since change, and I would like the admin
user that was originally seeded into Heroku
to reflect the one I now have locally. db/seed
文件已经发生了变化,我希望最初播种到Heroku
的admin
用户能够反映我现在拥有的那个。 Is there a way to either: 有没有办法:
A) Destroy the data, and just run heroku run rake db:seed
again? A)销毁数据,然后再次运行heroku run rake db:seed
? or 要么
B) Seed a new admin
user into the database. B)将新的admin
用户植入数据库。 Similar to creating a new migration file if I needed to edit the table in the database? 如果我需要编辑数据库中的表,那么与创建新的迁移文件类似?
Thanks! 谢谢!
You can definitely reset your database using the rake db:reset
command which will drop, create and seed your data. 您绝对可以使用rake db:reset
命令重置数据库,该命令将删除,创建和播种数据。 You would have to modify your seed file before running this command. 在运行此命令之前,您必须修改种子文件。
However, the better method would be to use heroku run rails console
and simply modify the user information using that interface. 但是,更好的方法是使用heroku run rails console
并使用该接口简单地修改用户信息。 You can read more here . 你可以在这里阅读更多。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.