Skip to content

Commit 4b8f5f3

Browse files
committed
docs(field-types): give unique its real scope vocabulary
The Universal Field Properties row typed `unique` as `boolean` with the one-line description "Enforce uniqueness". The contract has been `boolean | 'global' | 'organization'` since ADR-0120 D1, so the table hid two of the three spellings — a reader who trusted it could not express `'global'` at all, and was contradicted by this same page's own example at :50, which passes `unique: 'organization'`. The type cell now matches the generated reference (`content/docs/references/data/field.mdx`) spelling for spelling, and the description points at the `FieldSchema` doc block rather than restating a rule that regenerates elsewhere — the convention the sibling `multiple` row on this table already uses. The default cell is deliberately left at `false`. Measured against this tree: `FieldSchema.parse({ type: 'autonumber', ... })` with `unique` omitted resolves to `false`, exactly as `text` does. The card asked for a type-conditional default (`'organization'` on `autonumber`) predicated on #13894, which has not landed. Documenting it would assert a default the schema does not implement. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012zGPuVVX3deAx9LdjK8jCk
1 parent 450e73b commit 4b8f5f3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

content/docs/data-modeling/field-types.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ These properties are available on **all** field types:
652652
| `description` | `string` | — | Field description / help text |
653653
| `type` | `FieldType` | **required** | One of the supported field types |
654654
| `required` | `boolean` | `false` | Whether the field is required |
655-
| `unique` | `boolean` | `false` | Enforce uniqueness |
655+
| `unique` | `boolean \| 'global' \| 'organization'` | `false` | Unique constraint **and its scope** (ADR-0120). `'organization'` = one holder per organization; `true` = that same per-organization scope (positional synonym — prefer the explicit spelling in new code); `'global'` = one holder across the whole installation; `false` = no constraint. `'tenant'`/`'org'` are rejected — the word is `'organization'`. Full rule in the `unique` doc block in [`FieldSchema`](/docs/references/data/field) |
656656
| `multiple` | `boolean` | `false` | Allow array of values (multi-record lookup, multi-select, multi-file). An emptied multi-value lookup reads back as `[]`, never `null` — the `multiple` doc block in [`FieldSchema`](/docs/references/data/field) |
657657
| `searchable` | `boolean` | `false` | Include in search index |
658658
| `sortable` | `boolean` | `true` | Allow sorting by this field |

0 commit comments

Comments
 (0)