mirror of
https://github.com/cloudreve/Cloudreve.git
synced 2026-11-17 22:58:07 +00:00
Modify: add unique index for folder & file
This commit is contained in:
1 parent
b3f13c56bc
commit
ceb25ce1c3
6 files changed
+16
-17
No files matched your search
+4
-3
@@ -140,9 +140,10 @@ func (user *User) BeforeSave() (err error) {
|
||||
func (user *User) AfterCreate(tx *gorm.DB) (err error) {
|
||||
// 创建用户的默认根目录
|
||||
defaultFolder := &Folder{
|
||||
Name: "根目录",
|
||||
Position: ".",
|
||||
OwnerID: user.ID,
|
||||
Name: "根目录",
|
||||
Position: ".",
|
||||
OwnerID: user.ID,
|
||||
PositionAbsolute: "/",
|
||||
}
|
||||
tx.Create(defaultFolder)
|
||||
return err
|
||||
|
||||
Reference in new issue
Block a user