Skip to content

fix(db): repair Supabase Preview migration replay failures#305

Merged
BigSimmo merged 3 commits into
mainfrom
cursor/fix-supabase-preview-migration-7890
Jul 6, 2026
Merged

fix(db): repair Supabase Preview migration replay failures#305
BigSimmo merged 3 commits into
mainfrom
cursor/fix-supabase-preview-migration-7890

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes failing Supabase Preview checks caused by two migration replay issues.

1. match_document_chunks_text return type change (SQLSTATE 42P13)

PostgreSQL rejects CREATE OR REPLACE when OUT columns differ from the live database. Added the same DROP FUNCTION IF EXISTS guard used in phase-7 migrations before recreating match_document_chunks_text.

2. Promote migration references non-existent updated_at columns (SQLSTATE 42703)

20260706120000_promote_remaining_indexed_documents_public.sql (merged via #294) attempted to set updated_at on document_table_facts and document_embedding_fields, which only have created_at. Removed the invalid column updates.

Changes

  • supabase/migrations/20260705210000_retrieval_owner_filter_sentinel.sql — drop before recreate
  • supabase/migrations/20260706120000_promote_remaining_indexed_documents_public.sql — omit updated_at on tables without it
  • supabase/schema.sql — drop before recreate
  • tests/supabase-schema.test.ts — replay guard test

Verification

  • npm run verify:cheap — pass
  • npm run test -- tests/supabase-schema.test.ts — pass
Open in Web Open in Cursor 

…nel rewrite

Supabase Preview branches fail with SQLSTATE 42P13 when this migration
attempts CREATE OR REPLACE on a function whose OUT signature differs
from the live database. Drop first, matching the phase-7 migration pattern.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@supabase

supabase Bot commented Jul 5, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy due to reaching the limit of concurrent preview branches.
Go to Project Integrations Settings ↗︎ if you wish to update this limit.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@cursor cursor Bot changed the title fix(db): drop match_document_chunks_text before retrieval owner sentinel rewrite fix(db): repair Supabase Preview migration replay failures Jul 5, 2026
…lumn

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@BigSimmo
BigSimmo marked this pull request as ready for review July 5, 2026 23:50
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@BigSimmo
BigSimmo merged commit 4adb6f0 into main Jul 6, 2026
6 checks passed
@BigSimmo
BigSimmo deleted the cursor/fix-supabase-preview-migration-7890 branch July 8, 2026 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants