[Discussion] : Removing old migration files on regular cadence
Problem
We have had few maintenance code cleanup MRs that touched migration files that were really old.
- https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/9766+
- https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/9749+
Please also see the Architecture Meeting notes.
Proposal
Have a regular cadence to remove the old migration files. The migration files are helpful to run and rollback a migration, but after the migration has been run and deemed to be stable, it could be deleted, say after 1.year
.
The current db/schema.rb
will represent the database schema and will be used to setup new development environment.
Following the GitLab process, we can also squash the old migrations. An example MR: Migration squash for all migrations in 14.10 (gitlab!120364 - merged)
There is a helpful gem called "squasher" and GitLab helper that we can use.
Cons:
- we may not have exact history on the development of a table
Result
Less code/files to maintain in a customers-dot
project.