mirror of
https://github.com/pezkuwichain/pezkuwi-telegram-miniapp.git
synced 2026-04-22 03:07:55 +00:00
19 lines
539 B
SQL
19 lines
539 B
SQL
-- Enable pg_cron extension (if not already enabled)
|
|
CREATE EXTENSION IF NOT EXISTS pg_cron;
|
|
|
|
-- Schedule deposit check every 1 minute
|
|
SELECT cron.schedule(
|
|
'check-deposits-job',
|
|
'* * * * *', -- Every minute
|
|
$$
|
|
SELECT net.http_post(
|
|
url := current_setting('app.settings.supabase_url') || '/functions/v1/check-deposits',
|
|
headers := jsonb_build_object(
|
|
'Authorization', 'Bearer ' || current_setting('app.settings.service_role_key'),
|
|
'Content-Type', 'application/json'
|
|
),
|
|
body := '{}'::jsonb
|
|
);
|
|
$$
|
|
);
|