1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-08-04 01:16:09 +02:00
forgejo/models/migrations/v1_22/v283_test.go
Renovate Bot 212e8ac348 Update module github.com/golangci/golangci-lint/v2/cmd/golangci-lint to v2.2.1 (forgejo) (#8422)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8422
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-07-05 18:33:45 +02:00

28 lines
668 B
Go

// Copyright 2023 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package v1_22
import (
"testing"
migration_tests "forgejo.org/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))
}