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 Constraints Query Generated #183

Open
ColtraneNadler opened this issue Apr 24, 2024 · 2 comments
Open

Incorrect Constraints Query Generated #183

ColtraneNadler opened this issue Apr 24, 2024 · 2 comments

Comments

@ColtraneNadler
Copy link

Incorrect Constraints Query Generated

Versions

  • Neo4j Version 5.18.1
  • Neode Version 0.4.9

Problem

Incorrect constraints query being generated by

instance.model('MyNode', {
    customKey: {
        type: 'string',
        unique: true
    },
    mappings: 'string'
 });

instance.schema.install()

Runs the following cypher query

CREATE CONSTRAINT ON (model:MyNode) ASSERT model.customKey IS UNIQUE

which returns the following error ->

  error: Neo4jError: Invalid constraint syntax, ON and ASSERT should not be used. Replace ON with FOR and ASSERT with REQUIRE. (line 1, column 1 (offset: 0))
  "CREATE CONSTRAINT ON (model:MyNode) ASSERT model.customKey IS UNIQUE"
   ^
@ColtraneNadler
Copy link
Author

Bumping this

@ColtraneNadler
Copy link
Author

I created a PR for this issue here
#184

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant