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 98d8f24e9..a0cb6e8e8 100644 --- a/deployment/legacy-migration/maintenance-worker/migration/neo4j/contributions/contributions.cql +++ b/deployment/legacy-migration/maintenance-worker/migration/neo4j/contributions/contributions.cql @@ -109,8 +109,8 @@ } } }, -[?] deleted: { -[X] type: Boolean, +[?] deleted: { // THis field is not always present in the alpha-data +[?] type: Boolean, [ ] default: false, // Default value is missing in Nitro [-] index: true }, @@ -137,7 +137,7 @@ p.contentExcerpt = post.contentExcerpt, p.visibility = toLower(post.visibility), p.createdAt = post.createdAt.`$date`, p.updatedAt = post.updatedAt.`$date`, -p.deleted = post.deleted, +p.deleted = COALESCE(post.deleted,false), p.disabled = NOT post.isEnabled WITH p, post MATCH (u:User {id: post.userId}) diff --git a/deployment/legacy-migration/maintenance-worker/migration/neo4j/import.sh b/deployment/legacy-migration/maintenance-worker/migration/neo4j/import.sh index 3b87601d2..8eef68c92 100755 --- a/deployment/legacy-migration/maintenance-worker/migration/neo4j/import.sh +++ b/deployment/legacy-migration/maintenance-worker/migration/neo4j/import.sh @@ -9,10 +9,10 @@ set +o allexport # Delete collection function defintion function delete_collection () { # Delete from Database - echo "Delete $1" + echo "Delete $2" "${IMPORT_CYPHERSHELL_BIN}" < $(dirname "$0")/$1/delete.cql > /dev/null # Delete index file - rm -f "${IMPORT_PATH}splits/$1.index" + rm -f "${IMPORT_PATH}splits/$2.index" } # Import collection function defintion @@ -52,13 +52,14 @@ SECONDS=0 # Delete all Neo4J Database content echo "Deleting Database Contents" -delete_collection "badges" -delete_collection "categories" -delete_collection "users" -delete_collection "follows" -delete_collection "contributions" -delete_collection "shouts" -delete_collection "comments" +delete_collection "badges" "badges" +delete_collection "categories" "categories" +delete_collection "users" "users" +delete_collection "follows" "follows_users" +delete_collection "contributions" "contributions_post" +delete_collection "contributions" "contributions_cando" +delete_collection "shouts" "shouts" +delete_collection "comments" "comments" #delete_collection "emotions" #delete_collection "invites"