add comment create support for mysql

This commit is contained in:
Lunny Xiao 2017-06-14 14:05:17 +08:00
parent 6c9f9bf313
commit e9b7412d75
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
1 changed files with 3 additions and 0 deletions

View File

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