Add and backfill namespace_id for design_management_designs
Add and backfill namespace_id for design_management_designs. This table has a [desired sharding key](https://docs.gitlab.com/ee/development/database/multiple_databases.html#define-a-desired_sharding_key-to-automatically-backfill-a-sharding_key) configured ([view configuration](https://gitlab.com/gitlab-org/gitlab/-/blob/master/db/docs/design_management_designs.yml)). This merge request is the first step towards transforming the desired sharding key into a [sharding key](https://docs.gitlab.com/ee/development/database/multiple_databases.html#defining-a-sharding-key-for-all-cell-local-tables). This involves three changes: - Adding a new column that will serve as the sharding key (along with the relevant index and foreign key). - Populating the sharding key when new records are created by adding a database function and trigger. - Scheduling a [batched background migration](https://docs.gitlab.com/ee/development/database/batched_background_migrations.html) to set the sharding key for existing records. Once the background migration has completed, a second merge request will be created to finalize the background migration and validate the not null constraint. We have assigned a random backend engineer from ~"group::product planning" to review these changes. Please review this merge request from a ~backend perspective. The main thing we are looking to verify is that the added column and association match the values specified by the [desired sharding key](https://gitlab.com/gitlab-org/gitlab/-/blob/master/db/docs/design_management_designs.yml) configuration and that backfilling the column from this other table makes sense in the context of this feature. When you are finished, please: 1. Trigger the [database testing pipeline](https://docs.gitlab.com/ee/development/database/database_migration_pipeline.html) as instructed by Danger. 1. Request a review from the ~backend maintainer and ~database reviewer suggested by Danger. If you have any questions or concerns, reach out to @tigerwnz or @manojmj. This merge request was generated by a once off keep implemented in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/143774 This change was generated by [gitlab-housekeeper](https://gitlab.com/gitlab-org/gitlab/-/tree/master/gems/gitlab-housekeeper) using the Keeps::BackfillDesiredShardingKeySmallTable keep. To provide feedback on your experience with `gitlab-housekeeper` please comment in <https://gitlab.com/gitlab-org/gitlab/-/issues/442003>. Changelog: other
显示
- db/docs/batched_background_migrations/backfill_design_management_designs_namespace_id.yml 9 个添加, 0 个删除...tions/backfill_design_management_designs_namespace_id.yml
- db/docs/design_management_designs.yml 1 个添加, 0 个删除db/docs/design_management_designs.yml
- db/migrate/20240515155059_add_namespace_id_to_design_management_designs.rb 9 个添加, 0 个删除...15155059_add_namespace_id_to_design_management_designs.rb
- db/post_migrate/20240515155060_index_design_management_designs_on_namespace_id.rb 16 个添加, 0 个删除...155060_index_design_management_designs_on_namespace_id.rb
- db/post_migrate/20240515155061_add_design_management_designs_namespace_id_fk.rb 16 个添加, 0 个删除...15155061_add_design_management_designs_namespace_id_fk.rb
- db/post_migrate/20240515155062_add_design_management_designs_namespace_id_trigger.rb 25 个添加, 0 个删除...062_add_design_management_designs_namespace_id_trigger.rb
- db/post_migrate/20240515155063_queue_backfill_design_management_designs_namespace_id.rb 40 个添加, 0 个删除..._queue_backfill_design_management_designs_namespace_id.rb
- db/schema_migrations/20240515155059 1 个添加, 0 个删除db/schema_migrations/20240515155059
- db/schema_migrations/20240515155060 1 个添加, 0 个删除db/schema_migrations/20240515155060
- db/schema_migrations/20240515155061 1 个添加, 0 个删除db/schema_migrations/20240515155061
- db/schema_migrations/20240515155062 1 个添加, 0 个删除db/schema_migrations/20240515155062
- db/schema_migrations/20240515155063 1 个添加, 0 个删除db/schema_migrations/20240515155063
- db/structure.sql 24 个添加, 0 个删除db/structure.sql
- lib/gitlab/background_migration/backfill_design_management_designs_namespace_id.rb 12 个添加, 0 个删除...ration/backfill_design_management_designs_namespace_id.rb
- lib/gitlab/design_management/copy_design_collection_model_attributes.yml 1 个添加, 0 个删除...gn_management/copy_design_collection_model_attributes.yml
- spec/lib/gitlab/background_migration/backfill_design_management_designs_namespace_id_spec.rb 15 个添加, 0 个删除...n/backfill_design_management_designs_namespace_id_spec.rb
- spec/migrations/20240515155063_queue_backfill_design_management_designs_namespace_id_spec.rb 33 个添加, 0 个删除...e_backfill_design_management_designs_namespace_id_spec.rb
加载中
想要评论请 注册 或 登录