feat(MED-105): organize env specific required migrations
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
-- Enable required extensions for cron jobs and HTTP requests
|
||||
create extension if not exists pg_cron;
|
||||
create extension if not exists pg_net;
|
||||
@@ -1,5 +1,3 @@
|
||||
create extension if not exists pg_net;
|
||||
|
||||
create or replace function medreport.medipost_retry_dispatch(
|
||||
order_id text
|
||||
)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
-- Parameters order_id
|
||||
CREATE OR REPLACE FUNCTION medreport.send_medipost_test_response_for_order(medusa_order_id text)
|
||||
RETURNS void
|
||||
LANGUAGE plpgsql
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
-- Schedule the test-medipost-responses job to run every 15 minutes
|
||||
select
|
||||
cron.schedule(
|
||||
'send-test-medipost-responses-every-15-minutes',
|
||||
'*/15 * * * *',
|
||||
$$
|
||||
select
|
||||
net.http_post(
|
||||
url := 'https://test.medreport.ee/api/job/test-medipost-responses',
|
||||
headers := jsonb_build_object(
|
||||
'x-jobs-api-key', 'fd26ec26-70ed-11f0-9e95-431ac3b15a84'
|
||||
)
|
||||
) as request_id;
|
||||
$$
|
||||
);
|
||||
@@ -0,0 +1,15 @@
|
||||
-- Schedule the sync-analysis-results job to run every 15 minutes
|
||||
select
|
||||
cron.schedule(
|
||||
'sync-analysis-results-every-15-minutes', -- Unique job name
|
||||
'*/15 * * * *', -- Cron schedule: every 15 minutes
|
||||
$$
|
||||
select
|
||||
net.http_post(
|
||||
url := 'https://test.medreport.ee/api/job/sync-analysis-results',
|
||||
headers := jsonb_build_object(
|
||||
'x-jobs-api-key', 'fd26ec26-70ed-11f0-9e95-431ac3b15a84'
|
||||
)
|
||||
) as request_id;
|
||||
$$
|
||||
);
|
||||
4
supabase/migrations-env-specific/README.md
Normal file
4
supabase/migrations-env-specific/README.md
Normal file
@@ -0,0 +1,4 @@
|
||||
Migrations that require env specific parameters.
|
||||
|
||||
- JOBS_API_TOKEN
|
||||
- app deploy public or internal URL
|
||||
Reference in New Issue
Block a user