diff --git a/supabase/migrations/20260321_extend_scheduled_notifications.sql b/supabase/migrations/20260321_extend_scheduled_notifications.sql index 194740d4..ae803850 100644 --- a/supabase/migrations/20260321_extend_scheduled_notifications.sql +++ b/supabase/migrations/20260321_extend_scheduled_notifications.sql @@ -490,22 +490,21 @@ BEGIN PERFORM cron.schedule( 'notification_enqueue_every_min', '*/1 * * * *', - $$SELECT public.enqueue_all_notifications();$$ + 'SELECT public.enqueue_all_notifications();' ); -- Job 2: Process notification queue via pg_net every minute PERFORM cron.schedule( 'notification_process_every_min', '*/1 * * * *', - $$SELECT public.process_notification_queue();$$ + 'SELECT public.process_notification_queue();' ); -- Job 3: Daily cleanup of old processed notifications PERFORM cron.schedule( 'cleanup_old_notifications', '0 3 * * *', - $$DELETE FROM scheduled_notifications WHERE processed = true AND processed_at < now() - interval '7 days'; - DELETE FROM notification_pushes WHERE pushed_at < now() - interval '7 days';$$ + 'DELETE FROM scheduled_notifications WHERE processed = true AND processed_at < now() - interval ' || quote_literal('7 days') || '; DELETE FROM notification_pushes WHERE pushed_at < now() - interval ' || quote_literal('7 days') || ';' ); EXCEPTION WHEN others THEN