adam-cowley / neode

Neo4j OGM for Node.js
MIT License
394 stars 72 forks source link

Update query install() #179

Closed sawyerf closed 1 year ago

sawyerf commented 1 year ago

When i execute:

instance.schema.install()

It produce this error

errors: [
    {
      query: 'CREATE CONSTRAINT ON (model:Client) ASSERT model.username IS UNIQUE',
      params: {},
      error: [Neo4jError]
    },
    ...
]

When I execute manually this query neo4j say:

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:Client) ASSERT model.username IS UNIQUE"

So i fixed it

Source:

sawyerf commented 1 year ago

@adam-cowley