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
- custom_column_id generated by gen_random_uuid()
- field_key slugified from name at creation (slugifyFieldKey)
- Partial unique index on (workspace_pk, root, field_key) WHERE deleted_at IS NULL — managed in a raw-SQL migration, not @Index (MikroORM cannot express partial indexes)
- type defaults to ‘text’; position defaults to 0
- created_at via onCreate; updated_at via onCreate + onUpdate hooks
- Soft-delete via deleted_at
- On create: autoProvisionPresets(workspace, root) may seed preset AI columns; fire-and-forget recompute over existing records
- On rules_config / formula_config / format_config change: enqueueRecompute → recompute all records for the column
- AI columns (type=‘ai’ or rules_config present) compute via EnrichmentTask (CUSTOM_COLUMN) → Cloud Task → Anthropic Haiku, with anti-prompt-injection guards
Example
apps/api/src/database/entities/CustomColumn.ts · domain: records / data-views · tier: Infrastructure