Skip to main content

DBML reference

The schema is standard DBML — the same file renders as an ERD on dbdiagram.io. The deployer consumes the subset below; the validator rejects anything outside it with a named finding rather than guessing.

Column types

DBML typeSharePoint fieldNotes
int (as pk, increment)built-in IDThe conventional surrogate key; not created as a column
int, numberNumber
nvarcharSingle line of text
longtextMultiple lines, plain text
richtextMultiple lines, rich text
an enum nameChoiceEnum values become the choice set; default: supported
dateDate only
datetimeDate and time
booleanYes/No
personPerson
hyperlinkHyperlink
calculated_text / calculated_number / calculated_dateCalculatedFormula comes from the mapping's calculated_formulas

The legacy bare choice type is rejected — declare an enum so the choice set is part of the reviewed schema.

Enums

enum risk_rating {
Low
Medium
High
Extreme
}

Table Risk {
RiskRating risk_rating [note: 'Assessed rating']
}

Enum-typed columns become Choice columns with exactly the declared values. Enum value sets can also be loaded from YAML via the mapping's enum_sources when several schemas share a vocabulary.

References (lookups)

Ref: Action.RiskId > Risk.Id

Refs become same-site Lookup columns. Self-references and reference cycles are handled by deferring those columns to a dedicated phase after all lists exist. SharePoint cannot span webs with a lookup; cross-site relationships use the mapping's cross_site_reference_columns pattern (a Choice + URL pair) instead.

Column settings

  • not null → required column.
  • unique → enforce unique values (SharePoint indexes it as a side effect).
  • default: 'value' → field default (Choice defaults validated against the enum).
  • note: '...' → the column description operators see; also feeds the data dictionary.

Constraints SharePoint imposes

Surfaced at build time by the validator, not discovered at deploy time:

  • Calculated columns cannot reference Lookup or Person columns, or [Today].
  • Lookups are same-site only.
  • A schema upgrade whose immutable shapes changed (types, lookup targets, list templates) fails closed for explicit migration.