From 32388549a00c13f1af6a4f8db5cc5b342b8b51a7 Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Wed, 4 Sep 2019 16:24:48 +0200 Subject: [PATCH] Revert use of variables in cql file - breaks the import functionality --- .../migration/neo4j/contributions/contributions.cql | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/deployment/legacy-migration/maintenance-worker/migration/neo4j/contributions/contributions.cql b/deployment/legacy-migration/maintenance-worker/migration/neo4j/contributions/contributions.cql index 8207b5a97..f09b5ad71 100644 --- a/deployment/legacy-migration/maintenance-worker/migration/neo4j/contributions/contributions.cql +++ b/deployment/legacy-migration/maintenance-worker/migration/neo4j/contributions/contributions.cql @@ -147,10 +147,8 @@ MATCH (c:Category {id: categoryId}) MERGE (p)-[:CATEGORIZED]->(c) WITH p, post.tags AS tags UNWIND tags AS tag -WITH '[^\\p{L}0-9]' as regexMatchAllNonUnicodeLettersOrDigits -WITH apoc.text.replace(tag, regexMatchAllNonUnicodeLettersOrDigits, '') as tagNoSpacesAllowed -WITH '^((\\p{L}+[\\p{L}0-9]*)|([0-9]+\\p{L}+[\\p{L}0-9]*))$' as regexHashtagMustIncludeOnlyUnicodeLettersOrDigitsButNotOnlyDigits -CALL apoc.when(tagNoSpacesAllowed =~ regexHashtagMustIncludeOnlyUnicodeLettersOrDigitsButNotOnlyDigits, 'RETURN tagNoSpacesAllowed', '', {tagNoSpacesAllowed: tagNoSpacesAllowed}) +WITH apoc.text.replace(tag, '[^\\p{L}0-9]', '') as tagNoSpacesAllowed +CALL apoc.when(tagNoSpacesAllowed =~ '^((\\p{L}+[\\p{L}0-9]*)|([0-9]+\\p{L}+[\\p{L}0-9]*))$', 'RETURN tagNoSpacesAllowed', '', {tagNoSpacesAllowed: tagNoSpacesAllowed}) YIELD value as validated WHERE validated.tagNoSpacesAllowed IS NOT NULL MERGE (t:Tag { id: validated.tagNoSpacesAllowed, disabled: false, deleted: false })