use of io.crate.analyze.AnalyzedAlterTableDropCheckConstraint in project crate by crate.
the class AlterTableDropCheckConstraintPlan method bind.
@VisibleForTesting
public static BoundAddColumn bind(AnalyzedAlterTableDropCheckConstraint dropCheckConstraint) {
DocTableInfo tableInfo = dropCheckConstraint.tableInfo();
AnalyzedTableElements<Object> tableElementsBound = new AnalyzedTableElements<>();
AlterTableAddColumnPlan.addExistingPrimaryKeys(tableInfo, tableElementsBound);
tableInfo.checkConstraints().stream().filter(c -> !dropCheckConstraint.name().equals(c.name())).forEach(c -> tableElementsBound.addCheckConstraint(tableInfo.ident(), c));
return new BoundAddColumn(tableInfo, tableElementsBound, Settings.builder().build(), AnalyzedTableElements.finalizeAndValidate(tableInfo.ident(), new AnalyzedTableElements<>(), tableElementsBound), false, false);
}
Aggregations