mirror of
				https://codeberg.org/forgejo/forgejo.git
				synced 2025-10-31 14:31:02 +00:00 
			
		
		
		
	- Massive replacement of changing `code.gitea.io/gitea` to `forgejo.org`. - Resolves forgejo/discussions#258 Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7337 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Reviewed-by: Michael Kriese <michael.kriese@gmx.de> Reviewed-by: Beowulf <beowulf@beocode.eu> Reviewed-by: Panagiotis "Ivory" Vasilopoulos <git@n0toose.net> Co-authored-by: Gusted <postmaster@gusted.xyz> Co-committed-by: Gusted <postmaster@gusted.xyz>
		
			
				
	
	
		
			28 lines
		
	
	
	
		
			677 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
	
		
			677 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| // Copyright 2023 The Gitea Authors. All rights reserved.
 | |
| // SPDX-License-Identifier: MIT
 | |
| 
 | |
| package v1_22 //nolint
 | |
| 
 | |
| 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))
 | |
| }
 |