neode icon indicating copy to clipboard operation
neode copied to clipboard

update constraint syntax

Open ColtraneNadler opened this issue 1 year ago • 2 comments

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`;
}

ColtraneNadler avatar Apr 24 '24 14:04 ColtraneNadler

Bumping this

ColtraneNadler avatar May 02 '24 17:05 ColtraneNadler