|
|
@ -124,15 +124,17 @@
|
|
|
|
(neo4j/exec-query! delete {:uuid uuid}))
|
|
|
|
(neo4j/exec-query! delete {:uuid uuid}))
|
|
|
|
|
|
|
|
|
|
|
|
(neo4j/defquery create-link
|
|
|
|
(neo4j/defquery create-link
|
|
|
|
"MATCH (i:instance {uuid:{instance_uuid}}),
|
|
|
|
"MATCH (i:instance {uuid:{from}}),
|
|
|
|
(i2)
|
|
|
|
(u:user {uuid:{by}}),
|
|
|
|
WHERE i2.uuid IN {instance_uuids}
|
|
|
|
(t:instance)
|
|
|
|
CREATE (i)-[:link {name:{name},
|
|
|
|
WHERE t.uuid IN {to}
|
|
|
|
created_at:{created_at}}]->(i2)")
|
|
|
|
CREATE (l:link {uuid:{uuid}})-[:created_by]->(u)
|
|
|
|
|
|
|
|
SET l.created_at = {created_at},
|
|
|
|
(defn create-link! [instance-uuid name instance-uuids]
|
|
|
|
l.name = {name}
|
|
|
|
|
|
|
|
CREATE (i)<-[:link_from]-(l)-[:link_to]->(t)")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defn create-link! [link]
|
|
|
|
(neo4j/exec-query! create-link
|
|
|
|
(neo4j/exec-query! create-link
|
|
|
|
{:instance_uuid instance-uuid
|
|
|
|
(assoc link
|
|
|
|
:name name
|
|
|
|
:uuid (neo4j/uuid)
|
|
|
|
:created_at (neo4j/now-str)
|
|
|
|
:created_at (neo4j/now-str))))
|
|
|
|
:instance_uuids instance-uuids}))
|
|
|
|
|
|
|
|