One migration, ScriptForeignKeysAndExternalIdUniqueness: - FK_VirtualTag_Script / FK_ScriptedAlarm_Script (Restrict) onto Script.ScriptId, which becomes NOT NULL and an alternate key (unique constraint UX_Script_LogicalId replaces the index). - UX_Equipment_ZTag / UX_Equipment_SAPID filtered UNIQUE indexes (blank = no identifier, the deploy gate's reading) replace the non-unique IX_ ones. - ExternalIdReservation + sp_ReleaseExternalIdReservation dropped (decision: retire — no writer since the generation model; uniqueness is gate + indexes). The /reservations page, query, ReservationKind, DraftSnapshot.ActiveReservations and the reservation pre-flight rule go too. - A read-only pre-check THROWs 51049 naming every offending row class (NULL ScriptId, dangling VirtualTag/ScriptedAlarm script, duplicated ZTag/SAPID, any reservation row) and changes nothing; Down restores the previous shape. Authoring mirrors so the constraints are never the first to say no: UnsTreeService refuses a missing script for VirtualTag/ScriptedAlarm create/update, and a ZTag/SAPID another equipment holds on create/update/import (owner named; import keeps the clean rows); values stored trimmed. ScriptEdit maps a concurrent-bind FK refusal to a message. Migration pre-check, Down round-trip, FK and index behaviour pinned against real SQL with positive controls.
This commit is contained in:
@@ -530,10 +530,6 @@ public sealed class AdminOperationsActor : ReceiveActor
|
||||
// derivation, cross-cluster/namespace binding, driver-namespace compat, signal collisions,
|
||||
// …) gates the deploy. A green build in this repo does not prove the config is valid; this
|
||||
// is the last guard before a bad address space (or a non-derived EquipmentId) ships.
|
||||
// NOTE: a BadDuplicateExternalIdentifier rejection from the reservation pre-flight can
|
||||
// (rarely) be a false positive if an external-id reservation release has not yet been
|
||||
// committed/visible when the snapshot is read — operators seeing a spurious one should
|
||||
// check ExternalIdReservation state before re-submitting.
|
||||
var draft = await DraftSnapshotFactory.FromConfigDbAsync(db);
|
||||
phases.Mark("snapshot-read");
|
||||
var errors = DraftValidator.Validate(draft).ToList();
|
||||
|
||||
Reference in New Issue
Block a user