From 3ab98cf500e0a7fdc1e112971048a4e4d8d96c59 Mon Sep 17 00:00:00 2001 From: aspasskiy Date: Tue, 23 Apr 2024 19:42:33 +0300 Subject: [PATCH] upvotes models --- internal/models/feedback.go | 2 +- internal/models/upvote.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/models/feedback.go b/internal/models/feedback.go index ba69b03..620e48e 100644 --- a/internal/models/feedback.go +++ b/internal/models/feedback.go @@ -15,7 +15,7 @@ type Feedback struct { Type FeedbackType `gorm:"type:varchar(255)"` Text string `gorm:"type:varchar(300)"` - Upvote []Upvote `gorm:"foreignKey:FeedbackUUID;references:UUID"` + Upvote []Upvote `gorm:"foreignKey:FeedbackUUID"` CreatedAt time.Time `gorm:"type:timestamp"` UpdatedAt time.Time `gorm:"type:timestamp"` diff --git a/internal/models/upvote.go b/internal/models/upvote.go index 36f0d86..9d0c6f0 100644 --- a/internal/models/upvote.go +++ b/internal/models/upvote.go @@ -7,7 +7,7 @@ import ( type Upvote struct { UUID string `gorm:"primaryKey"` - SessionUUID string `gorm:"type:varchar(255);unique"` + SessionUUID string `gorm:"type:varchar(255)"` FeedbackUUID string `gorm:"type:varchar(255)"` CreatedAt time.Time `gorm:"type:timestamp"` }