orm: add test case for uint pk read or create

This commit is contained in:
miraclesu
2016-03-23 21:32:52 +08:00
parent 3be6688cd1
commit eaf38bb096
3 changed files with 31 additions and 1 deletions

View File

@@ -141,7 +141,7 @@ func (o *orm) ReadOrCreate(md interface{}, col1 string, cols ...string) (bool, i
}
id, vid := int64(0), ind.FieldByIndex(mi.fields.pk.fieldIndex)
if mi.fields.pk.fieldType&IsPostiveIntegerField > 0 {
if mi.fields.pk.fieldType&IsPositiveIntegerField > 0 {
id = int64(vid.Uint())
} else {
id = vid.Int()