Skip to content

Commit 013d6d0

Browse files
committed
feat: demo - prepare final deployment
1 parent c7577a4 commit 013d6d0

File tree

9 files changed

+34
-159
lines changed

9 files changed

+34
-159
lines changed

apps/demo/supabase/config.toml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -348,17 +348,6 @@ s3_access_key = "env(S3_ACCESS_KEY)"
348348
# Configures AWS_SECRET_ACCESS_KEY for S3 bucket
349349
s3_secret_key = "env(S3_SECRET_KEY)"
350350

351-
[functions.test_flow_worker]
352-
enabled = true
353-
verify_jwt = false
354-
import_map = "./functions/test_flow_worker/deno.json"
355-
# Uncomment to specify a custom file path to the entrypoint.
356-
# Supported file extensions are: .ts, .js, .mjs, .jsx, .tsx
357-
entrypoint = "./functions/test_flow_worker/index.ts"
358-
# Specifies static files to be bundled with the function. Supports glob patterns.
359-
# For example, if you want to serve static HTML pages in your function:
360-
# static_files = [ "./functions/test_flow_worker/*.html" ]
361-
362351
[functions.article_flow_worker]
363352
enabled = true
364353
verify_jwt = false

apps/demo/supabase/functions/test_flow_worker/.npmrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

apps/demo/supabase/functions/test_flow_worker/deno.json

Lines changed: 0 additions & 15 deletions
This file was deleted.

apps/demo/supabase/functions/test_flow_worker/deno.lock

Lines changed: 0 additions & 118 deletions
This file was deleted.

apps/demo/supabase/functions/test_flow_worker/index.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

apps/demo/supabase/functions/test_flow_worker/test_flow.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

apps/demo/supabase/migrations/20251031133804_demo_anon_permissions.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ GRANT SELECT ON pgflow.flows TO anon;
77
GRANT SELECT ON pgflow.runs TO anon;
88
GRANT SELECT ON pgflow.steps TO anon;
99
GRANT SELECT ON pgflow.step_states TO anon;
10+
GRANT SELECT ON pgflow.step_tasks TO anon;
1011
GRANT SELECT ON pgflow.deps TO anon;
12+
GRANT SELECT ON pgflow.workers TO anon;
1113

1214
-- Enable real-time for anon role
1315
ALTER PUBLICATION supabase_realtime ADD TABLE pgflow.runs;

apps/demo/supabase/migrations/20251031142456_create_test_flow_flow.sql

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
-- Cleanup any orphaned pgmq queues from incomplete resets
2+
-- This ensures a clean slate before flow migrations run
3+
4+
DO $$
5+
DECLARE
6+
queue_record RECORD;
7+
BEGIN
8+
-- Drop any existing queues that might be orphaned
9+
-- This handles the case where DROP EXTENSION pgmq didn't cascade properly
10+
FOR queue_record IN
11+
SELECT queue_name
12+
FROM pgmq.list_queues()
13+
LOOP
14+
-- Use pgmq's built-in drop function to safely remove the queue
15+
PERFORM pgmq.drop_queue(queue_record.queue_name);
16+
17+
RAISE NOTICE 'Dropped orphaned queue: %', queue_record.queue_name;
18+
END LOOP;
19+
20+
-- Also drop any orphaned sequences that might exist without tables
21+
FOR queue_record IN
22+
SELECT sequence_name
23+
FROM information_schema.sequences
24+
WHERE sequence_schema = 'pgmq'
25+
AND sequence_name LIKE 'q_%_msg_id_seq'
26+
LOOP
27+
EXECUTE format('DROP SEQUENCE IF EXISTS pgmq.%I CASCADE', queue_record.sequence_name);
28+
29+
RAISE NOTICE 'Dropped orphaned sequence: %', queue_record.sequence_name;
30+
END LOOP;
31+
32+
END $$;

0 commit comments

Comments
 (0)