From 7300ea3e51843cf0441c3119daffda38f35cd35b Mon Sep 17 00:00:00 2001 From: Sweets Sweetman Date: Tue, 30 Jun 2026 16:14:17 -0500 Subject: [PATCH] =?UTF-8?q?feat(migrations):=20finalize=20email=5Fsend=5Fl?= =?UTF-8?q?og=20=E2=80=94=20drop=20error=20column=20+=20enable=20RLS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drops the unused `error` column (Resend send-failure reason; the empty-email failures succeed so it's always null, and the api never writes it) and enables RLS with no policies, matching neighboring internal/service-written tables (error_logs, playcount store) — the api writes via the service role, which bypasses RLS; anon/authenticated have no access to this internal log. Ref: recoupable/chat#1829 Co-Authored-By: Claude Opus 4.8 (1M context) --- .../20260630211500_finalize_email_send_log.sql | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 supabase/migrations/20260630211500_finalize_email_send_log.sql diff --git a/supabase/migrations/20260630211500_finalize_email_send_log.sql b/supabase/migrations/20260630211500_finalize_email_send_log.sql new file mode 100644 index 0000000..e1ac926 --- /dev/null +++ b/supabase/migrations/20260630211500_finalize_email_send_log.sql @@ -0,0 +1,14 @@ +-- Finalize email_send_log (recoupable/chat#1829): drop the unused `error` +-- column and enable RLS. +-- +-- `error` (the Resend send-failure reason) shipped in the create migration but +-- isn't needed for the core observability goal — the empty-email failures +-- succeed (`success:true`), so it's always null for them, and real send +-- failures are rare/unobserved. The api writer never populates it. +-- +-- RLS: enabled with no policies, matching neighboring internal/service-written +-- tables (error_logs, the playcount store). The api writes via the service role +-- (which bypasses RLS); anon/authenticated have no access to this internal log. + +ALTER TABLE public.email_send_log DROP COLUMN IF EXISTS error; +ALTER TABLE public.email_send_log ENABLE ROW LEVEL SECURITY;