Validate `MigrationHelpers` if they work properly with `RestrictGitlabSchema`
We have number of MigrationHelpers
, we should validate if they do work properly with RestrictGitlabSchema
.
The !73756 (merged) introduced a RestrictGitlabSchema
with restrict_gitlab_migration gitlab_schema:
syntax. This concern ensures that only a specific set of operations
on a specific data sets are done by migration during execution:
- Allow only DDL changes, and require that they are executed coherently on top of all databases
- Allow Select/DML access only in context of specific schema
gitlab_main, gitlab_ci, gitlab_shared
The MR introduces a number of helpers to enforce or allow more constructs:
-
Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas.require_ddl_mode!
: require DDL only mode -
Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas.require_dml_mode!
: require DML only mode -
Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas.with_suppressed { }
: allow to escape DDL or DML mode limitations
Helpers to validate
lib/gitlab/database/migration_helpers.rb
:
-
rename_column_concurrently
-
change_column_type_concurrently
-
undo_cleanup_concurrent_column_type_change
-
undo_cleanup_concurrent_column_rename
lib/gitlab/database/partitioning_migration_helpers/table_management_helpers.rb
:
-
partition_table_by_date
-
finalize_backfilling_partitioned_table
Edited by Patrick Bair