narasiahli-be/app/database/entity/chat_schedule_files.entity.go

24 lines
1.1 KiB
Go

package entity
import (
"time"
)
type ChatScheduleFiles struct {
ID uint `json:"id" gorm:"primaryKey;type:int4;autoIncrement"`
ChatScheduleID uint `json:"chat_schedule_id" gorm:"type:int4;not null;index"`
FileName string `json:"file_name" gorm:"type:varchar(255);not null"`
OriginalName string `json:"original_name" gorm:"type:varchar(255);not null"`
FilePath string `json:"file_path" gorm:"type:varchar(500);not null"`
FileSize int64 `json:"file_size" gorm:"type:int8"`
MimeType string `json:"mime_type" gorm:"type:varchar(100)"`
FileType string `json:"file_type" gorm:"type:varchar(20);not null;check:file_type IN ('article', 'journal', 'video', 'audio', 'document', 'other')"`
Description string `json:"description" gorm:"type:text"`
IsRequired bool `json:"is_required" gorm:"default:false"`
CreatedAt time.Time `json:"created_at" gorm:"default:now()"`
UpdatedAt time.Time `json:"updated_at" gorm:"default:now()"`
// Relationships
ChatSchedule *ChatSchedules `json:"chat_schedule" gorm:"foreignKey:ChatScheduleID;references:ID"`
}