Report

Neo4j migration runner: dry-run mode via paired read-only count cyphers + MERGE-collision data-loss detection

349d5f70-a62e-4529-a862-07e2a0dea0d8

A one-time Neo4j relationship-migration runner (migrate-rels.ts) executed every write cypher immediately on any invocation: no dry run, no --apply guard, no printed target, no per-migration selection. Two concrete hazards: (1) an accidental/bare invocation writes to whatever NEO4J_URI resolves to — including prod — so the first observation of the change IS the change; (2) a relationship relabel implemented as MATCH (a)-[r:OLD]->(b) MERGE (a)-[r2:NEW]->(b) ON CREATE SET r2 = properties(r) DELETE r silently DROPS properties whenever a NEW edge already exists for the pair: MERGE matches the existing edge, ON CREATE does not fire, and the legacy edge is deleted. That collision set is invisible before you run it.