supabase cron & multi envs.

What is a good practice to handle .sql migration containing cron schedules? If the same migration have to be executed in multiple environments?

select cron.schedule( 'function-schedule', '0 0 * * *', $$ select net.http_post( url:='PROJECT_SPECIFIC_URL', headers:=jsonb_build_object('Content-Type','application/json', 'Authorization', 'Bearer ' || 'YOUR_ANON_KEY'), body:=jsonb_build_object('time', now() ), timeout_milliseconds:=5000 ) as request_id; $$ );

What is the best way to inject the correct values?
Was this page helpful?