From 678b39a3c29d94d97262dbaa3fae1263c9f63b74 Mon Sep 17 00:00:00 2001 From: Sonja Happ Date: Tue, 3 Sep 2019 16:37:26 +0200 Subject: [PATCH] remove tage unique from Model.ID since it destroys many2many relationship --- common/models.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/models.go b/common/models.go index f1b5b60..556e0cc 100644 --- a/common/models.go +++ b/common/models.go @@ -9,7 +9,7 @@ import ( // The type Model is exactly the same with gorm.Model (see jinzhu/gorm) // except the json tags that are needed for serializing the models type Model struct { - ID uint `json:"id,omitempty" gorm:"unique;primary_key:true"` + ID uint `json:"id,omitempty" gorm:"primary_key:true"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` DeletedAt *time.Time `json:"-" sql:"index"`