Create an EDT
Updated
An EDT is the type of a field. Declare it once in your model. Fields reuse
it through edtMetaId. A Reference EDT points at a dictionary
(or a document). A scalar EDT is String, Integer, Long, Decimal,
DateTime, Boolean, or Guid.
Note
A Reference EDT stores the target's
MetaId(a Guid, no type tag). The target's type is this EDT. See Identity.
How to#
1. The file — EDTs/<Name>.json, kind EDT. A new GUID in metaId.
modelId is your model's. Names are PascalCase Latin. Convention for a
reference is Ref<Target> (RefUnitOfMeasure).
A Reference needs edtType: "Reference" and referenceDictionaryMetaId of
the target dictionary. A scalar uses edtType as the base type, plus length
for a string or precision and scale for a decimal.
A reference field always goes through an EDT, then edtMetaId on the
field instead of baseType. A scalar may stay inline baseType on the field.
Make a scalar EDT when several fields must share the same length or precision.
Warning
Integer is
Integer, notInt— on the EDT and on an inlinebaseType. Import acceptsIntsilently. Schema sync then fails with "Base type 'Int' is not in the catalog": the object exists, the table does not. See Schema.
2. Use it on a field — edtMetaId. One fieldName once. A field on
somebody else's object is an extension in your model, not a change to
their EDT — Extend another model.
3. Bump modelVersion in the same change.
An enum EDT (edtType: "Enum") is a different object —
Create an enum. This cookbook is Reference and scalar.
What's not there yet#
There is no catalog of every EDT. Look in EDTs/ of the model that owns the
dictionary you point at. EDTResolver maps the EDT to a physical column: a
Reference becomes uniqueidentifier, an enum becomes an integer.