Add an optional member_of_orgs field to the organization table to represent the organizations in which an organization has a membership or other formal relationship.
The field should use jsonb and contain an array of objects with an organization UUID and a role.
Example:
[
{
"uuid": "019d35a0-3cd1-7c28-b3ca-537e8577defe",
"role": "member"
},
{
"uuid": "019d35a0-3cd1-7c28-b3ca-537e8577def0",
"role": "partner"
}
]
Supported roles should initially include:
member
sponsor
partner
media_partner
funding_partner
cooperation_partner
cultural_partner
The list should remain extensible so additional relationship roles can be added later.
Requirements
- Add an optional
member_of_orgs jsonb field to the organization table/model.
- The field may be
NULL when no such relationships exist.
- Each entry must contain:
uuid — UUID of the related organization.
role — type of relationship.
- Store UUIDs as JSON strings.
- Support querying organizations by related organization UUID and optionally by role.
- Add an appropriate JSONB GIN index if these relationships are expected to be queried frequently.
- Update the API and data model documentation accordingly.
Add an optional
member_of_orgsfield to theorganizationtable to represent the organizations in which an organization has a membership or other formal relationship.The field should use
jsonband contain an array of objects with an organization UUID and a role.Example:
[ { "uuid": "019d35a0-3cd1-7c28-b3ca-537e8577defe", "role": "member" }, { "uuid": "019d35a0-3cd1-7c28-b3ca-537e8577def0", "role": "partner" } ]Supported roles should initially include:
membersponsorpartnermedia_partnerfunding_partnercooperation_partnercultural_partnerThe list should remain extensible so additional relationship roles can be added later.
Requirements
member_of_orgsjsonbfield to theorganizationtable/model.NULLwhen no such relationships exist.uuid— UUID of the related organization.role— type of relationship.