Files
route-commerce/db
route-commerce 4d323af51b
Deploy to route.crispygoat.com / deploy (push) Successful in 4m3s
fix(water-log): add missing pin_hash column on water_admin_settings
The Drizzle schema in db/schema/water-log.ts declares
`water_admin_settings.pin_hash TEXT` for the hashed admin PIN, but
the table was originally created in 0090_water_log_completion.sql
WITHOUT that column. The earlier 0004 migration was a no-op against
prod (table already existed from 0090) and so did not add it either.

Effect: every Drizzle `select()` / `insert()` against the table
throws 'column pin_hash does not exist', which:

  - /api/water-admin-auth catches and returns 500 'Server error'
  - /admin/water-log/settings never finishes loading (the action's
    promise rejects inside withBrand, so LOAD_DONE is never
    dispatched, and the page sits on the Loading… state)

Migration adds the column with IF NOT EXISTS so it's safe to re-run
and won't error on a brand whose row already has a hash.
2026-07-01 14:10:05 -06:00
..