neode
neode copied to clipboard
update constraint syntax
Why?
Currently neode generates outdated CYPHER query syntax for unique constraints. View issue here --> https://github.com/adam-cowley/neode/issues/183
What?
in /src/Schema.js update to correct CONSTRAINT syntax. Replace ON with FOR and ASSERT with REQUIRE
function UniqueConstraintCypher(label, property, mode = 'CREATE') {
// return `${mode} CONSTRAINT ON (model:${label}) ASSERT model.${property} IS UNIQUE`;
return `${mode} CONSTRAINT FOR (model:${label}) REQUIRE model.${property} IS UNIQUE`;
}
Bumping this