Skip to content

Database migration for caching has_confluence on project_settings

Luke Duncalfe requested to merge 220934-confluence-wiki-db into master

What does this MR do?

This change adds a new boolean column to project_settings to allow caching the status of the new confluence integration as has_confluence.

This follows the same pattern as two other integrations that have has_{x} cache columns on projects (has_external_wiki and has_external_issue_tracker). As all of these integrations are tested for to help build the side nav links on each project page on GitLab, the caching of the integration is a performance optimisation.

The new has_confluence property is unable to be added to projects, like the other has_{x} columns, as we are not allowed to migrate new columns to projects due to its width.

Migrations

Output

Up

== 20200619000316 AddHasConfluenceToProjectSettings: migrating ================
-- add_column(:project_settings, :has_confluence, :boolean, {:default=>false, :null=>false})
   -> 0.0028s
== 20200619000316 AddHasConfluenceToProjectSettings: migrated (0.0058s) =======

Down

== 20200619000316 AddHasConfluenceToProjectSettings: reverting ================
-- remove_column(:project_settings, :has_confluence)
   -> 0.0026s
== 20200619000316 AddHasConfluenceToProjectSettings: reverted (0.0084s) =======

Rollback

bundle exec rake db:migrate:down VERSION=20200619000316

Does this MR meet the acceptance criteria?

Conformity

Edited by Luke Duncalfe

Merge request reports