Move push notification to client instead of db trigger

This commit is contained in:
2026-02-28 16:19:08 +08:00
parent dab43a7f30
commit 0a8e388757
8 changed files with 698 additions and 226 deletions
@@ -0,0 +1,16 @@
-- Migration: Drop notifications trigger that posts to the send_fcm edge function
-- Reason: moving push invocation to client-side; remove server trigger to avoid duplicate sends
BEGIN;
-- Remove the trigger that calls the edge function on insert into public.notifications
DROP TRIGGER IF EXISTS notifications_send_fcm_trigger ON public.notifications;
-- Remove the trigger function as well (if present)
DROP FUNCTION IF EXISTS notifications_send_fcm_trigger() CASCADE;
COMMIT;
-- NOTE: After deploying this migration, the application will rely on the
-- client-side push path. Ensure client builds are released and rollout is
-- coordinated before applying this migration in production to avoid missing
-- pushes for any clients that still expect server-side delivery.