DB Schema
Namespace
Top-level owner scope (user or team). Maps to a URL slug like alice. Global scope.
| Field | Type | Description |
|---|---|---|
id | ObjectId | Primary key |
slug | String (unique) | URL-friendly identifier |
userId | String? | User owner reference |
teamId | String? | Team owner reference |
metadata | Json? | Arbitrary metadata |
deletedAt | DateTime? | Soft delete timestamp |
Must have either userId OR teamId (enforced in application logic).
Relations: spaces: Space[]
Indexes: slug (unique), deletedAt, userId, teamId