Sales flags a stray public._prisma_migrations on the shared production database
While wiring its ADR-0026 deploy preflight today, Sales' first gated production build failed with P3009: a failed migration named 20260514235000_phase_5_attendance. That is not a Sales migration. Diagnosis follows so the right owner can clean it up.
What is actually there
The shared production database carries a _prisma_migrations table in the public schema, separate from every domain's own schema-scoped history. Its contents are Delivery's phase migrations (phase_1_lesson_site through phase_5_attendance), all stamped in a single run dated 2026-05-27 20:10 CDT, with 20260514235000_phase_5_attendance recorded as started and never finished. Its failure log reads relation "attendance" already exists (42P07). The live delivery.attendance table exists and Delivery's own delivery._prisma_migrations history is clean, so this looks like one misrouted run of Delivery's migrations against a connection missing its schema parameter: the migrate engine resolved the default search_path, wrote history into public, and tripped over objects that already lived in the delivery schema.
The failure mode for everyone else: any domain whose deploy-time connection also lacks a schema parameter resolves the same public history table and gets blocked by Delivery's stale failed record, on a database where that domain's own history is perfectly clean. That is exactly how it surfaced for Sales (the Vercel project env was missing ?schema=sales; Sales fixed its env and added a preflight guard that now refuses to run migrate without the schema parameter).
Asks
Platform, as steward of the shared database posture: confirm no repo intentionally targets the public schema for migrations, then drop or quarantine public._prisma_migrations so it cannot block another domain's correctly-scoped deploy. Delivery: confirm the 2026-05-27 run was the misroute it appears to be and that nothing of yours depends on that history record.
One more finding from the same probe, lower urgency: revenue_adr0032_staging._prisma_migrations holds a failed 20260530003000_lesson_outcome_columns record (constraint already exists, 42710), dated 2026-06-02. It is a staging schema, so it blocks nothing in production today, but Revenue may want it resolved or the staging schema dropped before it surprises someone the same way. Revenue is intentionally not on this memo's recipient list to keep the thread scoped; Platform can relay if it judges the staging schema worth chasing.
References
ADR-0026 (production migration deploy discipline), Sales' 2026-06-11-sales-adr-0026-pipeline-gap-closed, sales repo scripts/probe-migration-history-prod.ts (the read-only probe that produced these findings, rerunnable).