diff options
author | zeripath <art27@cantab.net> | 2022-06-19 19:07:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-19 20:07:18 +0200 |
commit | 62cb3c8c85f4721a1d2cf04762d2a8bab062bbd3 (patch) | |
tree | 931dca1cd68ff1653e91f2a5eeaa20e7075625b7 /models/migrations | |
parent | 05a74e6e22984d31c61f38b1174882cf19b1f81c (diff) | |
download | gitea-62cb3c8c85f4721a1d2cf04762d2a8bab062bbd3.tar.gz gitea-62cb3c8c85f4721a1d2cf04762d2a8bab062bbd3.zip |
Simplify and fix migration 216 (#20035)
There appears to be a strange bug whereby the comment_id index can sometimes be missed
or missing from the action table despite the sync2 that should create it in the earlier
part of this migration. However, looking through the code for Sync2 there is no need
for this pre-code to exist and Sync2 should drop/create the indices as necessary.
I think therefore we should simplify the migration to simply be Sync2.
Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'models/migrations')
-rw-r--r-- | models/migrations/v216.go | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/models/migrations/v216.go b/models/migrations/v216.go index b011c11d95..67c360016d 100644 --- a/models/migrations/v216.go +++ b/models/migrations/v216.go @@ -42,26 +42,5 @@ func (a *improveActionTableIndicesAction) TableIndices() []*schemas.Index { } func improveActionTableIndices(x *xorm.Engine) error { - { - type Action struct { - ID int64 `xorm:"pk autoincr"` - UserID int64 `xorm:"INDEX"` // Receiver user id. - OpType int - ActUserID int64 `xorm:"INDEX"` // Action user id. - RepoID int64 `xorm:"INDEX"` - CommentID int64 `xorm:"INDEX"` - IsDeleted bool `xorm:"INDEX NOT NULL DEFAULT false"` - RefName string - IsPrivate bool `xorm:"INDEX NOT NULL DEFAULT false"` - Content string `xorm:"TEXT"` - CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` - } - if err := x.Sync2(&Action{}); err != nil { - return err - } - if err := x.DropIndexes(&Action{}); err != nil { - return err - } - } return x.Sync2(&improveActionTableIndicesAction{}) } |