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

This commit is contained in:
lukaseder 2019-10-11 21:26:38 +02:00
parent ec553758a9
commit bae2b79674

View File

@ -249,6 +249,7 @@ final class DDLInterpreter {
Field<?> addColumn = query.$addColumn();
Field<?> alterColumn = query.$alterColumn();
Field<?> alterColumnDefault = query.$alterColumnDefault();
boolean alterColumnDropDefault = query.$alterColumnDropDefault();
Nullability alterColumnNullability = query.$alterColumnNullability();
DataType<?> alterColumnType = query.$alterColumnType();
boolean ifExistsColumn = query.$ifExistsColumn();
@ -284,6 +285,8 @@ final class DDLInterpreter {
existingField.type = alterColumnType;
else if (alterColumnDefault != null)
existingField.type = existingField.type.default_((Field) alterColumnDefault);
else if (alterColumnDropDefault)
existingField.type = existingField.type.default_((Field) null);
else
throw unsupportedQuery(query);
}