mirror of
https://github.com/Steffo99/unimore-bda-4.git
synced 2024-11-23 16:34:24 +00:00
11 lines
448 B
Text
11 lines
448 B
Text
|
MATCH (:User)-[owns:OWNS]->(:Crate)
|
||
|
DELETE owns;
|
||
|
|
||
|
LOAD CSV WITH HEADERS FROM "file:///crate_owners.csv" AS line FIELDTERMINATOR ","
|
||
|
MATCH (crate:Crate { id: toInteger(line.crate_id) })
|
||
|
MATCH (owner:User { id: toInteger(line.owner_id) })
|
||
|
CREATE (owner)-[ownership:OWNS {
|
||
|
created_at: apoc.date.parse(line.created_at, "ms", "yyyy-MM-dd HH:mm:ss"),
|
||
|
created_by: toInteger(line.created_by),
|
||
|
owner_kind: toInteger(line.owner_kind)
|
||
|
}]->(crate);
|