From ab7a4ffc3eb1bf9750f8876a32f29770f6f552eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Thu, 23 May 2019 15:58:39 +0200 Subject: [PATCH] Fix duplicate tags by using the name as the id @ulfgebhardt: I wondered about the list of tags after importing the legacy db. It seems, each tag has at most 1 contribution. I guess it's because we create a unique id for each tag, so two tags with the same `name` e.g. `#hashtag` and `#hashtag` are not de-duplicated. I'm currently sitting in the train and cannot run the data import myself, could you double-check? --- .../maintenance-worker/migration/neo4j/contributions.cql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/legacy-migration/maintenance-worker/migration/neo4j/contributions.cql b/deployment/legacy-migration/maintenance-worker/migration/neo4j/contributions.cql index 01647f7fb..194ba39fd 100644 --- a/deployment/legacy-migration/maintenance-worker/migration/neo4j/contributions.cql +++ b/deployment/legacy-migration/maintenance-worker/migration/neo4j/contributions.cql @@ -20,6 +20,6 @@ MATCH (c:Category {id: categoryId}) MERGE (p)-[:CATEGORIZED]->(c) WITH p, post.tags AS tags UNWIND tags AS tag -MERGE (t:Tag {id: apoc.create.uuid(), name: tag}) +MERGE (t:Tag {id: tag, name: tag}) MERGE (p)-[:TAGGED]->(t) ;