2024-10-13 13:31:58 +04:00

25 lines
453 B
Go

package models
import (
"time"
"github.com/google/uuid"
)
const (
UserTableName = "users"
)
type User struct {
ID uuid.UUID `gorm:"primarykey;unique;type:uuid;default:gen_random_uuid()"`
Username string `gorm:"unique;not null;size:50"`
Email string `gorm:"unique;not null"`
Password string `gorm:"not null;size:72"`
CreatedAt time.Time
UpdatedAt time.Time
}
func (u User) TableName() string {
return UserTableName
}