Skip to content

Add Epic work item type to the DB

Mario Celi requested to merge 419995-add-epic-work-item-type into master

What does this MR do and why?

Adding a new Epic work item type to the DB. Widget definitions and hierarchy restrictions are also included in the migration.

How to set up and validate locally

  1. Run the migration locally
  2. Go to the rails console bin/rails c
  3. Verify work item type count WorkItems::Type.count => 8
  4. Last work item type is an Epic type WorkItems::Type.last.attributes.slice('name', 'base_type') => {"name"=>"Epic", "base_type"=>"epic"}

DB review

Migration output

UP
bin/rails db:migrate
main: == [advisory_lock_connection] object_id: 224720, pg_backend_pid: 36988
main: == 20230728174927 AddEpicWorkItemType: migrating ==============================
main: == 20230728174927 AddEpicWorkItemType: migrated (0.0168s) =====================

main: == [advisory_lock_connection] object_id: 224720, pg_backend_pid: 36988
ci: == [advisory_lock_connection] object_id: 225060, pg_backend_pid: 36990
ci: == 20230728174927 AddEpicWorkItemType: migrating ==============================
ci: -- The migration is skipped since it modifies the schemas: [:gitlab_main].
ci: -- This database can only apply migrations in one of the following schemas: [:gitlab_ci, :gitlab_internal, :gitlab_shared].
ci: == 20230728174927 AddEpicWorkItemType: migrated (0.0068s) =====================

ci: == [advisory_lock_connection] object_id: 225060, pg_backend_pid: 36990
DOWN
bin/rails db:rollback:main db:rollback:ci
main: == [advisory_lock_connection] object_id: 224440, pg_backend_pid: 36050
main: == 20230728174927 AddEpicWorkItemType: reverting ==============================
main: == 20230728174927 AddEpicWorkItemType: reverted (0.0036s) =====================

main: == [advisory_lock_connection] object_id: 224440, pg_backend_pid: 36050
ci: == [advisory_lock_connection] object_id: 225020, pg_backend_pid: 36321
ci: == 20230728174927 AddEpicWorkItemType: reverting ==============================
ci: -- The migration is skipped since it modifies the schemas: [:gitlab_main].
ci: -- This database can only apply migrations in one of the following schemas: [:gitlab_ci, :gitlab_internal, :gitlab_shared].
ci: == 20230728174927 AddEpicWorkItemType: reverted (0.0088s) =====================

ci: == [advisory_lock_connection] object_id: 225020, pg_backend_pid: 36321

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #419995 (closed)

Edited by Mario Celi

Merge request reports

Loading