Selaa lähdekoodia

xorm: 插入自增id

Yi 1 vuosi sitten
vanhempi
commit
234a6fbfbe
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  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"`