diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2023-12-30 21:54:48 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-30 21:54:48 +0800 |
commit | cb10f2767c920fdbca6fc43e71dcc4c4b8c6e0d0 (patch) | |
tree | 358ced9f4245fece37b1fc6301e02d92b90b521b /models/migrations | |
parent | e5d8c4b8d4864661caa43516d5937be42bf27f7c (diff) | |
download | gitea-cb10f2767c920fdbca6fc43e71dcc4c4b8c6e0d0.tar.gz gitea-cb10f2767c920fdbca6fc43e71dcc4c4b8c6e0d0.zip |
Fix migration test (#28659)
Diffstat (limited to 'models/migrations')
-rw-r--r-- | models/migrations/v1_22/v283_test.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/models/migrations/v1_22/v283_test.go b/models/migrations/v1_22/v283_test.go index 864f47f840..e89a7cbfc2 100644 --- a/models/migrations/v1_22/v283_test.go +++ b/models/migrations/v1_22/v283_test.go @@ -7,22 +7,22 @@ import ( "testing" "code.gitea.io/gitea/models/migrations/base" + + "github.com/stretchr/testify/assert" ) func Test_AddCombinedIndexToIssueUser(t *testing.T) { - type IssueUser struct { - UID int64 `xorm:"INDEX unique(uid_to_issue)"` // User ID. - IssueID int64 `xorm:"INDEX unique(uid_to_issue)"` + type IssueUser struct { // old struct + ID int64 `xorm:"pk autoincr"` + UID int64 `xorm:"INDEX"` // User ID. + IssueID int64 `xorm:"INDEX"` + IsRead bool + IsMentioned bool } // Prepare and load the testing database x, deferable := base.PrepareTestEnv(t, 0, new(IssueUser)) defer deferable() - if x == nil || t.Failed() { - return - } - if err := AddCombinedIndexToIssueUser(x); err != nil { - t.Fatal(err) - } + assert.NoError(t, AddCombinedIndexToIssueUser(x)) } |