Fix user mention menu on production data

Apparently some of our users in production have no slug, this will
assign an (hopefully unique) random slug to them.
This commit is contained in:
roschaefer 2019-08-15 21:07:23 +02:00
parent 2cb8719d5f
commit d3b256e99e

View File

@ -94,12 +94,11 @@
}
}
*/
CALL apoc.load.json("file:${IMPORT_CHUNK_PATH_CQL_FILE}") YIELD value as user
MERGE(u:User {id: user._id["$oid"]})
ON CREATE SET
u.name = user.name,
u.slug = user.slug,
u.slug = COALESCE(user.slug, apoc.text.random(20, "[A-Za-z]")),
u.email = user.email,
u.encryptedPassword = user.password,
u.avatar = replace(user.avatar, 'https://api-alpha.human-connection.org', ''),