From 67d8897c95cb29cbe34c04e7b910eed3eca33eed Mon Sep 17 00:00:00 2001 From: dbastrikin Date: Mon, 16 Mar 2026 11:42:22 +0200 Subject: [PATCH] fix: wrap uuid_generate_v7 function in goose StatementBegin/End goose splits SQL on semicolons and misinterprets dollar-quoted strings ($$...$$) as statement boundaries, causing a parse error on the PL/pgSQL function body. StatementBegin/End annotations tell goose to treat the block as a single statement. Co-Authored-By: Claude Sonnet 4.6 --- backend/migrations/001_initial_schema.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/migrations/001_initial_schema.sql b/backend/migrations/001_initial_schema.sql index 9468485..94ef651 100644 --- a/backend/migrations/001_initial_schema.sql +++ b/backend/migrations/001_initial_schema.sql @@ -10,6 +10,7 @@ CREATE EXTENSION IF NOT EXISTS pg_trgm; -- UUID v7 generator (time-ordered, millisecond precision). -- Structure: 48-bit unix_ts_ms | 4-bit version (0111) | 12-bit rand_a | 2-bit variant (10) | 62-bit rand_b -- --------------------------------------------------------------------------- +-- +goose StatementBegin CREATE OR REPLACE FUNCTION uuid_generate_v7() RETURNS uuid AS $$ @@ -38,6 +39,7 @@ BEGIN RETURN encode(uuid_bytes, 'hex')::uuid; END $$ LANGUAGE plpgsql VOLATILE; +-- +goose StatementEnd -- --------------------------------------------------------------------------- -- Enums