diff --git a/grammar/basic-grammar.xml b/grammar/basic-grammar.xml index e9c8276c40..e31b98b59f 100644 --- a/grammar/basic-grammar.xml +++ b/grammar/basic-grammar.xml @@ -666,6 +666,8 @@ ALL NONE SINGLE + NODE + KEY diff --git a/grammar/commands.xml b/grammar/commands.xml index 925006fde8..0c8ee91462 100644 --- a/grammar/commands.xml +++ b/grammar/commands.xml @@ -53,7 +53,7 @@ - CREATE &SP; CONSTRAINT &SP; &SP; + ADD &SP; CONSTRAINT &SP; &SP; FOR &SP; &SP; REQUIRE &SP; @@ -75,17 +75,18 @@ - - + + + - - UNIQUE &SP; &WS; , &WS; + + UNIQUE &SP; - - exists ( ) + + NODE &SP; KEY &SP; &WS; , &WS; diff --git a/tools/grammar/src/test/resources/cypher.txt b/tools/grammar/src/test/resources/cypher.txt index 5509dbdd70..f1c53a8bf4 100644 --- a/tools/grammar/src/test/resources/cypher.txt +++ b/tools/grammar/src/test/resources/cypher.txt @@ -267,16 +267,22 @@ MATCH (a) CALL proc( )§ MATCH (a) CALL proc( a, b , c )§ MATCH (a) CALL proc( a, b , c ) YIELD a, b , c§ CALL proc( ) RETURN *§ -CREATE CONSTRAINT foo +ADD CONSTRAINT foo FOR (p:Person) REQUIRE UNIQUE p.name§ -CREATE CONSTRAINT bar -FOR (p:Person) -REQUIRE UNIQUE p.name, p.email§ -CREATE CONSTRAINT baz +ADD CONSTRAINT baz FOR (p:Person) REQUIRE exists(p.name)§ -CREATE CONSTRAINT cru +ADD CONSTRAINT cru FOR ()-[r:REL]-() REQUIRE exists(r.property)§ DROP CONSTRAINT foo_bar_baz§ +ADD CONSTRAINT nodeKey +FOR (n:Node) +REQUIRE NODE KEY n.prop§ +ADD CONSTRAINT nodeKey +FOR (n:Node) +REQUIRE NODE KEY n.p1, n.p2, n.p3§ +ADD CONSTRAINT nodeKey +FOR (n:Node) +REQUIRE NODE KEY n.p1 ,n.p2, n.p3§