我有一个新的数据库,我试图重新创建,但运行rake db:schema:load根本不会填充schema_migrations表。这样做的结果是每个迁移现在都在等待。 schema.rb中的模式版本与最新的迁移相匹配,并且this answer表明我认为发生了什么(Rails在当前迁移nubmer之前用所有迁移编号填充迁移表)在此特定情况下不会发生。我的同事已经证实他们的数据库也出现这种情况,所以这绝对是一个项目范围的问题。我们使用SQLServer和自定义模式,尽管db用户正在正确创建所有表。我完全被难住了。有任何想法吗?模式:rake db:schema:load not populating schema_migrations表
回答
每D.帕特里克,回答我的问题:
所以最终的结果是,另一家开发商已经安装activerecord-nulldb-adapter
,这猴子补丁ActiveRecord::Schema.define
和不运行initialize_schema_migrations_table()
或assume_migrated_up_version()
。我卸载了宝石,跑了我的db:schema:load
就好了。
尝试与跟踪标志
耙分贝运行指令负荷--trace
通过的结束日志中,您应该看到线
-- initialize_schema_migrations_table()
-> 0.0045s
另外,值得检查一下,你是否正确地测试了从schema和schema_migrations表生成的表。
奇怪,它不。在开发环境中,这些行是最后生成的: ' - initialize_schema_migrations_table() - > 0.0034s - assume_migrated_upto_version(20131111151423,[“/ Users/---/code/---/db/migrate”] )' - > 2.1161s 测试环境不执行这两条语句。我不确定什么会压制他们。 –
所以最终的结果是,另一个开发人员安装了activerecord-nulldb-adapter,其中monkey修补了ActiveRecord :: Schema.define,并且不运行initialize_schema_migrations_table()或assume_migrated_up_version()。 –
- 1. rake db:schema:load找不到表格
- 2. JavaFX Table not populating
- 3. List is not populating
- 4. Tableview not populating xcode
- 5. NodeList not populating
- 6. Swift:Watchkit Table not populating
- 7. jquerymobile selectmenu not populating
- 8. PreparedStatement not populating
- 9. BaseAdapter not populating listview
- 10. TableColumn not populating Integer values
- 11. Custom CursorAdapter not populating ListView
- 12. highcharts series data [] not populating/displayed
- 13. 在Rake中抑制输出任务db:schema:load
- 14. Can not heroku运行rake db:migrate
- 15. rake db:schema:load导致表再次使用table_prefix作为前缀
- 16. 重新创建schema_migrations表
- 17. rake test - self.table_name not recognized
- 18. 无法运行rake db:schema:load除非数据库已经被加载
- 19. rake db:migrate bundle:command not found
- 20. Rails - Rake error:Library not loaded
- 21. rails:rake populating data
- 22. rake db rake tasks not working Ruby 2.4.0&Rails 5.0.1
- 23. Mongoose'populate'not populating
- 24. Heroku run rake db:migrate not working
- 25. gen update rake -bash:gen:command not found
- 26. edmx populating mdf?
- 27. 我可以选择性地运行db:schema:load?
- 28. “schema_migrations”数据映射程序迁移表
- 29. Rails 3升级后rake db:test:prepare not working?
- 30. Lazily populating Android ViewFlipper children
约翰,你对未被接受的答案的评论对我很有帮助。我认为回答自己的问题并接受答案会很好。 –