[schemas] Fix invalid || concatenation in typed-reasoning-edges COMMENT#227
Open
spiritualsystems wants to merge 1 commit intoNateBJones-Projects:mainfrom
Conversation
PostgreSQL does not accept `||` string concatenation inside a `COMMENT ON ... IS <literal>` expression; the RHS must be a single string literal. As written, `supabase db push` fails with SQLSTATE 42601 (syntax error at or near "||") and rolls back the whole migration. Flatten the three concatenated strings into one. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Hey @spiritualsystems — welcome to Open Brain Source! 👋 Thanks for submitting your first PR. The automated review will run shortly and check things like metadata, folder structure, and README completeness. If anything needs fixing, the review comment will tell you exactly what. Once the automated checks pass, a human admin will review for quality and clarity. Expect a response within a few days. If you have questions, check out CONTRIBUTING.md or open an issue. |
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.
Contribution Type
/schemas)/recipes)/dashboards)/integrations)/skills)What does this do?
Fixes a SQL syntax error in
schemas/typed-reasoning-edges/schema.sql(introduced in #208) that prevents the migration from applying. TheCOMMENT ON FUNCTION public.thought_edges_upsert IS ...statement uses||string concatenation across three adjacent string literals, but PostgreSQL requires the right-hand side ofCOMMENT ON ... ISto be a single string literal — not an expression. Flattens the three pieces into one literal. No functional change to the function itself.Bug
At schemas/typed-reasoning-edges/schema.sql#L257-L260:
Per the Postgres grammar for
COMMENT,IStakes atextliteral, not a general expression — concatenation operators aren't parsed here. None of the otherCOMMENT ONsites in this file have the issue; this is the only affected statement.Reproduce
From a clean Supabase project with the rest of Open Brain applied:
# Stage this schema as a migration and push supabase db pushResult on
main:The transaction rolls back and none of the typed-reasoning-edges objects (
thought_edgestable,thought_edges_upsertRPC, entity-edge temporal columns) get created.Fix
Collapse the three concatenated literals into one. The surrounding code is untouched; other
COMMENT ONlines in the file are not reformatted.Requirements
None beyond what #208 already requires (Supabase with pgvector). No new dependencies.
Checklist
supabase db pushon my own Open Brain instance — migration now completes without rollbackschemas/typed-reasoning-edges/), so no newREADME.md/metadata.jsonrequiredCo-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com