Files
braidsbymira/supabase/migrations/20260808000003_notify_triggers.sql
belviskhoremk 7e51c2df37 feat: add on-booking-created and on-inquiry-created Edge Functions with DB-trigger wiring
Wires pg_net-based database triggers on bookings/inquiries to invoke the two
Edge Functions on insert. Two empirically-discovered fixes over the brief's
literal SQL were required to make this work locally:

- ALTER DATABASE ... SET for a custom GUC needs superuser, but the local
  migration role (postgres) isn't superuser in this Supabase CLI stack (only
  supabase_admin is) - inlined the base URL as a literal constant in each
  trigger function instead.
- pg_net's http_post lives in schema `net`, not `extensions.net` - fixed the
  function calls accordingly.

Also disabled verify_jwt for both functions in config.toml since they're
invoked by pg_net (no Authorization header), not by end-user clients.

Claude-Session: https://claude.ai/code/session_01NhxA4npAXAxmCDEJt6kxSH
2026-08-08 13:25:04 +00:00

3.9 KiB