Skip to content

[Supabase] recalculate_baseball_season_stats live body drifted to stale column b.so — broke all callers (RESOLVED via hotfix; needs drift guard) #728

Description

@njrini99-code

Source: Supabase postgres logs (project qmnssrrolpinvwjjnufo) · surfaced by Helm Mission Control — Sweep, 2026-07-02 22:05 UTC

What happened

The live public.recalculate_baseball_season_stats(...) SECURITY DEFINER function body had drifted to a stale legacy version that referenced a non-existent column b.so. Every call raised:

ERROR: column b.so does not exist
  • ≥4 occurrences in postgres logs between 2026-07-02 20:54:10Z and 21:03:45Z (count is the verifiable floor from the sampled 24h postgres log; actual is likely higher).
  • Broke every caller of the RPC, including CI's seed-baseball-e2e seed path.
  • Root cause: the live pg_proc body diverged from the committed migration ledger (20260624001000_baseball_official_stat_breadth.sql). The live prosrc contained b.so, which matched no committed migration.

Status: RESOLVED (already remediated)

A hotfix migration baseball_recalc_fn_drift_realign was applied at 2026-07-02 21:34Z (via Supabase MCP), rewriting the live body to match the committed ledger. No b.so errors after 21:03Z. This issue is filed for the audit trail + the regression guard below — not for re-fixing.

Ask: add a drift guard

The hotfix repaired this function, but nothing prevents the next live-vs-committed drift. Recommend a CI/pgTAP check that diffs live pg_proc bodies against the committed migration ledger for the baseball RPC surface. This repo has a recurring "committed-not-applied / live-vs-committed drift" class — see #651 and the schema-drift incident cluster.

Filed by Helm Mission Control — Sweep (automated, read-only except issue/Notion creation). No auto-redeploy triggered.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions