diff options
| -rw-r--r-- | res/neo4j/reset-db__clean.cypher | 15 | ||||
| -rw-r--r-- | res/neo4j/reset-db__single_link.cypher | 14 |
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 ...' }); |
