fix: need create a compound index on hash and deleted at

This commit is contained in:
Derrick Hammer 2024-01-21 01:41:04 -05:00
parent d86e0e0105
commit dd857650e0
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 2 additions and 1 deletions

View File

@ -4,10 +4,11 @@ import "gorm.io/gorm"
type TusUpload struct {
gorm.Model
Hash string `gorm:"uniqueIndex"`
Hash string `gorm:"uniqueIndex:idx_hash_deleted"`
UploadID string `gorm:"uniqueIndex"`
UploaderID uint
UploaderIP string
Uploader User `gorm:"foreignKey:UploaderID"`
Protocol string
DeletedAt gorm.DeletedAt `gorm:"uniqueIndex:idx_hash_deleted"`
}