@@ -30,7 +30,7 @@ type Attachment struct {
3030 Name string
3131 DownloadCount int64 `xorm:"DEFAULT 0"`
3232 Status db.FileStatus `xorm:"DEFAULT 1 NOT NULL"` // 1 = normal, 2 = to be deleted
33- DeleteFailedCount int `xorm:"DEFAULT 0"` // Number of times the deletion failed, used to prevent infinite loop
33+ DeleteFailedCount int `xorm:"DEFAULT 0 NOT NULL"` // Number of times the deletion failed, used to prevent infinite loop
3434 LastDeleteFailedReason string `xorm:"TEXT"` // Last reason the deletion failed, used to prevent infinite loop
3535 LastDeleteFailedTime timeutil.TimeStamp // Last time the deletion failed, used to prevent infinite loop
3636 Size int64 `xorm:"DEFAULT 0"`
@@ -40,28 +40,28 @@ type Attachment struct {
4040
4141// TableIndices implements xorm's TableIndices interface
4242func (a * Attachment ) TableIndices () []* schemas.Index {
43- uuidIndex := schemas .NewIndex ("attachment_uuid " , schemas .UniqueType )
43+ uuidIndex := schemas .NewIndex ("uuid " , schemas .UniqueType )
4444 uuidIndex .AddColumn ("uuid" )
4545
46- repoIndex := schemas .NewIndex ("attachment_repo_id " , schemas .IndexType )
46+ repoIndex := schemas .NewIndex ("repo_id " , schemas .IndexType )
4747 repoIndex .AddColumn ("repo_id" )
4848
49- issueIndex := schemas .NewIndex ("attachment_issue_id " , schemas .IndexType )
49+ issueIndex := schemas .NewIndex ("issue_id " , schemas .IndexType )
5050 issueIndex .AddColumn ("issue_id" )
5151
52- releaseIndex := schemas .NewIndex ("attachment_release_id " , schemas .IndexType )
52+ releaseIndex := schemas .NewIndex ("release_id " , schemas .IndexType )
5353 releaseIndex .AddColumn ("release_id" )
5454
55- uploaderIndex := schemas .NewIndex ("attachment_uploader_id " , schemas .IndexType )
55+ uploaderIndex := schemas .NewIndex ("uploader_id " , schemas .IndexType )
5656 uploaderIndex .AddColumn ("uploader_id" )
5757
58- commentIndex := schemas .NewIndex ("attachment_comment_id " , schemas .IndexType )
58+ commentIndex := schemas .NewIndex ("comment_id " , schemas .IndexType )
5959 commentIndex .AddColumn ("comment_id" )
6060
61- statusIndex := schemas .NewIndex ("attachment_status " , schemas .IndexType )
61+ statusIndex := schemas .NewIndex ("status " , schemas .IndexType )
6262 statusIndex .AddColumn ("status" )
6363
64- statusIDIndex := schemas .NewIndex ("attachment_status_id " , schemas .IndexType )
64+ statusIDIndex := schemas .NewIndex ("status_id " , schemas .IndexType )
6565 statusIDIndex .AddColumn ("status" , "id" ) // For status = ? AND id > ? query
6666
6767 return []* schemas.Index {
0 commit comments