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 reference–Reference to the person”person-uuid-456”
workspaceWorkspace (UUID)βœ… YesForeign key reference–Reference to the workspace”workspace-uuid-789”
firebase_idstringβšͺ Nonullable–Firebase user ID for authentication”firebase-user-id-123”
membership_rolestringβšͺ Nonullableadmin, member, viewer, ownerUser role in the workspace”admin”
created_atstring (ISO 8601) πŸ”’ system–auto timestamp–Creation timestamp”2023-01-01T12:00:00Z”
updated_atstring (ISO 8601) πŸ”’ system–auto timestamp–Last updated timestamp”2024-01-01T12:00:00Z”
deleted_atstring | null πŸ”’ systemβšͺ Nonullable ISO 8601–Deletion 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
⌘I