@@ -241,10 +241,10 @@ func (a *AlterTableAddColumn) FormatSQL(formatter *Formatter) {
241241
242242func (a * AlterTableAddIndex ) FormatSQL (formatter * Formatter ) {
243243 formatter .WriteString ("ADD " )
244- formatter .WriteExpr (a .Index )
245244 if a .IfNotExists {
246245 formatter .WriteString ("IF NOT EXISTS " )
247246 }
247+ formatter .WriteExpr (a .Index )
248248 if a .After != nil {
249249 formatter .WriteString (" AFTER " )
250250 formatter .WriteExpr (a .After )
@@ -337,10 +337,10 @@ func (a *AlterTableDropColumn) FormatSQL(formatter *Formatter) {
337337
338338func (a * AlterTableDropIndex ) FormatSQL (formatter * Formatter ) {
339339 formatter .WriteString ("DROP INDEX " )
340- formatter .WriteExpr (a .IndexName )
341340 if a .IfExists {
342- formatter .WriteString (" IF EXISTS" )
341+ formatter .WriteString ("IF EXISTS " )
343342 }
343+ formatter .WriteExpr (a .IndexName )
344344}
345345
346346func (a * AlterTableDropPartition ) FormatSQL (formatter * Formatter ) {
@@ -357,10 +357,10 @@ func (a *AlterTableDropPartition) FormatSQL(formatter *Formatter) {
357357
358358func (a * AlterTableDropProjection ) FormatSQL (formatter * Formatter ) {
359359 formatter .WriteString ("DROP PROJECTION " )
360- formatter .WriteExpr (a .ProjectionName )
361360 if a .IfExists {
362- formatter .WriteString (" IF EXISTS" )
361+ formatter .WriteString ("IF EXISTS " )
363362 }
363+ formatter .WriteExpr (a .ProjectionName )
364364}
365365
366366func (a * AlterTableFreezePartition ) FormatSQL (formatter * Formatter ) {
0 commit comments