1212import net .sf .jsqlparser .statement .alter .Alter ;
1313import net .sf .jsqlparser .expression .ExpressionVisitor ;
1414import net .sf .jsqlparser .statement .alter .AlterExpression ;
15- import net .sf .jsqlparser .statement .alter .AlterOperation ;
1615import net .sf .jsqlparser .statement .alter .AlterExpressionPrimaryKey ;
1716import net .sf .jsqlparser .statement .create .table .DefaultConstraint ;
1817import net .sf .jsqlparser .statement .select .PlainSelect ;
@@ -50,13 +49,6 @@ public void deParse(Alter alter) {
5049 }
5150
5251 private void deParseAction (AlterExpression action ) {
53- if (action .getOperation () == AlterOperation .ALTER
54- && action .getColumnSetDefaultList () != null
55- && !action .getColumnSetDefaultList ().isEmpty ()) {
56- action .appendColumnActionTo (builder ,
57- expression -> expression .accept (expressionVisitor , null ));
58- return ;
59- }
6052 if (action instanceof AlterExpressionPrimaryKey ) {
6153 ((AlterExpressionPrimaryKey ) action ).appendTo (builder ,
6254 expression -> expression .accept (expressionVisitor , null ));
@@ -68,6 +60,13 @@ private void deParseAction(AlterExpression action) {
6860 deParseTail (action );
6961 return ;
7062 }
63+ if (action .getOperation () == net .sf .jsqlparser .statement .alter .AlterOperation .ALTER
64+ && action .getColumnSetDefaultList () != null
65+ && !action .getColumnSetDefaultList ().isEmpty ()) {
66+ action .appendColumnActionTo (builder ,
67+ expression -> expression .accept (expressionVisitor , null ));
68+ return ;
69+ }
7170 if (action .getColDataTypeList () == null || action .getColDataTypeList ().size () != 1
7271 || action .getColDataTypeList ().get (0 ).getUsingExpression () == null ) {
7372 builder .append (action );
0 commit comments