Commit 5a2749e 1 parent 642fc60 commit 5a2749e Copy full SHA for 5a2749e
File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ type ShareID struct {
45
45
type BaseModel struct {
46
46
// Id has to be called Id and not ID, otherwise the foreign key will not work
47
47
// ID is a special field in GORM, which it uses as the default Primary Key
48
- Id uint `gorm:"uniqueIndex ;not null"`
48
+ Id uint `gorm:"primaryKey ;not null;autoIncrement:false "`
49
49
ShareId ShareID `gorm:"foreignKey:Id;references:ID;constraint:OnDelete:CASCADE"` //;references:ID
50
50
CreatedAt time.Time
51
51
UpdatedAt time.Time
@@ -62,23 +62,23 @@ type ProtoShare struct {
62
62
UIDInitiator string `gorm:"size:64;index"`
63
63
ItemType ItemType `gorm:"size:16;index"` // file | folder | reference | symlink
64
64
InitialPath string
65
- Inode string `gorm:"primaryKey; size:32;index"`
66
- Instance string `gorm:"primaryKey; size:32;index"`
65
+ Inode string `gorm:"size:32;index"`
66
+ Instance string `gorm:"size:32;index"`
67
67
Permissions uint8
68
68
Orphan bool
69
69
Expiration datatypes.NullTime
70
70
}
71
71
72
72
type Share struct {
73
73
ProtoShare
74
- ShareWith string `gorm:"primaryKey; size:255;index:i_share_with"` // 255 because this can be a lw account, which are mapped from email addresses / ...
74
+ ShareWith string `gorm:"size:255;index:i_share_with"` // 255 because this can be a lw account, which are mapped from email addresses / ...
75
75
SharedWithIsGroup bool
76
76
Description string `gorm:"size:1024"`
77
77
}
78
78
79
79
type PublicLink struct {
80
80
ProtoShare
81
- Token string `gorm:"primaryKey;index :i_token"`
81
+ Token string `gorm:"uniqueIndex :i_token;size:16 "`
82
82
Quicklink bool
83
83
NotifyUploads bool
84
84
NotifyUploadsExtraRecipients string
You can’t perform that action at this time.
0 commit comments