Skip to content

Add member_of_orgs as JSONB to organizations #197

Description

@roaldchristesen

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

documentationImprovements or additions to documentationenhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions