fix: need create a compound index on hash and deleted at
This commit is contained in:
parent
d86e0e0105
commit
dd857650e0
|
@ -4,10 +4,11 @@ import "gorm.io/gorm"
|
||||||
|
|
||||||
type TusUpload struct {
|
type TusUpload struct {
|
||||||
gorm.Model
|
gorm.Model
|
||||||
Hash string `gorm:"uniqueIndex"`
|
Hash string `gorm:"uniqueIndex:idx_hash_deleted"`
|
||||||
UploadID string `gorm:"uniqueIndex"`
|
UploadID string `gorm:"uniqueIndex"`
|
||||||
UploaderID uint
|
UploaderID uint
|
||||||
UploaderIP string
|
UploaderIP string
|
||||||
Uploader User `gorm:"foreignKey:UploaderID"`
|
Uploader User `gorm:"foreignKey:UploaderID"`
|
||||||
Protocol string
|
Protocol string
|
||||||
|
DeletedAt gorm.DeletedAt `gorm:"uniqueIndex:idx_hash_deleted"`
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue