A photograph taken inside or above a specific dig square records that context through its excavationUnitId, which points to the ExcavationUnit in the photo. This is how plan and profile shots stay attached to the unit they belong to, so you can browse every image of one square in sequence. The link is optional, since not every photo is unit-specific, and it is indexed for fast retrieval. If the excavation unit is later deleted, the photo survives and its excavationUnitId is simply cleared.
Technical section
Data model, API, and internals — visible to developers.
