orm add uint uint32 uint64 auto increment support

This commit is contained in:
slene
2013-08-22 18:35:26 +08:00
parent 7d7c9825e9
commit 94f7ba8bdf
7 changed files with 13 additions and 12 deletions

View File

@@ -42,7 +42,7 @@ func registerModel(model interface{}, prefix string) {
if fi.name == "Id" {
if fi.sf.Tag.Get(defaultStructTagName) == "" {
switch fi.addrValue.Elem().Kind() {
case reflect.Int, reflect.Int64, reflect.Int32:
case reflect.Int, reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint32, reflect.Uint64:
fi.auto = true
fi.pk = true
info.fields.pk = fi