«Go xorm - UNIQUE constraint failed»
by pluvet on Oct 7, 2019

解决方法:定义 type 时指明自增

type RelDisplacementHint struct {
    Id           int    `json:"id" xorm:"pk autoincr 'id'"`
    CollectionId int    `json:"collection_id" xorm:"'collection_id'"`
    Translation  string    `json:"translation" xorm:"'translation'"`
    Hint         string `json:"hint" xorm:"'hint'"`
}

添加新评论