mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2026-01-20 20:01:25 +00:00
delete cql files
This commit is contained in:
parent
816fbdf7cd
commit
968578f10a
@ -0,0 +1 @@
|
||||
MATCH (n:Badge) DETACH DELETE n;
|
||||
@ -0,0 +1 @@
|
||||
MATCH (n:Category) DETACH DELETE n;
|
||||
@ -0,0 +1 @@
|
||||
MATCH (n:Comment) DETACH DELETE n;
|
||||
@ -0,0 +1,2 @@
|
||||
MATCH (n:Post) DETACH DELETE n;
|
||||
MATCH (n:Tag) DETACH DELETE n;
|
||||
@ -0,0 +1 @@
|
||||
// this is just a relation between users(?) - no need to delete
|
||||
@ -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"
|
||||
|
||||
@ -0,0 +1 @@
|
||||
// this is just a relation between users and contributions - no need to delete
|
||||
@ -0,0 +1 @@
|
||||
MATCH (n:User) DETACH DELETE n;
|
||||
Loading…
x
Reference in New Issue
Block a user