22 lines
464 B
Go
22 lines
464 B
Go
package models
|
|
|
|
import (
|
|
"github.com/google/uuid"
|
|
"time"
|
|
)
|
|
|
|
type Upvote struct {
|
|
UUID string `gorm:"primaryKey"`
|
|
SessionUUID string `gorm:"type:varchar(255);unique"`
|
|
FeedbackUUID string `gorm:"type:varchar(255)"`
|
|
CreatedAt time.Time `gorm:"type:timestamp"`
|
|
}
|
|
|
|
func NewUpvote(sessionUUID, feedbackUUID string) *Upvote {
|
|
return &Upvote{
|
|
UUID: uuid.New().String(),
|
|
SessionUUID: sessionUUID,
|
|
FeedbackUUID: feedbackUUID,
|
|
}
|
|
}
|