Closed steve-chavez closed 2 years ago
Btw supabase_functions.hooks
has hooks_response_id_fkey
which depends on net.http_request_queue_pkey
. Can that be handled in a migration?
Some issues with the 0.4 -> 0.5 upgrade script:
ERROR: cannot drop constraint http_request_queue_pkey on table net.http_request_queue because other objects depend on it
DETAIL: constraint _http_response_id_fkey on table net._http_response depends on index net.http_request_queue_pkey
constraint hooks_request_id_fkey on table supabase_functions.hooks depends on index net.http_request_queue_pkey
_check_worker_is_up
rename: return type should be void
instead of trigger
- might need to drop + create the functionERROR: index "_http_response_created_idx" does not exist
ERROR: could not change table "http_request_queue" to unlogged because it references logged table "_http_response"
ERROR: could not change table "http_request_queue" to unlogged because it references logged table "hooks"
Edit: Nevermind, I managed to reproduce it on the dashboard, I'll just add CASCADE to the script.
dropping pkey constraint
Current queue doesn't have a FK
This was removed on https://github.com/supabase/pg_net/commit/8538d83f7e24b4a77d2e7618a22f2070499fe49a#diff-539e81249472b5ef91e28038ee011b645c8885f37ed6679e34d4483e23f4d390L46-R43
Already included on a previous script
How are you testing the upgrade script? I can't reproduce the error
_check_worker_is_up rename: return type should be void instead of trigger - might need to drop + create the function
:white_check_mark:
drop index
Added IF EXISTS
set unlogged
These now work.
I created a new supabase instance(has pg_net 0.2), enabled a webhook and did:
alter extension pg_net update to '0.3';
alter extension pg_net update to '0.4';
alter extension pg_net update to '0.5'; -- had to manually download pg_net--0.4--0.5.sql to /var/lib/postgresql/extension
And all of them ran successfully. Although I had to fix pg_net--0.2--0.3.sql
(included on the latest commit).
It would have been good to have pgtap testing for migrations but doesn't seem worth it for now(not sure what pgx will change).
Small improvements to make pg_net a bit more stable.
Closes https://github.com/supabase/pg_net/issues/61 and https://github.com/supabase/pg_net/issues/44.
Also reducing unnecessary work done by pg_net to address cases where there is high amount of requests - ref(slack link)