init
This commit is contained in:
24
internal/adapter/storages/postgres/models/user.go
Normal file
24
internal/adapter/storages/postgres/models/user.go
Normal file
@@ -0,0 +1,24 @@
|
||||
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
|
||||
}
|
Reference in New Issue
Block a user