diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2017-08-24 14:35:21 +0200 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2017-08-24 20:22:16 +0200 |
commit | 167b9b81440017f5253efda4bb6566d12f0eedc8 (patch) | |
tree | eadc56ab63940fbaa6abbd9d3267b983c0adaf4b /lib/tasks/db.rake | |
parent | c8406ec3bf57acbaee8413772091ffc5ee9a30fb (diff) | |
download | gitlab-ce-schema-cache.tar.gz |
Enable caching of schema.rbschema-cache
This is a lesser known Rails feature that removes the need for querying
various internal tables for schema details (e.g. column types) every
time Rails boots up.
This feature is described in http://iempire.ru/2016/12/13/schema-cache/
and was brought to our attention by @stanhu.
Since the schema cache is specific to the database we only enable this
on PostgreSQL.
Diffstat (limited to 'lib/tasks/db.rake')
-rw-r--r-- | lib/tasks/db.rake | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake new file mode 100644 index 00000000000..664e75494b8 --- /dev/null +++ b/lib/tasks/db.rake @@ -0,0 +1,7 @@ +namespace :db do + namespace :schema do + task 'dump' do + Rake::Task['db:schema:cache:dump'].invoke + end + end +end |