Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect constraint error #42

Open
AdrienLemaire opened this issue Mar 16, 2021 · 0 comments
Open

Incorrect constraint error #42

AdrienLemaire opened this issue Mar 16, 2021 · 0 comments

Comments

@AdrienLemaire
Copy link

$ cypher-lint -a < scripts/upload_t10_data.cypher
<stdin>:2:19: Invalid input 'u': expected '=' or CREATE CONSTRAINT ON
CREATE CONSTRAINT uniqueT10 IF NOT EXISTS ON (n:T10)
                  ^
<stdin>:5:19: Invalid input 'u': expected '=' or CREATE CONSTRAINT ON
CREATE CONSTRAINT uniqueMonth IF NOT EXISTS ON (m:Month)
                  ^
  @0     2..33    line_comment                // Make sure we have unique nodes
  @1    34..145   error                       >>CREATE CONSTRAINT uniqueT10 IF NOT EXISTS ON (n:T10)\n      ASSERT (n.date, n.name, n.result, n.m50) IS NODE KEY<<
  @2   149..175   line_comment                // Constraint for Month/Year
  @3   176..275   error                       >>CREATE CONSTRAINT uniqueMonth IF NOT EXISTS ON (m:Month)\n      ASSERT (m.month, m.year) IS NODE KEY<<
  @4   280..327   line_comment                // Needs apoc.import.file.enabled=true  in config

According to the cypher refcard, the following constraints format is acceptable (and working as expected):

// Make sure we have unique nodes
CREATE CONSTRAINT uniqueT10 IF NOT EXISTS ON (n:T10)
      ASSERT (n.date, n.name, n.result, n.m50) IS NODE KEY;
// Constraint for Month/Year
CREATE CONSTRAINT uniqueMonth IF NOT EXISTS ON (m:Month)
      ASSERT (m.month, m.year) IS NODE KEY;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants