init
This commit is contained in:
19
models/attachment.go
Normal file
19
models/attachment.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type Attachment struct {
|
||||
ID uuid.UUID `gorm:"primaryKey" json:"id"`
|
||||
MessageID uuid.UUID `gorm:"index;not null" json:"message_id"`
|
||||
Filename string `gorm:"not null" json:"filename"`
|
||||
FileSize int64 `gorm:"not null" json:"file_size"`
|
||||
MimeType string `gorm:"not null" json:"mime_type"`
|
||||
CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
|
||||
|
||||
// Relation optionnelle vers le message
|
||||
Message *Message `gorm:"foreignKey:MessageID" json:"message,omitempty"`
|
||||
}
|
||||
Reference in New Issue
Block a user