From d5e1a67e0cb27cef670b849e748d2db290ecc3bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Fri, 11 Oct 2019 17:33:04 +0200 Subject: [PATCH] Manipulate database to replace report node with direct REPORTED relation --- .../20191011_changeReportNodeToRelationOnly.cql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 deployment/legacy-migration/maintenance-worker/migration/neo4j/dbManipulations/20191011_changeReportNodeToRelationOnly.cql diff --git a/deployment/legacy-migration/maintenance-worker/migration/neo4j/dbManipulations/20191011_changeReportNodeToRelationOnly.cql b/deployment/legacy-migration/maintenance-worker/migration/neo4j/dbManipulations/20191011_changeReportNodeToRelationOnly.cql new file mode 100644 index 000000000..8c32cf5ec --- /dev/null +++ b/deployment/legacy-migration/maintenance-worker/migration/neo4j/dbManipulations/20191011_changeReportNodeToRelationOnly.cql @@ -0,0 +1,7 @@ +MATCH (submitter:User)-[:REPORTED]->(report:Report)-[:REPORTED]->(resource) +DETACH DELETE report +CREATE (submitter)-[reported:REPORTED]->(resource) +SET reported.createdAt = toString(datetime()) +SET reported.reasonCategory = 'other' +SET reported.reasonDescription = '!!! Created automatically to ensure database consistency! Date-time is this creation date and time.' +RETURN reported \ No newline at end of file