2023-08-07 03:32:46 +08:00
|
|
|
package models
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
2024-06-04 16:46:03 +08:00
|
|
|
|
|
|
|
"github.com/divyam234/teldrive/pkg/schemas"
|
|
|
|
"gorm.io/datatypes"
|
2023-08-07 03:32:46 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
type File struct {
|
2024-06-04 16:46:03 +08:00
|
|
|
Id string `gorm:"type:text;primaryKey;default:generate_uid(16)"`
|
|
|
|
Name string `gorm:"type:text;not null"`
|
|
|
|
Type string `gorm:"type:text;not null"`
|
|
|
|
MimeType string `gorm:"type:text;not null"`
|
|
|
|
Size *int64 `gorm:"type:bigint"`
|
|
|
|
Starred bool `gorm:"default:false"`
|
|
|
|
Depth *int `gorm:"type:integer"`
|
|
|
|
Category string `gorm:"type:text"`
|
|
|
|
Encrypted bool `gorm:"default:false"`
|
|
|
|
UserID int64 `gorm:"type:bigint;not null"`
|
|
|
|
Status string `gorm:"type:text"`
|
|
|
|
ParentID string `gorm:"type:text;index"`
|
|
|
|
Parts datatypes.JSONSlice[schemas.Part] `gorm:"type:jsonb"`
|
|
|
|
ChannelID *int64 `gorm:"type:bigint"`
|
|
|
|
CreatedAt time.Time `gorm:"default:timezone('utc'::text, now())"`
|
|
|
|
UpdatedAt time.Time `gorm:"default:timezone('utc'::text, now())"`
|
2023-08-07 03:32:46 +08:00
|
|
|
}
|