Skip to content

Commit

Permalink
app-serving: auto-create task UUID
Browse files Browse the repository at this point in the history
  • Loading branch information
robertchoi80 committed Apr 15, 2024
1 parent 55c1724 commit 5435b30
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/model/app-serve-app.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package model

import (
"time"
"github.com/google/uuid"
"gorm.io/gorm"
)

type AppServeApp struct {
Expand Down Expand Up @@ -52,3 +54,8 @@ type AppServeAppTask struct {
UpdatedAt *time.Time `gorm:"autoUpdateTime:false" json:"updatedAt"`
DeletedAt *time.Time `json:"deletedAt"`
}

func (t *AppServeAppTask) BeforeCreate(tx *gorm.DB) (err error) {
t.ID = uuid.New().String()
return nil
}

0 comments on commit 5435b30

Please sign in to comment.