dialect/sql/schema: correctly read uint32 type in migration (#289)

Fixes #287
This commit is contained in:
Ariel Mashraki
2020-01-15 17:46:16 +02:00
committed by GitHub
parent 71221877ee
commit 91c163525f
9 changed files with 1290 additions and 2 deletions

View File

@@ -294,6 +294,9 @@ func (d *MySQL) scanColumn(c *Column, rows *sql.Rows) error {
}); parts[0] {
case "int":
c.Type = field.TypeInt32
if len(parts) == 3 { // int(10) unsigned.
c.Type = field.TypeUint32
}
case "smallint":
c.Type = field.TypeInt16
if len(parts) == 3 { // smallint(5) unsigned.