remove tage unique from Model.ID since it destroys many2many relationship

This commit is contained in:
Sonja Happ 2019-09-03 16:37:26 +02:00
parent aa749c1c19
commit 678b39a3c2

View file

@ -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"`