应用的迁移条目未出现在 schema_migrations 表中
我在 heroku 上有一个在生产环境中运行的应用程序,但 schema_migrations 表存在问题。
最后的迁移更改存在于 db/schema.rb
文件中,但 schema_migrations
表中没有此迁移的条目。
因此,当运行 rake db:version 时,我得到了与上次迁移之前执行的迁移相对应的编号。
我相信我应该在 schema_migrations
表上添加此迁移的条目,但我不确定如何在不影响我的数据库和远程 Heroku 上的日期的情况下执行此操作。
I got an app running in production on heroku, but there is a problem with the schema_migrations table.
The last migration changes are present at the db/schema.rb
file, but there is no entry for this migration in the schema_migrations
table.
So when running rake db:version
I got the number corresponding to the migration executed before this last migration.
I believe i should add an entry for this migration on schema_migrations
table, but i am not sure of how to do this without affecting the date on my database, and remotely on heroku.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我遇到了类似的问题,我的 schema_migrations 表中没有迁移。所以我必须运行这个:
source
I had a similar problem, where I had no migrations in my schema_migrations table. So I had to run this:
source