Improve tooling and documentation to safely drop database columns

This is a follow-up and corrective action for gitlab-foss#67295 (closed).

The process to dropping a database column is currently:

  1. Add ignored_columns += %i[column_name] to model
  2. Migration to drop the column
  3. With the next release, remove ignoring the column from the model

Currently, (1) and (2) go in the same MR and (3) is delayed until the next release. This is documented in https://docs.gitlab.com/ee/development/what_requires_downtime.html#dropping-columns.

Proposal

We can improve this per the learnings from gitlab-foss#67295 (closed) and the related gitlab-com/gl-infra/production#1143 (closed).

  1. Programmatically indicate when ignoring the column can be removed, e.g. after a certain Date only gitlab-foss#67295 (comment 216097919)
  2. Extend rake db:obsolete_ignored_columns to check for added conditions (e.g. after a certain date only)
  3. Spread out the process to 3 releases: Ignore column (R1), Drop column (R2), Unignore column (R3) with Rx being releases - update documentation accordingly
Edited Oct 01, 2019 by Toon Claes
Assignee Loading
Time tracking Loading