Every stratigraphic layer belongs to exactly one excavation unit, and excavationUnitId stores that link. As you dig down through a unit you record each layer in sequence, and they all share the same excavationUnitId. This relation is required, so a layer cannot exist without a parent unit, and it is what makes a unit's layerNumber values unique within that unit. If the parent unit is deleted, its layers are deleted too, keeping the data consistent.
Technical section
Data model, API, and internals — visible to developers.
