Skip to main content
The Membership entity represents a person’s membership in a workspace within the Well system. It serves as the central linking table for the multi-tenancy system, allowing a user to belong to multiple workspaces with different roles.

Table structure

Table name: memberships

Main fields

NameTypeRequiredConstraintsAllowed ValuesDescriptionExample
idstring, UUID, 🔒 system✅ YesUnique identifier (read-only)Unique identifier of the membership previously created”membership-uuid-123”
personPeople (UUID)✅ YesForeign key referenceReference to the person”person-uuid-456”
workspaceWorkspace (UUID)✅ YesForeign key referenceReference to the workspace”workspace-uuid-789”
firebase_idstring⚪ NonullableFirebase user ID for authentication”firebase-user-id-123”
membership_rolestring⚪ Nonullableadmin, member, viewer, ownerUser role in the workspace”admin”
created_atstring (ISO 8601) 🔒 systemauto timestampCreation timestamp”2023-01-01T12:00:00Z”
updated_atstring (ISO 8601) 🔒 systemauto timestampLast updated timestamp”2024-01-01T12:00:00Z”
string | null 🔒 system⚪ Nonullable ISO 8601Deletion timestamp (soft delete)“2024-01-01T12:00:00Z”

Relations

The Membership entity is a Many-to-Many linking table between People and Workspace:

Many-to-One relations

  • People: The member person (one membership → one person)
  • Workspace: The workspace (one membership → one workspace)

Relationship schema

People (1) ←→ (N) Membership (N) ←→ (1) Workspace

# Enables Many-to-Many relationship:
People (N) ←→ (N) Workspace via Membership