neo4j-contrib / neomodel

An Object Graph Mapper (OGM) for the Neo4j graph database.
https://neomodel.readthedocs.io
MIT License
963 stars 231 forks source link

Invalid constraint syntax, ON and ASSERT should not be used. #666

Closed hamashoool closed 1 year ago

hamashoool commented 1 year ago

Expected Behavior (Mandatory)

when you run the command to install labels. It was supposed to create them.

Actual Behavior (Mandatory)

But it will return this error. The error message you suggests that the syntax you used to create the constraint is no longer valid in the version of Neo4j 5. The ON and ASSERT keywords were used in older versions of Neo4j to create constraints, but they have since been replaced by FOR and REQUIRE.

How to Reproduce the Problem

just use Neo4j 5 and current neomodel

Simple Example

I was using django_neomodel, when I create the models.py. I was supposed to run the install_labels command. So, when I ran the command I got the error.

Screenshots (where it's possibile)

Screenshot from 2023-02-14 21-04-02

Currently used versions neo4j 5.4.0 django_neomodel 0.0.7 current version of neomodel

Versions

mariusconjeaud commented 1 year ago

This made me realize I hadn't opened a Pull Request yet for my upgrade to Neo4j v5. I did it just now, check out : #668

mariusconjeaud commented 1 year ago

FYI, I am just waiting to be able to make a release out of my latest PR (which adds support for Neo4j up to version 4.4) before merging the 5.x PR. That way we'll have a last release that supports 3.5 -> 4.x ; and then we can extend to 5.x (and it will still support 4.4 LTS)