delete cql files

This commit is contained in:
Ulf Gebhardt 2019-05-29 17:30:46 +02:00
parent 816fbdf7cd
commit 968578f10a
No known key found for this signature in database
GPG Key ID: 44C888923CC8E7F3
8 changed files with 34 additions and 1 deletions

View File

@ -0,0 +1 @@
MATCH (n:Badge) DETACH DELETE n;

View File

@ -0,0 +1 @@
MATCH (n:Category) DETACH DELETE n;

View File

@ -0,0 +1 @@
MATCH (n:Comment) DETACH DELETE n;

View File

@ -0,0 +1,2 @@
MATCH (n:Post) DETACH DELETE n;
MATCH (n:Tag) DETACH DELETE n;

View File

@ -0,0 +1 @@
// this is just a relation between users(?) - no need to delete

View File

@ -6,6 +6,12 @@ set -o allexport
source $(dirname "$0")/.env
set +o allexport
# Delete collection function defintion
function delete_collection () {
echo "Delete $1"
"${IMPORT_CYPHERSHELL_BIN}" -u ${NEO4J_USERNAME} -p ${NEO4J_PASSWORD} < $(dirname "$0")/$1_delete.cql > /dev/null
}
# Import collection function defintion
function import_collection () {
for chunk in ${IMPORT_PATH}splits/$1/*
@ -22,7 +28,25 @@ SECONDS=0
# Delete all Neo4J Database content
echo "Deleting Database Contents"
"${IMPORT_CYPHERSHELL_BIN}" -u ${NEO4J_USERNAME} -p ${NEO4J_PASSWORD} < $(dirname "$0")/_delete_all.cql > /dev/null
delete_collection "badges"
delete_collection "categories"
delete_collection "users"
delete_collection "follows"
delete_collection "contributions"
delete_collection "shouts"
delete_collection "comments"
#delete_collection "emotions"
#delete_collection "invites"
#delete_collection "notifications"
#delete_collection "organizations"
#delete_collection "pages"
#delete_collection "projects"
#delete_collection "settings"
#delete_collection "status"
#delete_collection "systemnotifications"
#delete_collection "userscandos"
#delete_collection "usersettings"
echo "DONE"
# Import Data
@ -34,6 +58,7 @@ import_collection "follows"
import_collection "contributions"
import_collection "shouts"
import_collection "comments"
#import_collection "emotions"
#import_collection "invites"
#import_collection "notifications"

View File

@ -0,0 +1 @@
// this is just a relation between users and contributions - no need to delete

View File

@ -0,0 +1 @@
MATCH (n:User) DETACH DELETE n;