Skip to content

Commit

Permalink
Update migrate.cypher (#751)
Browse files Browse the repository at this point in the history
  • Loading branch information
ao508 authored Aug 3, 2022
1 parent fc3aa01 commit 08c6f90
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions scripts/migrate.cypher
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,12 @@ SET s.smileSampleId = s.metaDbSampleId
REMOVE s.metaDbSampleId
RETURN true;


// populate research samples with additionalProperties = {"igoRequestId": [requestId], "isCmoSample": [isCmoRequest]}
MATCH (sm: SampleMetadata {additionalProperties: "{}"})<-[:HAS_METADATA]-(s: Sample)<-[:HAS_SAMPLE]-(r: Request)
MATCH (sm: SampleMetadata)<-[:HAS_METADATA]-(s: Sample {sampleCategory: "research"})<-[:HAS_SAMPLE]-(r: Request)
CALL {
WITH r
MATCH (sm2: SampleMetadata {additionalProperties: "{}"})<-[:HAS_METADATA]-(s2:Sample)<-[:HAS_SAMPLE]-(r)
RETURN "{\"igoRequestId\": " + r.igoRequestId + ", \"isCmoSample\": " + r.isCmoRequest + "}" as additionalProperties
MATCH (sm2: SampleMetadata)<-[:HAS_METADATA]-(s2:Sample)<-[:HAS_SAMPLE]-(r)
RETURN "{\"igoRequestId\": \"" + r.igoRequestId + "\", \"isCmoSample\": \"" + r.isCmoRequest + "\"}" as additionalProperties
}
SET sm.additionalProperties = additionalProperties
RETURN true

0 comments on commit 08c6f90

Please sign in to comment.