Merge branch 'master' of gitea.com:azhai/xorm into azhai-master
This commit is contained in:
commit
5c28f2443b
|
@ -510,11 +510,17 @@ func (db *mysql) GetColumns(queryer core.Queryer, ctx context.Context, tableName
|
||||||
}
|
}
|
||||||
col.Length = len1
|
col.Length = len1
|
||||||
col.Length2 = len2
|
col.Length2 = len2
|
||||||
if _, ok := schemas.SqlTypes[colType]; ok {
|
if _, ok := schemas.SqlTypes[colType]; !ok {
|
||||||
col.SQLType = schemas.SQLType{Name: colType, DefaultLength: len1, DefaultLength2: len2}
|
if !strings.HasPrefix(colType, "UNSIGNED ") {
|
||||||
} else {
|
|
||||||
return nil, nil, fmt.Errorf("unknown colType %v", colType)
|
return nil, nil, fmt.Errorf("unknown colType %v", colType)
|
||||||
}
|
}
|
||||||
|
colType = colType[len("UNSIGNED "):]
|
||||||
|
}
|
||||||
|
if _, ok := schemas.SqlTypes[colType]; !ok {
|
||||||
|
return nil, nil, fmt.Errorf("unknown colType %v", colType)
|
||||||
|
} else {
|
||||||
|
col.SQLType = schemas.SQLType{Name: colType, DefaultLength: len1, DefaultLength2: len2}
|
||||||
|
}
|
||||||
|
|
||||||
if colKey == "PRI" {
|
if colKey == "PRI" {
|
||||||
col.IsPrimaryKey = true
|
col.IsPrimaryKey = true
|
||||||
|
|
Loading…
Reference in New Issue