freightdesk/supabase/migrations
FreightDesk 795cc86b5a [OWL] Audit logging: cherry-pick Hermes' audit SQL, add routes + views
From Hermes' agent/default/soft-delete-audit branch:
- Add migration 004_audit_logging.sql (audit_logs table, trigger function,
  triggers on loads/shippers/vehicles/payments/portal_users,
  set_audit_user() helper function)
- Improved: uses IF NOT EXISTS, AFTER triggers, user session context var,
  distinguishes SOFT_DELETE vs HARD_DELETE, notes field

New:
- GET /audit-logs (admin-only, filterable by table/action, paginated)
- GET /audit-logs/:id (detail view with before/after JSON)
- Audit Logs link in sidebar

Keeps all existing OWL code: CI/CD, Pino, Prometheus, tests, cache-busting,
debounced search, ESLint, Prettier
2026-06-07 20:03:23 +00:00
..
001_initial_schema.sql Initial commit: FreightDesk v1.0 2026-06-07 18:57:24 +00:00
002_seed_data.sql Initial commit: FreightDesk v1.0 2026-06-07 18:57:24 +00:00
003_soft_delete.sql [OWL] Security fixes: remove hardcoded password, add setup form, soft-delete migration 2026-06-07 19:34:22 +00:00
004_audit_logging.sql [OWL] Audit logging: cherry-pick Hermes' audit SQL, add routes + views 2026-06-07 20:03:23 +00:00