004_backfill_edge_sketch_id.cypher 334 B

12345678
  1. // 004_backfill_edge_sketch_id.cypher
  2. // Backfill sketch_id on relationships that are missing it.
  3. // Copies sketch_id from the source node onto the relationship.
  4. // Idempotent: only touches relationships where sketch_id IS NULL.
  5. MATCH (a)-[r]->(b)
  6. WHERE r.sketch_id IS NULL AND a.sketch_id IS NOT NULL
  7. SET r.sketch_id = a.sketch_id;