summaryrefslogtreecommitdiff
path: root/res/neo4j
diff options
context:
space:
mode:
authorLV-426 <lv-426@taproot.org.il>2015-02-02 21:34:52 +0200
committerLV-426 <lv-426@taproot.org.il>2015-02-02 21:37:02 +0200
commitc95ed45dbd8b5be05168dc67e4e94d299db11bde (patch)
treec57b7f28d36ae9cd30cfdee379066e87abb01596 /res/neo4j
parent167397fe94592c65733300cfe371dcb49f74d440 (diff)
neo4j reset-db: split into clean, single-link scripts
Diffstat (limited to 'res/neo4j')
-rw-r--r--res/neo4j/reset-db__clean.cypher15
-rw-r--r--res/neo4j/reset-db__single_link.cypher14
2 files changed, 16 insertions, 13 deletions
diff --git a/res/neo4j/reset-db__clean.cypher b/res/neo4j/reset-db__clean.cypher
new file mode 100644
index 00000000..29f1afd7
--- /dev/null
+++ b/res/neo4j/reset-db__clean.cypher
@@ -0,0 +1,15 @@
+// Flush
+match (n) optional match (n)-[r]-() delete r,n;
+
+//
+// Constraints
+//
+// FIXME: use wildcard constraint when supported
+//
+create constraint on (x:Person) assert x.id is unique;
+create constraint on (x:Skill) assert x.id is unique;
+create constraint on (x:Person) assert x.name is unique;
+create constraint on (x:Skill) assert x.name is unique;
+
+// init commit block chain
+create (n:__HEAD:__Commit {hash: 'da39a3ee5e6b4b0d3255bfef95601890afd80709', blob: '', id: 'da39a3ee5e6b4b0d3255bfef95601890afd80709', name: 'root-commit', ts_created: 0 });
diff --git a/res/neo4j/reset-db__single_link.cypher b/res/neo4j/reset-db__single_link.cypher
index 01bfb051..359e53ac 100644
--- a/res/neo4j/reset-db__single_link.cypher
+++ b/res/neo4j/reset-db__single_link.cypher
@@ -1,18 +1,6 @@
-// Flush
-match (n) optional match (n)-[r]-() delete r,n;
-
-//
-// Constraints
//
-// FIXME: use wildcard constraint when supported
+// [!] call reset-db__clean.cypher first
//
-create constraint on (x:Person) assert x.id is unique;
-create constraint on (x:Skill) assert x.id is unique;
-create constraint on (x:Person) assert x.name is unique;
-create constraint on (x:Skill) assert x.name is unique;
-
-// init commit block chain
-create (n:__HEAD:__Commit {hash: 'da39a3ee5e6b4b0d3255bfef95601890afd80709', blob: '', id: 'da39a3ee5e6b4b0d3255bfef95601890afd80709', name: 'root-commit', ts_created: 0 });
// Data
create (x:Person {name:'Bob', id: 'p_0', description: 'Bob is ...' });