File tree 3 files changed +13
-11
lines changed
3 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -1228,12 +1228,12 @@ alter_table_stmt
1228
1228
};
1229
1229
}
1230
1230
alter_column_suffix
1231
- = k :('after' i / 'first' i ) __ i :column_ref {
1232
- return {
1233
- keyword: k,
1234
- expr: i
1231
+ = k :"first" i {
1232
+ return { keyword: k };
1233
+ }
1234
+ / k :"after" i __ i :column_ref {
1235
+ return { keyword: k, expr: i };
1235
1236
}
1236
- }
1237
1237
alter_action_list
1238
1238
= head :alter_action tail :(__ COMMA __ alter_action )* {
1239
1239
return createList (head, tail);
Original file line number Diff line number Diff line change @@ -781,12 +781,12 @@ alter_table_stmt
781
781
}
782
782
783
783
alter_column_suffix
784
- = k :('after' i / 'first' i ) __ i :column_ref {
785
- return {
786
- keyword: k,
787
- expr: i
784
+ = k :"first" i {
785
+ return { keyword: k };
786
+ }
787
+ / k :"after" i __ i :column_ref {
788
+ return { keyword: k, expr: i };
788
789
}
789
- }
790
790
791
791
alter_action_list
792
792
= head :alter_action tail :(__ COMMA __ alter_action )* {
Original file line number Diff line number Diff line change @@ -64,8 +64,10 @@ function alterExprToSQL(expr) {
64
64
toUpper ( prefix ) ,
65
65
name && name . trim ( ) ,
66
66
dataType . filter ( hasVal ) . join ( ' ' ) ,
67
- suffix && `${ toUpper ( suffix . keyword ) } ${ suffix . expr ? ` ${ columnRefToSQL ( suffix . expr ) } ` : '' } ` ,
68
67
]
68
+ if ( suffix ) {
69
+ alterArray . push ( toUpper ( suffix . keyword ) , suffix . expr && columnRefToSQL ( suffix . expr ) )
70
+ }
69
71
return alterArray . filter ( hasVal ) . join ( ' ' )
70
72
}
71
73
You can’t perform that action at this time.
0 commit comments