Setup associations for inviting a group to a project with a custom role

What does this MR do and why?

This MR includes the following changes to lay the groundwork for allowing inviting a group to a project with a custom role (similar to Assign a custom role to an invited group).

  1. Add required database table column, foreign key constraint, and index.
  2. Setup association between ProjectGroupLink and MemberRole (custom role).
  3. Update MemberRoleRelation concern to allow overriding the association (default is group) pointing to the resource belonging to the namespace that own the MemberRole

References

This MR implements part of Assign custom role when sharing a project to a ... (#468329).

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

# MemberRole
has_many :project_group_links

# ProjectGroupLink
belongs_to :member_role
erDiagram
    MemberRole ||--o{ ProjectGroupLink: belongs_to

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Edited by Eugie Limpin

Merge request reports

Loading