Browse Source

docs: fix comment

main
Evan 7 months ago
parent
commit
356726f2db
  1. 1
      models/calendar.go
  2. 1
      models/event.go

1
models/calendar.go

@ -17,6 +17,7 @@ type Calendar struct {
Events []Event `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL"`
}
//BeforeCreate initial uuid for calendar
func (calendar *Calendar) BeforeCreate(tx *gorm.DB) (err error) {
calendar.ID = uuid.New()
return

1
models/event.go

@ -17,6 +17,7 @@ type Event struct {
UpdatedAt time.Time
}
//BeforeCreate initial uuid for event
func (event *Event) BeforeCreate(tx *gorm.DB) (err error) {
event.ID = uuid.New()
return