Explorar o código

xorm: 插入自增id

Yi hai 1 ano
pai
achega
234a6fbfbe
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      models/feed_template.go

+ 1 - 1
models/feed_template.go

@@ -10,7 +10,7 @@ import (
 )
 
 type FeedTemplate struct {
-	Id           int64   `xorm:"id" json:"id"`
+	Id           int64   `xorm:"AUTOINCR 'id'" json:"id"`
 	PastureId    int64   `xorm:"pastureid" json:"pasture_id"`
 	TCode        string  `xorm:"tcode" json:"t_code"`
 	TName        string  `xorm:"tname" json:"t_name"`