From 4ef7b32893fc80e9614b061a6641e0a08e76d62b Mon Sep 17 00:00:00 2001 From: Mats Rydberg Date: Mon, 22 Jul 2019 17:37:40 +0200 Subject: [PATCH] Update grammar to use CREATE Add test for DROP --- grammar/commands.xml | 2 +- tools/grammar/src/test/resources/cypher.txt | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/grammar/commands.xml b/grammar/commands.xml index 4cd3f16d08..01bc9bf947 100644 --- a/grammar/commands.xml +++ b/grammar/commands.xml @@ -66,7 +66,7 @@ - ADD &SP; CONSTRAINT &SP; &SP; + CREATE &SP; CONSTRAINT &SP; &SP; FOR &SP; &SP; REQUIRE &SP; diff --git a/tools/grammar/src/test/resources/cypher.txt b/tools/grammar/src/test/resources/cypher.txt index 3694daeee3..18d25f2560 100644 --- a/tools/grammar/src/test/resources/cypher.txt +++ b/tools/grammar/src/test/resources/cypher.txt @@ -312,22 +312,23 @@ CALL db.labels() YIELD * WHERE label CONTAINS 'User' AND foo + bar = foo RETURN count(label) AS numLabels§ CALL db.labels() YIELD x WHERE label CONTAINS 'User' AND foo + bar = foo RETURN count(label) AS numLabels§ -ADD CONSTRAINT foo +CREATE CONSTRAINT foo FOR (p:Person) REQUIRE UNIQUE p.name§ -ADD CONSTRAINT baz +CREATE CONSTRAINT baz FOR (p:Person) REQUIRE exists(p.name)§ -ADD CONSTRAINT cru +CREATE CONSTRAINT cru FOR ()-[r:REL]-() REQUIRE exists(r.property)§ DROP CONSTRAINT foo_bar_baz§ -ADD CONSTRAINT nodeKey +CREATE CONSTRAINT nodeKey FOR (n:Node) REQUIRE NODE KEY n.prop§ -ADD CONSTRAINT nodeKey +CREATE CONSTRAINT nodeKey FOR (n:Node) REQUIRE NODE KEY n.p1, n.p2, n.p3§ -ADD CONSTRAINT nodeKey +CREATE CONSTRAINT nodeKey FOR (n:Node) REQUIRE NODE KEY n.p1 ,n.p2, n.p3§ +DROP CONSTRAINT foo§