feat(migrations): finalize email_send_log — drop error column + enable RLS

Merged
SW
4mo ago
+14-0

What

Finalizes the email_send_log table:

ALTER TABLE public.email_send_log DROP COLUMN IF EXISTS error;
ALTER TABLE public.email_send_log ENABLE ROW LEVEL SECURITY;

Why

  • Drop error — it slipped into the create migration (#37) but isn't needed for the core observability goal: the empty-email failures we chase succeed with success:true (so error is always null), real send failures are rare/unobserved, and logEmailAttempt never writes it. Trivially re-addable later (nullable, no backfill).
  • Enable RLS — Supabase flags tables without it. Enabled with no policies, matching neighboring internal/service-written tables (error_logs, the playcount store): the api writes via the service role (bypasses RLS); anon/authenticated have no access to this internal log.

Leaves the agreed 7 columns: id, created_at, account_id, chat_id, status, resend_id, raw_body.

Part of recoupable/chat#1829.

šŸ¤– Generated with Claude Code