Skip to content

Commit

Permalink
Add indexes to db
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegeens committed Feb 7, 2025
1 parent 85099fb commit 3f27993
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions share/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,25 @@ type ProtoShare struct {
gorm.Model
UIDOwner string `gorm:"size:64"`
UIDInitiator string `gorm:"size:64"`
ItemType ItemType `gorm:"size:16"` // file | folder | reference | symlink
ItemType ItemType `gorm:"size:16;index:i_item_type"` // file | folder | reference | symlink
InitialPath string
Inode string `gorm:"size:32"`
Instance string `gorm:"size:32"`
Inode string `gorm:"size:32;index:i_inode"`
Instance string `gorm:"size:32;index:i_instance"`
Permissions uint8
Orphan bool
Expiration datatypes.NullTime
}

type Share struct {
ProtoShare
ShareWith string `gorm:"size:255"` // 255 because this can be a lw account, which are mapped from email addresses
ShareWith string `gorm:"size:255;index:i_share_with"` // 255 because this can be a lw account, which are mapped from email addresses / ...
SharedWithIsGroup bool
Description string `gorm:"size:1024"`
}

type PublicLink struct {
ProtoShare
Token string
Token string `gorm:"index:i_token"`
// Enforce uniqueness in db re: Itemsource
Quicklink bool
NotifyUploads bool
Expand Down

0 comments on commit 3f27993

Please sign in to comment.