# External-ID (ZTag / SAPID) uniqueness > **The reservation ledger is retired (lmxopcua#1049, 2026-12).** `ExternalIdReservation`, the `/reservations` > page, `sp_ReleaseExternalIdReservation` and the deploy gate's reservation pre-flight are gone. The ledger's only > writer, `sp_PublishGeneration`, was retired with the generation model, so the table stayed empty and the > pre-flight could never fire (review 2026-12-02, C-3). The permanent "a retired asset's id stays claimed" semantics > of decision #124 were therefore never in force in v3, and are not provided now. An equipment's **external identifiers** — its `ZTag` (ERP id) and `SAPID` (SAP PM id) — are unique **fleet-wide**: no two `Equipment` rows, in the same cluster or different clusters, may carry the same value. Both are optional; a blank value means "no identifier". ## Where it is enforced | Layer | What | Comparison | |---|---|---| | Authoring (`UnsTreeService`) | Equipment create / update / CSV import refuse a value another equipment holds and name that equipment; an import names each clashing row (against the DB or an earlier row of the same file) and still imports the clean rows. Values are stored trimmed; blank is stored as `NULL`. | Trimmed; the DB's case-insensitive collation | | Deploy gate (`DraftValidator.ValidateEquipmentExternalIdUniqueness`) | The authority: every duplicate in the whole-DB draft snapshot is reported as `BadDuplicateExternalIdentifier`, naming the other equipment. | Trimmed, case-insensitive, blank = none | | Storage (`UX_Equipment_ZTag`, `UX_Equipment_SAPID`) | Filtered UNIQUE indexes, `WHERE [ZTag] IS NOT NULL AND [ZTag] <> N''` (same for `SAPID`) — the backstop for a concurrent save or a hand edit. Never stricter than the gate. | Column collation (case-insensitive) | ## Upgrading a populated ConfigDb Migration `ScriptForeignKeysAndExternalIdUniqueness` creates the unique indexes and drops the ledger. It refuses (error 51049, nothing changed) while any non-blank ZTag or SAPID is duplicated, or while `ExternalIdReservation` still holds rows (export them if their history matters, then delete them). Run the upgrade preflight first — it lists exactly those rows: [docs/v2/upgrade-preflight.md](v2/upgrade-preflight.md). ## Related - `docs/v2/plan.md` — decision #124 (the original reservation design, historical). - `docs/Raw.md` — the other deploy-gate uniqueness rules (#998).