feat(config): make Equipment.DriverInstanceId nullable + driver-less AdminUI support + migration

This commit is contained in:
Joseph Doherty
2026-06-08 06:49:28 -04:00
parent a94d03a194
commit d2dbf7b0d7
8 changed files with 1823 additions and 9 deletions
@@ -106,6 +106,15 @@ In `cmd_populate_equipment`:
become no-ops; remove for clarity. Keep the `Namespace` INSERT/teardown.
- Fix the stale `# … "an Equipment namespace has a driver" expectations` comment.
### AdminUI — two production derefs (found at build time, not by the grep sweep)
Making the column nullable surfaced two `.razor` sites the impact grep missed (caught by `TreatWarningsAsErrors`):
- `Components/Pages/Clusters/TagEdit.razor:191``db.Equipment.Where(e => driverIds.Contains(e.DriverInstanceId))` (CS8604).
Behavior-preserving fix: guard `e.DriverInstanceId != null && …` (SQL already excludes NULL from an `IN` set, so this only satisfies the compiler).
- `Components/Pages/Clusters/EquipmentEdit.razor` — the equipment editor loads `DriverInstanceId` into a non-null
`FormModel` (line 183, CS8601) and **mandates** a driver on save (`"Pick a driver instance."`). Decision: give it
**full driver-less support**`FormModel.DriverInstanceId``string?`, add a "(none / driver-less)" option to the
driver dropdown, relax the mandatory-driver validation, and persist NULL when none is selected (normalize empty → null).
### Noted, not changing (YAGNI)
- `sp_ComputeGenerationDiff` includes `DriverInstanceId` in a `CHECKSUM(...)`. It is NULL-tolerant for
this one-time transition and sits on the **dormant** generation-diff path (the active deploy gate is