document_workspace_connectors pattern. Tenant scope is inherited transitively through account.workspace and workspaceConnector.workspace — no direct workspace_pk column is stored on the junction itself. Rows are written exclusively by the connector sync pipeline and are never modified by users.
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 on the public API.
- created_at — set automatically via MikroORM
onCreatehook (and Postgres defaultnow()); not writable after insert. - updated_at — set automatically via MikroORM
onCreateandonUpdatehooks; updated on every flush. - deleted_at — populated exclusively by soft-delete logic in the sync pipeline; no user-initiated deletion path.
- direction — written at row creation time by the connector sync orchestrator based on the connector’s role; never changed after insert.
- No
workspace_pkcolumn: tenant scope is resolved by traversing theaccount → workspaceorworkspaceConnector → workspacerelationship, consistent with thedocument_workspace_connectorsdesign precedent. - No UNIQUE constraint on (account_pk, workspace_connector_pk, direction) — duplicate rows are allowed by design in the current schema; deduplication is deferred to iteration 3+ per migration comments.
- No
external_idfield — external object identity is deferred to a future iteration; this table records the connector pointer only. - Rows are created exclusively by the connector sync pipeline (connector sync writer). There is no resource PATCH endpoint for this entity.
Example
apps/api/src/database/entities/AccountWorkspaceConnector.ts · domain: ingestion · tier: Infrastructure