mirror of
https://codeberg.org/forgejo/forgejo
synced 2024-11-22 09:54:24 +01:00
4de909747b
go-require lint is ignored for now Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4535 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Co-authored-by: TheFox0x7 <thefox0x7@gmail.com> Co-committed-by: TheFox0x7 <thefox0x7@gmail.com>
29 lines
685 B
Go
29 lines
685 B
Go
// Copyright 2023 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package v1_22 //nolint
|
|
|
|
import (
|
|
"testing"
|
|
|
|
migration_tests "code.gitea.io/gitea/models/migrations/test"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func Test_AddCombinedIndexToIssueUser(t *testing.T) {
|
|
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 := migration_tests.PrepareTestEnv(t, 0, new(IssueUser))
|
|
defer deferable()
|
|
|
|
require.NoError(t, AddCombinedIndexToIssueUser(x))
|
|
}
|