-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-cron.sql
More file actions
20 lines (20 loc) · 848 Bytes
/
Copy pathsetup-cron.sql
File metadata and controls
20 lines (20 loc) · 848 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
-- One-time setup for Supabase Cron → sync-schedule Edge Function.
-- Run in the Supabase SQL editor AFTER deploying the Edge Function.
--
-- 1. Deploy the function:
-- supabase functions deploy sync-schedule
--
-- 2. Store project URL and service role key in Vault (replace placeholders):
--
-- select vault.create_secret('https://YOUR_PROJECT_REF.supabase.co', 'project_url');
-- select vault.create_secret('YOUR_SERVICE_ROLE_KEY', 'service_role_key');
--
-- 3. Apply the cron migration (or run supabase db push):
-- supabase db push
--
-- 4. Verify in Dashboard → Integrations → Cron, or:
-- select * from cron.job where jobname = 'sync-mlb-schedule';
--
-- Manual trigger:
-- curl -X POST "https://YOUR_PROJECT_REF.supabase.co/functions/v1/sync-schedule" \
-- -H "Authorization: Bearer YOUR_SERVICE_ROLE_KEY"