[jOOQ/jOOQ#8528] Interpret multi column ADD

This commit is contained in:
Lukas Eder 2019-11-19 15:17:52 +01:00
parent 2c5171cc40
commit c331962a3c

View File

@ -391,7 +391,11 @@ final class DDLInterpreter {
if (query.$add() != null) {
// TODO: FIRST, BEFORE, AFTER
// TODO: Check if we already have the column
for (FieldOrConstraint fc : query.$add())
if (fc instanceof Field)
if (existing.field((Field<?>) fc) != null)
throw fieldAlreadyExists((Field<?>) fc);
for (FieldOrConstraint fc : query.$add())
if (fc instanceof Field)
existing.fields.add(new MutableField((UnqualifiedName) fc.getUnqualifiedName(), existing, ((Field<?>) fc).getDataType()));
@ -409,7 +413,6 @@ final class DDLInterpreter {
else
return;
// TODO: Check if we already have the column
if (query.$addFirst())
existing.fields.add(0, new MutableField((UnqualifiedName) query.$addColumn().getUnqualifiedName(), existing, query.$addColumnType()));
else if (query.$addBefore() != null)