---
name: project-database-agent-verified-local-drift
description: database-agent verified-runtime S53; read-advisory DB lens catches committed-but-unapplied-local migrations that green tests + prod both miss
metadata: 
  node_type: memory
  type: project
  originSessionId: 1286dfc9-0333-43e8-9641-07df3d2ca7ad
---

`database-agent` (read-advisory DB specialist, floor DB1–DB11) reached **verified-runtime on 2026-06-08 (S53)** — its first real spawn caught a genuine drift on its first task.

**Reusable insight — the local dev DB is the one surface nothing else verifies.** Unit tests build schema from the EF **model snapshot via SQLite** (`TestApplicationDbContext`); prod uses its **own CI-applied** SQL Server. So a migration can be committed (3-file) + deployed-to-prod + all-tests-green while the **local** `SolutionErp_Dev`/`_Design` LocalDB silently lags. Exactly what happened S52→S53: the S52 session-limit killed the local `dotnet ef database update`, leaving Mig 46 (ItTicket SLA columns) unapplied locally — a local app run against P11-D code would 500, yet 203 tests + prod were both green.

**How to apply:** when a session ends mid-migration or you suspect local drift, spawn `database-agent` to introspect `__EFMigrationsHistory` + `sys.columns` on LocalDB and diff vs committed migrations. `dotnet ef database update` locally applies the whole pending chain (additive migrations are safe — it caught up 46+47 at once). See [[feedback_agent_kill_recovery]].
