Modify: remove PositionAbsolute scheme in folder

This commit is contained in:
HFO4
2019-12-01 10:57:44 +08:00
parent 8b3fd8ec66
commit b3f13c56bc
5 changed files with 20 additions and 20 deletions

View File

@@ -9,11 +9,11 @@ import (
type Folder struct {
// 表字段
gorm.Model
Name string
ParentID uint `gorm:"index:parent_id"`
Position string `gorm:"size:65536"`
OwnerID uint `gorm:"index:owner_id"`
PositionAbsolute string `gorm:"size:65536"`
Name string
ParentID uint `gorm:"index:parent_id"`
Position string `gorm:"size:65536"`
OwnerID uint `gorm:"index:owner_id"`
//PositionAbsolute string `gorm:"size:65536"`
}
// Create 创建目录

View File

@@ -140,10 +140,9 @@ func (user *User) BeforeSave() (err error) {
func (user *User) AfterCreate(tx *gorm.DB) (err error) {
// 创建用户的默认根目录
defaultFolder := &Folder{
Name: "根目录",
Position: ".",
OwnerID: user.ID,
PositionAbsolute: "/",
Name: "根目录",
Position: ".",
OwnerID: user.ID,
}
tx.Create(defaultFolder)
return err