From d81e2cde269475c69ca735acab30111c8d46edaa Mon Sep 17 00:00:00 2001 From: Marc Rejohn Castillano Date: Fri, 20 Mar 2026 18:30:19 +0800 Subject: [PATCH] Fix RAISE NOTICE syntax in migration error handler Use parameterized RAISE NOTICE with %L placeholders instead of trying to concatenate strings inside quoted literals. This fixes the syntax error where || operators were being treated as string content instead of SQL operators. --- .../migrations/20260321_extend_scheduled_notifications.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/supabase/migrations/20260321_extend_scheduled_notifications.sql b/supabase/migrations/20260321_extend_scheduled_notifications.sql index ae803850..deafca92 100644 --- a/supabase/migrations/20260321_extend_scheduled_notifications.sql +++ b/supabase/migrations/20260321_extend_scheduled_notifications.sql @@ -509,7 +509,7 @@ BEGIN EXCEPTION WHEN others THEN RAISE NOTICE 'pg_cron/pg_net not available. After enabling them, run these manually:'; - RAISE NOTICE ' SELECT cron.schedule("notification_enqueue_every_min", "*/1 * * * *", $QUERY$SELECT public.enqueue_all_notifications();$QUERY$);'; - RAISE NOTICE ' SELECT cron.schedule("notification_process_every_min", "*/1 * * * *", $QUERY$SELECT public.process_notification_queue();$QUERY$);'; - RAISE NOTICE ' SELECT cron.schedule("cleanup_old_notifications", "0 3 * * *", $QUERY$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') || ';$QUERY$);'; + RAISE NOTICE ' SELECT cron.schedule(%L, %L, %L);', 'notification_enqueue_every_min', '*/1 * * * *', 'SELECT public.enqueue_all_notifications();'; + RAISE NOTICE ' SELECT cron.schedule(%L, %L, %L);', 'notification_process_every_min', '*/1 * * * *', 'SELECT public.process_notification_queue();'; + RAISE NOTICE ' SELECT cron.schedule(%L, %L, %L);', 'cleanup_old_notifications', '0 3 * * *', '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') || ';'; END $$;