mirror of
https://git.rwth-aachen.de/acs/public/villas/web-backend-go/
synced 2025-03-30 00:00:12 +01:00
Tags ID of Model as unique field
This commit is contained in:
parent
bf24fb9a8f
commit
8f5c47dde9
1 changed files with 1 additions and 1 deletions
|
@ -10,7 +10,7 @@ import (
|
||||||
// The type Model is exactly the same with gorm.Model (see jinzhu/gorm)
|
// The type Model is exactly the same with gorm.Model (see jinzhu/gorm)
|
||||||
// except the json tags that are needed for serializing the models
|
// except the json tags that are needed for serializing the models
|
||||||
type Model struct {
|
type Model struct {
|
||||||
ID uint `json:"id" gorm:"primary_key:true"`
|
ID uint `json:"id" gorm:"unique;primary_key:true"`
|
||||||
CreatedAt time.Time `json:"-"`
|
CreatedAt time.Time `json:"-"`
|
||||||
UpdatedAt time.Time `json:"-"`
|
UpdatedAt time.Time `json:"-"`
|
||||||
DeletedAt *time.Time `json:"-" sql:"index"`
|
DeletedAt *time.Time `json:"-" sql:"index"`
|
||||||
|
|
Loading…
Add table
Reference in a new issue