Cache Appearance instances in Redis
This caches the result of Appearance.first in a similar fashion to how ApplicationSetting instances are cached. We also add some NOT NULL constraints to the table and correct the timestamp types.
Database Checklist
When adding migrations:
-
Updated db/schema.rb
-
Added a down
method so the migration can be reverted -
Added the output of the migration(s) to the MR body -
Added the execution time of the migration(s) to the MR body -
Made sure the migration won't interfere with a running GitLab cluster, for example by disabling transactions for long running migrations
Migration Output
== 20170809142252 CleanupAppearancesSchema: migrating =========================
-- change_column_null(:appearances, :title, false)
-> 0.0005s
-- change_column_null(:appearances, :description, false)
-> 0.0002s
-- change_column_null(:appearances, :description_html, false)
-> 0.0002s
-- change_column_null(:appearances, :created_at, false)
-> 0.0001s
-- change_column_null(:appearances, :updated_at, false)
-> 0.0002s
-- change_column(:appearances, :created_at, :datetime_with_timezone)
-> 0.0298s
-- change_column(:appearances, :updated_at, :datetime_with_timezone)
-> 0.0221s
== 20170809142252 CleanupAppearancesSchema: migrated (0.0534s) ================
General Checklist
-
Changelog entry added, if necessary -
Tests added for this feature/bug -
Conform by the merge request performance guides -
Conform by the style guides -
Squashed related commits together