package entities

import "time"

type Document struct {
	Id               uint      `gorm:"primaryKey"`
	DocumentableType string    `gorm:"size:50;not null;index:documents_documentable_polymorphic,priority:1"`
	DocumentableId   uint64    `gorm:"not null;index:documents_documentable_polymorphic,priority:2"`
	Type             string    `gorm:"size:50;not null"`
	Path             string    `gorm:"size:255;not null"`
	Name             string    `gorm:"size:50;not null"`
	Ext              string    `gorm:"size:50;not null"`
	Size             float64   `gorm:"type:numeric(15,3);not null"`
	CreatedBy        *uint     `gorm:"index"`
	CreatedAt        time.Time `gorm:"autoCreateTime"`

	CreatedUser *User `gorm:"foreignKey:CreatedBy;references:Id"`
}
