Skip to content

Commit d553c07

Browse files
authored
Fix critical migration error (#105)
* chore: improve schema creation and extension setup in migration script - Added IF NOT EXISTS checks for pgmq schema and extension to ensure idempotency - Updated function creation script for better stability - Modified migration checksum file for consistency * fix: resolve critical migration error preventing installation with previous PGMQ setup Add new changeset to patch '@pgflow/core' and fix migration issue that blocked installation if PGMQ was previously installed
1 parent 3f3174e commit d553c07

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

.changeset/silver-candles-pay.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@pgflow/core': patch
3+
---
4+
5+
Fix critical migration error that prevented installing if PGMQ was installed previously

pkgs/core/supabase/migrations/20250429164909_pgflow_initial.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
-- Add new schema named "pgflow"
22
CREATE SCHEMA "pgflow";
33
-- Add new schema named "pgmq"
4-
CREATE SCHEMA "pgmq";
4+
CREATE SCHEMA IF NOT EXISTS "pgmq";
55
-- Create extension "pgmq"
6-
CREATE EXTENSION "pgmq" WITH SCHEMA "pgmq" VERSION "1.4.4";
6+
CREATE EXTENSION IF NOT EXISTS "pgmq" WITH SCHEMA "pgmq" VERSION "1.4.4";
77
-- Create "read_with_poll" function
88
CREATE FUNCTION "pgflow"."read_with_poll" ("queue_name" text, "vt" integer, "qty" integer, "max_poll_seconds" integer DEFAULT 5, "poll_interval_ms" integer DEFAULT 100, "conditional" jsonb DEFAULT '{}') RETURNS SETOF pgmq.message_record LANGUAGE plpgsql AS $$
99
DECLARE
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
h1:TRBa/BGqiMOCuEzWfl7rP3KeF6wTF8UNWi+OyQ04Uoo=
2-
20250429164909_pgflow_initial.sql h1:J2retI/QcfsNCP9TVak7J+lxGrtfKNzJTPy6RAGgmco=
1+
h1:5sJG/Yil5GcUJAlskLtmre1qrjjUGcdEHZ2MNdsYrtE=
2+
20250429164909_pgflow_initial.sql h1:5K7OqB/vj73TWJTQquUzn+i6H2wWduaW+Ir1an3QYmQ=

0 commit comments

Comments
 (0)