Explorar o código

add comment create support for mysql

xormplus %!s(int64=8) %!d(string=hai) anos
pai
achega
b5e3f16634
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      dialect.go

+ 3 - 0
dialect.go

@@ -244,6 +244,9 @@ func (b *Base) CreateTableSql(table *Table, tableName, storeEngine, charset stri
 				sql += col.StringNoPk(b.dialect)
 			}
 			sql = strings.TrimSpace(sql)
+			if b.DriverName() == MYSQL && len(col.Comment) > 0 {
+				sql += " COMMENT '" + col.Comment + "'"
+			}
 			sql += ", "
 		}