Skip to content

Commit

Permalink
Fix ALTER PROPERTY to avoid save of constraints as linked docs in the…
Browse files Browse the repository at this point in the history
… default cluster
  • Loading branch information
luigidellaquila committed Oct 19, 2017
1 parent e5c88eb commit bce3940
Showing 1 changed file with 1 addition and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -321,49 +321,37 @@ public Object execute(final Map<Object, Object> iArgs) {

// CREATE IT LOCALLY
OPropertyImpl internalProp = sourceClass.addPropertyInternal(fieldName, type, linkedType, linkedClass, unsafe);
boolean toSave = false;

if (readonly) {
internalProp.setReadonly(true);
toSave = true;
}

if (mandatory) {
internalProp.setMandatory(true);
toSave = true;
}

if (notnull) {
internalProp.setNotNull(true);
toSave = true;
}

if (max != null) {
internalProp.setMax(max);
toSave = true;
}

if (min != null) {
internalProp.setMin(min);
toSave = true;
}

if (defaultValue != null) {
internalProp.setDefaultValue(defaultValue);
toSave = true;
}

if (collate != null) {
internalProp.setCollate(collate);
toSave = true;
}

if (regex != null) {
internalProp.setRegexp(regex);
toSave = true;
}

if (toSave) {
internalProp.save();
}

return sourceClass.properties().size();
Expand Down

0 comments on commit bce3940

Please sign in to comment.