13 lines
509 B
Go
13 lines
509 B
Go
package model
|
|
|
|
import "time"
|
|
|
|
type UserPin struct {
|
|
ID string `gorm:"primaryKey;type:uuid;default:uuid_generate_v4();unique;not null" json:"id"`
|
|
UserID string `gorm:"not null" json:"userId"`
|
|
User User `gorm:"foreignKey:UserID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE" json:"-"`
|
|
Pin string `gorm:"not null" json:"pin"`
|
|
CreatedAt time.Time `gorm:"default:current_timestamp" json:"createdAt"`
|
|
UpdatedAt time.Time `gorm:"default:current_timestamp" json:"updatedAt"`
|
|
}
|