Skip to content

ENG-2164 Correct is_relation migration, strike 2 - #1326

Merged
maparent merged 1 commit into
mainfrom
eng-2164-correct-is_relation-migration-strike-2
Aug 21, 2026
Merged

ENG-2164 Correct is_relation migration, strike 2#1326
maparent merged 1 commit into
mainfrom
eng-2164-correct-is_relation-migration-strike-2

Conversation

@maparent

@maparent maparent commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

@linear-code

linear-code Bot commented Aug 21, 2026

Copy link
Copy Markdown

ENG-2164

@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
discourse-graph Ready Ready Preview Aug 21, 2026 5:00pm

Request Review

@supabase

supabase Bot commented Aug 21, 2026

Copy link
Copy Markdown

Updates to Preview Branch (eng-2164-correct-is_relation-migration-strike-2) ↗︎

Deployments Status Updated
Database Fri, 21 Aug 2026 16:58:39 UTC
Services Fri, 21 Aug 2026 16:58:39 UTC
APIs Fri, 21 Aug 2026 16:58:39 UTC

Tasks are run on every commit but only new migration files are pushed.
Close and reopen this PR if you want to apply changes from existing seed or migration files.

Tasks Status Updated
Configurations Fri, 21 Aug 2026 16:58:45 UTC
Migrations Fri, 21 Aug 2026 16:58:48 UTC
Seeding Fri, 21 Aug 2026 16:58:51 UTC
Edge Functions Fri, 21 Aug 2026 16:58:53 UTC

View logs for this Workflow Run ↗︎.
Learn more about Supabase for Git ↗︎.

@maparent
maparent requested a review from mdroidian August 21, 2026 16:58

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Open in Devin Review

UPDATE public."Concept" SET is_relation=public.compute_is_relation_local(null::BIGINT, literal_content) WHERE is_schema;
-- do schemas first, so their values are correct for next step
UPDATE public."Concept" SET is_relation=public.compute_is_relation_local(null::BIGINT, literal_content) WHERE schema_id IS NULL;
UPDATE public."Concept" SET is_relation=public.compute_is_relation_local(null::BIGINT, literal_content) WHERE schema_id IS NOT NULL;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Relation instances backfilled as non-relations

The second backfill statement targets instance concepts (schema_id IS NOT NULL) but calls compute_is_relation_local(null::BIGINT, ...), so each instance is judged by its own content instead of its schema's roles. Instances have no roles of their own, so every relation instance is stored as false, disagreeing with the trigger that derives the value from NEW.schema_id.

Suggested change
UPDATE public."Concept" SET is_relation=public.compute_is_relation_local(null::BIGINT, literal_content) WHERE schema_id IS NOT NULL;
UPDATE public."Concept" SET is_relation=public.compute_is_relation_local(schema_id, literal_content) WHERE schema_id IS NOT NULL;
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@maparent
maparent merged commit f133885 into main Aug 21, 2026
10 checks passed
@maparent
maparent deleted the eng-2164-correct-is_relation-migration-strike-2 branch August 21, 2026 20:31
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