From dd857650e07b6f622b3a7636fb08962be46f1dcf Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sun, 21 Jan 2024 01:41:04 -0500 Subject: [PATCH] fix: need create a compound index on hash and deleted at --- db/models/tus_upload.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/db/models/tus_upload.go b/db/models/tus_upload.go index ff150c7..e738883 100644 --- a/db/models/tus_upload.go +++ b/db/models/tus_upload.go @@ -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"` }