replace email with username

This commit is contained in:
2026-07-02 22:40:23 +02:00
parent 532f3f5faa
commit f56196e115
5 changed files with 18 additions and 19 deletions
+8 -8
View File
@@ -3,15 +3,15 @@ package models
import (
"time"
"github.com/google/uuid"
"gorm.io/gorm"
)
type User struct {
ID uint `json:"id" gorm:"primaryKey"`
Username string `json:"username" gorm:"unique;not null"`
Email string `json:"email" gorm:"unique;not null"`
Password string `json:"-" gorm:"not null"` // Don't include in JSON responses
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
}
Uuid uuid.UUID `json:"uuid" gorm:"type:uuid;primaryKey"`
Username string `json:"username" gorm:"unique;not null"`
HashedPassword string `json:"-" gorm:"column:password;not null"` // Don't include in JSON responses
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
}