File tree 1 file changed +9
-9
lines changed
1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -7,22 +7,22 @@ import (
7
7
"testing"
8
8
9
9
"code.gitea.io/gitea/models/migrations/base"
10
+
11
+ "github.com/stretchr/testify/assert"
10
12
)
11
13
12
14
func 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
16
21
}
17
22
18
23
// Prepare and load the testing database
19
24
x , deferable := base .PrepareTestEnv (t , 0 , new (IssueUser ))
20
25
defer deferable ()
21
- if x == nil || t .Failed () {
22
- return
23
- }
24
26
25
- if err := AddCombinedIndexToIssueUser (x ); err != nil {
26
- t .Fatal (err )
27
- }
27
+ assert .NoError (t , AddCombinedIndexToIssueUser (x ))
28
28
}
You can’t perform that action at this time.
0 commit comments