Files
evig/scripts/db/migrations/023_fix_users_trigger.sql
T
g-butandClaude Opus 4.6 2a71f61d2f feat(validation): add Zod schemas to ~25 API routes with tests
Add comprehensive input validation across all high-priority API routes:
- Create 12 domain-specific schema files (payments, appointments, reviews,
  workshops, messages, user, repairer, seller, blog, ai, inventory, common)
- Add validateBody/validateQuery helpers with structured German error responses
- Wire validation into 20+ route files replacing manual field-presence checks
- Add discriminated union schema for appointment PATCH actions
- Standardize payment route error messages to German
- Fix lint errors in CategoryForm and RegistrationWizard (setState in useEffect)
- Extract thick route handlers to service layer (seller, inventory, orders)
- Add loading states to admin and dashboard pages
- Add 67 unit tests covering all schemas with valid/invalid/default cases

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 06:21:58 +01:00

12 lines
516 B
SQL

-- Migration 023: Fix users table trigger
--
-- The users table uses camelCase column names from Auth.js adapter ("updatedAt")
-- but the update_updated_at_column() trigger references snake_case "updated_at".
-- This causes ALL updates to the users table to fail with:
-- ERROR: record "new" has no field "updated_at"
--
-- Fix: Drop the mismatched trigger. The application code already handles
-- setting "updatedAt" = NOW() explicitly in UPDATE queries.
DROP TRIGGER IF EXISTS update_users_updated_at ON users;