Skip to main content
FieldRuleValue stores the computed or user-supplied value for a single custom-column rule applied to a single record. Each row binds a FieldRule (the definition of a custom AI column) to a specific record by its string identifier and record root type, holding the computed JSONB value. It is the output store for the AI custom-column enrichment pipeline: the pipeline writes rows here after computing values; nothing else creates or modifies them via user interaction. There is no soft-delete column — rows are hard-deleted when their parent FieldRule is cascade-deleted.
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

  • value_id: auto-generated UUID via gen_random_uuid() on insert
  • created_at: set by MikroORM onCreate hook; not user-settable
  • updated_at: set by MikroORM onCreate and onUpdate hooks; not user-settable
  • No soft-delete (deleted_at column absent): rows are hard-deleted on cascade from FieldRule deletion
  • Hot-path composite index idx_field_rule_values_root_record_rule (root, record_id, field_rule_pk) added in Migration20260416000000 for AI custom-column batch context assembly
  • Unique constraint field_rule_values_rule_record_unique (field_rule_pk, record_id) added in Migration20260330153340 to enable race-condition-safe upserts from the enrichment pipeline

Example

Source: apps/api/src/database/entities/FieldRuleValue.ts · domain: workspace · tier: Infrastructure