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:
- Add
ignored_columns += %i[column_name]
to model - Migration to drop the column
- 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).
- Programmatically indicate when ignoring the column can be removed, e.g. after a certain Date only gitlab-foss#67295 (comment 216097919)
- Extend
rake db:obsolete_ignored_columns
to check for added conditions (e.g. after a certain date only) - Spread out the process to 3 releases: Ignore column (R1), Drop column (R2), Unignore column (R3) with
Rx
being releases - update documentation accordingly
Edited by Toon Claes