This post is part of a series of 31 Rails 4 articles being released each day in December 2012.
In production, an initial boot of your Rails application will load the schema of all your models into a schema cache. For those developers who have a large amount of models in their application, Rails 4 has introduced a schema cache dump to speed up the initial application boot time.
To make a dump of your schema, execute the following rake task:
RAILS_ENV=production bundle exec rake db:schema:cache:dump
This will generate a file
db/schema_cache.dump, that Rails will use to load the internal state of the
To disable the schema cache dump, add the following to your
config.active_record.use_schema_cache_dump = false
If you would like to clear the schema cache, execute:
RAILS_ENV=production bundle exec rake db:schema:cache:clear