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 assigned by PostgreSQL on INSERT; never exposed as a public UUID. The formatter surfaces String(row.pk) as the JSON:API
idfield because this junction has no dedicated *_id UUID column by design β consumers are expected to reference targets by their (workspace_connector_id, target_workspace_id) tuple. - created_at β stamped once on INSERT by MikroORM onCreate: () => new Date().
- updated_at β stamped on INSERT and on every subsequent UPDATE by MikroORM onUpdate: () => new Date().
- deleted_at β set to the current timestamp by WorkspaceConnectorSyncTargetService when a target is removed via the PUT set-semantics diff; set to NULL (re-add) when a soft-deleted row is reactivated. Never set by the connector sync pipeline directly.
- Backfill rows β the creation migration (Migration20260527140000) inserts one row per active WorkspaceConnector pointing at its own carrier workspace with created_by_pk = NULL, preserving pre-feature 1:1 behaviour for legacy connectors without any code change.
- Partial unique index idx_wcst_unique_active β enforced by PostgreSQL: UNIQUE (workspace_connector_pk, target_workspace_pk) WHERE deleted_at IS NULL. Guarantees at most one active target per (connector, workspace) pair; soft-deleted tombstones are excluded so a re-add is always safe.
Example
/Users/maximechampoux/platform/apps/api/src/database/entities/WorkspaceConnectorSyncTarget.ts Β· domain: ingestion Β· tier: Infrastructure