File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -7,22 +7,22 @@ import (
77 "testing"
88
99 "code.gitea.io/gitea/models/migrations/base"
10+
11+ "github.com/stretchr/testify/assert"
1012)
1113
1214func Test_AddCombinedIndexToIssueUser (t * testing.T ) {
13- type IssueUser struct {
14- UID int64 `xorm:"INDEX unique(uid_to_issue)"` // User ID.
15- IssueID int64 `xorm:"INDEX unique(uid_to_issue)"`
15+ type IssueUser struct { // old struct
16+ ID int64 `xorm:"pk autoincr"`
17+ UID int64 `xorm:"INDEX"` // User ID.
18+ IssueID int64 `xorm:"INDEX"`
19+ IsRead bool
20+ IsMentioned bool
1621 }
1722
1823 // Prepare and load the testing database
1924 x , deferable := base .PrepareTestEnv (t , 0 , new (IssueUser ))
2025 defer deferable ()
21- if x == nil || t .Failed () {
22- return
23- }
2426
25- if err := AddCombinedIndexToIssueUser (x ); err != nil {
26- t .Fatal (err )
27- }
27+ assert .NoError (t , AddCombinedIndexToIssueUser (x ))
2828}
You can’t perform that action at this time.
0 commit comments