ENG-2164 Correct is_relation migration, strike 2 - #1326
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Updates to Preview Branch (eng-2164-correct-is_relation-migration-strike-2) ↗︎
Tasks are run on every commit but only new migration files are pushed.
View logs for this Workflow Run ↗︎. |
| 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; |
There was a problem hiding this comment.
🔴 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.
| 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; |
Was this helpful? React with 👍 or 👎 to provide feedback.
https://linear.app/discourse-graphs/issue/ENG-2164/correct-is-relation-migration-strike-2
same loom as last time