From 0fa48d3fc18abae773b043990bf9dcf8fbb80108 Mon Sep 17 00:00:00 2001 From: dextmorgn Date: Sun, 15 Feb 2026 18:08:59 +0100 Subject: [PATCH] feat(migrations): backfill_edge_sketch_id --- neo4j-migrations/004_backfill_edge_sketch_id.cypher | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 neo4j-migrations/004_backfill_edge_sketch_id.cypher diff --git a/neo4j-migrations/004_backfill_edge_sketch_id.cypher b/neo4j-migrations/004_backfill_edge_sketch_id.cypher new file mode 100644 index 0000000..2277e85 --- /dev/null +++ b/neo4j-migrations/004_backfill_edge_sketch_id.cypher @@ -0,0 +1,8 @@ +// 004_backfill_edge_sketch_id.cypher +// Backfill sketch_id on relationships that are missing it. +// Copies sketch_id from the source node onto the relationship. +// Idempotent: only touches relationships where sketch_id IS NULL. + +MATCH (a)-[r]->(b) +WHERE r.sketch_id IS NULL AND a.sketch_id IS NOT NULL +SET r.sketch_id = a.sketch_id;