[jOOQ/jOOQ#8528] Interpret ALTER TABLE .. ALTER .. SET DEFAULT

This commit is contained in:
lukaseder 2019-10-11 21:01:56 +02:00
parent ccad3cdff9
commit ec506f6ecb

View File

@ -231,6 +231,7 @@ final class DDLInterpreter {
}
}
@SuppressWarnings({ "rawtypes", "unchecked" })
private final void accept0(AlterTableImpl query) {
Table<?> table = query.$table();
MutableSchema schema = getSchema(table.getSchema());
@ -281,6 +282,8 @@ final class DDLInterpreter {
existingField.type = existingField.type.nullability(alterColumnNullability);
else if (alterColumnType != null)
existingField.type = alterColumnType;
else if (alterColumnDefault != null)
existingField.type = existingField.type.default_((Field) alterColumnDefault);
else
throw unsupportedQuery(query);
}