Change state to integer for issuables - Release 1
In https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/7302 we added state field to epics and we used integer for it (using enum in the model). Merge Requests and Issues use string. We should switch to integers for these 2 as well.
We use state_machine for MRs and Issues that does not work nicely with enums. We could either introduce a new concern (especially Issues and Epics states are same) or use another gem (eg. https://github.com/aasm/aasm)
obs: This task will be made in two releases, here is the schedule:
First release 11.10: This issue
-
Add a
state_idcolumn to issues and merge requests tables -
Schedule a background migration that will populate
state_idcolumn with new values
Second release 11.12: https://gitlab.com/gitlab-org/gitlab-ce/issues/61301
-
Adds new indexes to
state_idcolumn -
Add the code which uses the new
state_idcolumn -
Removes old
statecolumn with a post deployment migration
Third release(OPTIONAL)
- Rename
state_idcolumnstate