doc/development/database/deleting_migrations.md
When removing existing migrations from the GitLab project, you have to take into account the possibility of the migration already been included in past releases or in the current release, and thus already executed on GitLab.com and/or in GitLab Self-Managed instances.
Because of it, it's not possible to delete existing migrations, as that could lead to:
schema_versions table, that points out to migration that no longer exists on the codebase.Instead of deleting we can opt for disabling the migration.
Migrations can be disabled if:
In order to disable a migration, the following steps apply to all types of migrations:
#up, #down
or #perform methods, and adding # no-op comment instead.Disabling migrations requires explicit approval of Database Maintainer.