fix(db): qualify cross-function calls in search migration#66
Merged
Conversation
Both page_search_vector and search_pages call extract_text_from_lexical without schema qualification. With set search_path = '' (empty), PostgreSQL cannot resolve the function, causing every Deploy Migrations run to fail since PR #53 was merged. Prefix calls with public. so they resolve under an empty search path. Co-authored-by: Ona <no-reply@ona.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Collaborator
Author
|
✅ UI verification skipped — no UI files changed (only |
Collaborator
Author
|
✅ Post-merge verification passed. Routes tested:
Skipped: None — all routes exist and passed. |
zacharias-ona
added a commit
that referenced
this pull request
Apr 15, 2026
PR #66 qualified cross-function calls with public. but the CREATE FUNCTION statements themselves had no schema prefix. On Supabase hosted projects the migration runner's search_path may not default to public, so the functions were created in the wrong schema while the qualified calls pointed at public — where nothing existed. Prefix all CREATE FUNCTION, ALTER TABLE, and CREATE INDEX statements with public. so the migration is fully schema-explicit and independent of the session's search_path. Co-authored-by: Ona <no-reply@ona.com>
This was referenced Apr 15, 2026
zacharias-ona
added a commit
that referenced
this pull request
Apr 15, 2026
PR #66 qualified cross-function calls with public. but the CREATE FUNCTION statements themselves had no schema prefix. On Supabase hosted projects the migration runner's search_path may not default to public, so the functions were created in the wrong schema while the qualified calls pointed at public — where nothing existed. Prefix all CREATE FUNCTION, ALTER TABLE, and CREATE INDEX statements with public. so the migration is fully schema-explicit and independent of the session's search_path. Co-authored-by: Ona <no-reply@ona.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Deploy Migrations workflow has failed on every push to
mainsince PR #53 was merged — 4 consecutive failures, all with:The search migration (
20260415111351_add_page_search_vector.sql) has never been applied to production.Root Cause
Both
page_search_vectorandsearch_pagesfunctions useset search_path = ''(a Supabase security best practice), but callextract_text_from_lexical(content)without schema qualification. With an empty search path, PostgreSQL cannot resolve the unqualified function name.The PR dry-run passed because
supabase db push --dry-runonly checks which migrations are pending — it doesn't execute the SQL.Fix
Prefix cross-function calls with
public.so they resolve correctly under an empty search path. Self-recursive calls withinextract_text_from_lexicalare unaffected (a function's own name is always resolvable during execution).Closes #53's deployment gap — no new issue created since this is a direct fix for the broken migration.