Explorar el Código

add comment create support for mysql

xormplus hace 8 años
padre
commit
b5e3f16634
Se han modificado 1 ficheros con 3 adiciones y 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 += ", "
 		}