【发布时间】:2018-01-08 16:08:22
【问题描述】:
我创建了以下 LiquiGraph 迁移脚本:
<?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>
如您所见 - 我在那里添加了 2 行 - 用于创建 INDEX 和 CONSTRAINT。
我想让它具有幂等性 - 这样我想检查索引或约束是否不存在,然后才创建它们。
是否可以在我的 LiquiGraph 迁移脚本中添加此类验证?如果有,请举个例子。
【问题讨论】:
标签: neo4j cypher liquigraph