init
This commit is contained in:
20
models/server_user.go
Normal file
20
models/server_user.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type ServerUser struct {
|
||||
ID uuid.UUID `gorm:"primaryKey" json:"id"`
|
||||
ServerID uuid.UUID `gorm:"index;not null" json:"server_id"`
|
||||
UserID uuid.UUID `gorm:"index;not null" json:"user_id"`
|
||||
Username *string `json:"username,omitempty"` // Option<String> = pointeur nullable
|
||||
JoinedAt time.Time `gorm:"autoCreateTime" json:"joined_at"`
|
||||
UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updated_at"`
|
||||
|
||||
// Relations pour navigation (optionnelles)
|
||||
Server *Server `gorm:"foreignKey:ServerID" json:"server,omitempty"`
|
||||
User *User `gorm:"foreignKey:UserID" json:"user,omitempty"`
|
||||
}
|
||||
Reference in New Issue
Block a user