Add OrganizationUserDetail table and model
What does this MR do and why?
As we plan out the architecture for Organizations and Cells, we have broadened the concept of per-organization usernames to potentially include other types of data. See this handbook MR for details on this architectural decision.
We want to replace the organization_user_aliases table with the organization_user_details table. This MR is the first part of that work, adding the organization_user_details table and related ActiveRecord model. There are some improvements over the previous table, including using TEXT type rather than VARCHAR , and adding a lower composite index similar to the users table.
References
- Feature issue: #442780 (closed)
- Architecture proposal for
Organizations::UserDetails- gitlab-com/content-sites/handbook!13503 (merged) - Proof-of-Concept MR this line of MRs was split out from: !186023 (closed)
- Part 1: Allow specifying an Organization for internal users: !186690 (merged)
- Part 2: Add OrganizationUserAlias table: !189052 (merged)
- Part 3: This MR, rename to OrganizationUserDetail table
- Part 4: User aliases in mentions, autocomplete, participants (will need modification based on this MR): !190607 (merged)
Screenshots or screen recordings
How to set up and validate locally
- Run migrations
- On Rails console, create a new
Organizations::OrganizationUserDetail-org = Organizations::Organization.first user = User.first oud = Organizations::OrganizationUserDetail.create(organization: org, user: user, username: 'test-root-alias', display_name: 'Test Alias for Root')
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #442780 (closed)