Add: model/file
This commit is contained in:
parent
4c1ece4b96
commit
71e668c005
2 changed files with 18 additions and 1 deletions
models
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("开始进行数据库自动迁移...")
|
||||
|
||||
// 自动迁移模式
|
||||
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()
|
||||
|
|
Loading…
Add table
Reference in a new issue