fix: unique entity

This commit is contained in:
ericprd
2025-03-01 21:27:28 +08:00
parent bdf6dd131e
commit eb1584f8c4
6 changed files with 13 additions and 10 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ type Subscribe struct {
type SubscribePlan struct {
ID string `gorm:"primaryKey" json:"id"`
Code string `gorm:"not null" json:"code"`
Code string `gorm:"not null;unique" json:"code"`
Name string `gorm:"not null" json:"name"`
CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP"`
UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP"`