I have created the following LiquiGraph migration script:
<?xml version="1.0" encoding="UTF-8"?>
<changelog xmlns="http://www.liquigraph.org/schema/1.0/liquigraph.xsd">
<changeset id="initial_indexes_and_constraints" author="alex">
<query>CREATE INDEX ON :Action(entityId)</query>
<query>CREATE CONSTRAINT ON ( action:Action ) ASSERT action.id IS UNIQUE</query>
</changeset>
</changelog>
As you may see -I added 2 lines there - for INDEX
and CONSTRAINT
creation.
I would like to make it idempotent - this way I'd like to check that index or constraint doesn't exist and only then to create them.
Is it possible to add such kind of validation to my LiquiGraph migration script? If so, please show an example.