mirror of
https://github.com/bitbaum/datacat.git
synced 2026-12-04 04:47:31 +01:00
Any Postgres provisioned before9449719(which removed backend/db/init.sql in favor of Prisma-only schema management) still carries a trigger_set_timestamp() trigger created by that old init.sql. Its pre-860a589 form references NEW.updated_at against the actual camelCase updatedAt column, so it throws on every UPDATE to users/forms regardless of Prisma's own @updatedAt handling at the app level (the DB trigger fires independently of how the UPDATE was issued).9449719stopped new databases from ever getting this trigger, but did nothing for ones that already had it - the roadmap's suggested fix ("run this SQL once by hand") never got applied. Ship it as a real Prisma migration instead: DROP TRIGGER/FUNCTION IF EXISTS, which is a no-op on databases that never had the trigger and clears it on ones that did. Verified against a disposable postgres:15-alpine container: fresh DB applies cleanly; a DB seeded with the old buggy trigger reproduces the exact `record "new" has no field "updated_at"` failure, and the new migration's DROP statements fix it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>