diff --git a/cypher/ddl/indices.cypher b/cypher/ddl/indices.cypher index 70a4e167..23f22bba 100644 --- a/cypher/ddl/indices.cypher +++ b/cypher/ddl/indices.cypher @@ -1,21 +1,21 @@ // uniqueness constrains (implying an index) -CREATE CONSTRAINT ON (n:City) ASSERT n.id IS UNIQUE; -CREATE CONSTRAINT ON (n:Comment) ASSERT n.id IS UNIQUE; -CREATE CONSTRAINT ON (n:Country) ASSERT n.id IS UNIQUE; -CREATE CONSTRAINT ON (n:Forum) ASSERT n.id IS UNIQUE; -CREATE CONSTRAINT ON (n:Message) ASSERT n.id IS UNIQUE; -CREATE CONSTRAINT ON (n:Organisation) ASSERT n.id IS UNIQUE; -CREATE CONSTRAINT ON (n:Person) ASSERT n.id IS UNIQUE; -CREATE CONSTRAINT ON (n:Post) ASSERT n.id IS UNIQUE; -CREATE CONSTRAINT ON (n:Tag) ASSERT n.id IS UNIQUE; +CREATE CONSTRAINT FOR (n:City) REQUIRE n.id IS UNIQUE; +CREATE CONSTRAINT FOR (n:Comment) REQUIRE n.id IS UNIQUE; +CREATE CONSTRAINT FOR (n:Country) REQUIRE n.id IS UNIQUE; +CREATE CONSTRAINT FOR (n:Forum) REQUIRE n.id IS UNIQUE; +CREATE CONSTRAINT FOR (n:Message) REQUIRE n.id IS UNIQUE; +CREATE CONSTRAINT FOR (n:Organisation) REQUIRE n.id IS UNIQUE; +CREATE CONSTRAINT FOR (n:Person) REQUIRE n.id IS UNIQUE; +CREATE CONSTRAINT FOR (n:Post) REQUIRE n.id IS UNIQUE; +CREATE CONSTRAINT FOR (n:Tag) REQUIRE n.id IS UNIQUE; // name/firstName -CREATE INDEX ON :Country(name); -CREATE INDEX ON :Person(firstName); -CREATE INDEX ON :Tag(name); -CREATE INDEX ON :TagClass(name); +CREATE INDEX FOR (n:Country) ON n.name; +CREATE INDEX FOR (n:Person) ON n.firstName; +CREATE INDEX FOR (n:Tag) ON n.name; +CREATE INDEX FOR (n:TagClass) ON n.name; // creationDate -CREATE INDEX ON :Message(creationDate); -CREATE INDEX ON :Post(creationDate); -CREATE INDEX ON :Forum(creationDate); +CREATE INDEX FOR (n:Message) ON n.creationDate; +CREATE INDEX FOR (n:Post) ON n.creationDate; +CREATE INDEX FOR (n:Forum) ON n.creationDate;