rails f log/development.log查看sql执行时间,来选择加索引的字段

非常的有效,效果扛扛的

  config.action_controller.perform_caching = true#实际中改一下为true

测试时改为false

4.2 Being Specific

If you need to run a specific migration up or down the db:migrate:up and db:migrate:downtasks will do that. Just specify the appropriate version and the corresponding migration will have itsup or down method invoked, for example

rake db:migrate:up VERSION=20080906120000

will run the up method from the 20080906120000 migration. These tasks check whether the migration has already run, so for example db:migrate:up VERSION=20080906120000 will do nothing if Active Record believes that 20080906120000 has already been run.

原文地址:https://www.cnblogs.com/lexus/p/1948827.html