Skip to main content
WorkspaceGroupWorkspace is the join-table entity that links a WorkspaceGroup to an individual Workspace, forming the “which workspaces belong to this group” edge. It is written exclusively by the workspace-group management pipeline (group creation / workspace enrollment flows); users have no resource PATCH endpoint against this table. The row carries a soft-delete column so that removing and re-adding the same (group, workspace) pair is legal — the partial unique index enforces at most one live join per pair while allowing re-creation after soft-deletion. An optional created_by foreign key records which People actor enrolled the workspace.
Internal object. Not currently exposed on the public REST API. The operations below describe the intended contract.

API operations

Data model

Attributes

Relationships

System-computed

  • pk — auto-increment serial primary key, internal only; never exposed in the public API
  • created_at — set to new Date() by the MikroORM onCreate hook on INSERT
  • updated_at — set to new Date() by the MikroORM onUpdate hook on every UPDATE
  • deleted_at — set by the workspace-group management service when a workspace is removed from a group; never set by user direct PATCH
  • Partial unique index workspace_group_workspaces_group_workspace_active_unique enforces at most one live (workspace_group_pk, workspace_pk) pair WHERE deleted_at IS NULL — allows remove-then-re-add without 500 collisions
  • The unconditional unique constraint workspace_group_workspaces_workspace_group_pk_wor_3c190_unique was dropped by Migration20260529030000 and replaced with the partial unique index

Example

Source: /Users/maximechampoux/platform/apps/api/src/database/entities/WorkspaceGroupWorkspace.ts · domain: workspace · tier: Platform