if (propertyMethodMetadata != null && constraint == null) {
LOGGER.info("Creating constraint for label {} on property '{}'.", label, propertyMetadata.getName());
graphDatabaseService.schema().constraintFor(label).assertPropertyIsUnique(propertyMetadata.getName()).create();
} else if (propertyMethodMetadata == null && constraint != null) {
LOGGER.info("Dropping constraint for label {} on properties '{}'.", label, constraint.getPropertyKeys());
constraint.drop();
}
}
private IndexDefinition findIndex(Label label, String propertyName) {
final Iterable<IndexDefinition> indexes = graphDatabaseService.schema().getIndexes(label);