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?
This commit is contained in:
Robert Schäfer 2019-05-23 15:58:39 +02:00 committed by Ulf Gebhardt
parent 8a9d826e46
commit ab7a4ffc3e
No known key found for this signature in database
GPG Key ID: 44C888923CC8E7F3

View File

@ -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)
;