Skip to main content
A Custom Column is a per-workspace, per-root virtual column a user adds to a records table (e.g. a ‘Risk level’ column on companies). It holds the column definition only — name, type, position, and the AI/formula/format config — while the computed cell values live in custom_column_values. Custom columns are workspace-scoped and namespaced by records root; they are NOT Hasura columns and NOT governed DATA_VIEW_ROOTS, so they sit behind the records table as an overlay rather than as a queryable entity of their own.
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

Source: apps/api/src/database/entities/CustomColumn.ts · domain: records / data-views · tier: Infrastructure