mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-28 19:01:57 +08:00
Add: model/file
This commit is contained in:
17
models/file.go
Normal file
17
models/file.go
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
package model
|
||||||
|
|
||||||
|
import "github.com/jinzhu/gorm"
|
||||||
|
|
||||||
|
// File 文件
|
||||||
|
type File struct {
|
||||||
|
// 表字段
|
||||||
|
gorm.Model
|
||||||
|
Name string
|
||||||
|
SourceName string
|
||||||
|
UserID uint
|
||||||
|
Size uint64
|
||||||
|
PicInfo string
|
||||||
|
FolderID uint
|
||||||
|
PolicyID uint
|
||||||
|
Dir string `gorm:"size:65536"`
|
||||||
|
}
|
||||||
@@ -25,7 +25,7 @@ func migration() {
|
|||||||
util.Log().Info("开始进行数据库自动迁移...")
|
util.Log().Info("开始进行数据库自动迁移...")
|
||||||
|
|
||||||
// 自动迁移模式
|
// 自动迁移模式
|
||||||
DB.Set("gorm:table_options", "ENGINE=InnoDB").AutoMigrate(&User{}, &Setting{}, &Group{}, &Policy{}, &Folder{})
|
DB.Set("gorm:table_options", "ENGINE=InnoDB").AutoMigrate(&User{}, &Setting{}, &Group{}, &Policy{}, &Folder{}, &File{})
|
||||||
|
|
||||||
// 创建初始存储策略
|
// 创建初始存储策略
|
||||||
addDefaultPolicy()
|
addDefaultPolicy()
|
||||||
|
|||||||
Reference in New Issue
Block a user