我正在观看 Rails 教程视频,但我无法弄清楚 db:test:prepare
命令的实际作用。有人可以提供解释吗?
最佳答案
The rake db:migrate above runs any pending migrations on the development environment and updates db/schema.rb. The rake db:test:load recreates the test database from the current db/schema.rb. On subsequent attempts, it is a good idea to first run db:test:prepare, as it first checks for pending migrations and warns you appropriately.
-- http://guides.rubyonrails.org/testing.html
基本上它处理克隆数据库,因此您不必针对测试运行迁移来更新测试数据库。
关于ruby-on-rails - 什么是 rake db :test:prepare actually do?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15169894/