summaryrefslogtreecommitdiff
path: root/res/neo4j/reset-db__clean.cypher
blob: fa82fc87091895645a42fa7e9893808c56a9d87c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Flush
match (n) optional match (n)-[r]-() delete r,n;


// init mainpage doc
create (n:__RZDOC {id: 'a000a000', name: 'Welcome Rhizi'});

// init commit block chain
create (n:__RZDOC_NS_META_a000a000:__COMMIT:__HEAD {hash: 'adc83b19e793491b1c6ea0fd8b46cd9f32e592fc', blob: '', id: 'adc83b19e793491b1c6ea0fd8b46cd9f32e592fc', name: 'root-commit', ts_created: 0 });


//
// Constraints
//
// FIXME: use wildcard constraint when supported
//
create constraint on (x:__RZDOC) assert x.id   is unique;
create constraint on (x:__RZDOC) assert x.name is unique;

create constraint on (x:Person) assert x.id is unique;
create constraint on (x:Skill)  assert x.id is unique;

// Drop constraints we used to have - there is no DROP CONSTRAINT * - see http://stackoverflow.com/questions/22357379/neo4j-how-to-drop-all-constraints

drop constraint on (x:Person) assert x.name is unique;
drop constraint on (x:Skill) assert x.name is unique;