Create work_items_types table
There is an issue_type
column in the Issues table. As we need to support customer defined issue types, we're extracting that column into its own table, work_item_types
. It also adds a :work_item_type_id
column to the issues
table. Each issue will then be assigned to the proper type. Properly migrating old types to new types will happen in upcoming MRs. This is just the first step.
This is the first step of the plan being laid out in !66519 (merged) (thanks @acroitor)
As of right now, we're eventually aiming for a structure like this:
Diagram source
```plantuml
hide circle
hide empty members
entity issues {
used for WorkItem/Issue model
---
+ id
+ project_id
+ work_item_type_id
-- normal attributes --
+ milestone_id
- assignees
+ ...
}
entity work_item_types {
+ id
+ namespace_id
+ title
+ description
+ base_type
- work_items
- widget_defs
}
entity widget_defs {
widget_data would be nil for our standard
widget types
---
+ id
+ name
+ disabled
+ row_order
+ widget_type
}
entity widget_type_enum {
* assignees
* milestone
* labels
* status
* other "first class" attributes
}
entity base_type_enum {
* issue
* test_case
* requirement
* incident
}
issues::work_item_type_id <-- work_item_types::work_items
work_item_types::base_type -[dashed]- base_type_enum
work_item_types::widget_defs --> widget_defs
widget_defs::widget_type -[dashed]- widget_type_enum
```