mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-03 20:36:07 +01:00 
			
		
		
		
	Move almost all functions' parameter db.Engine to context.Context (#19748)
* Move almost all functions' parameter db.Engine to context.Context * remove some unnecessary wrap functions
This commit is contained in:
		@@ -28,8 +28,8 @@ func init() {
 | 
			
		||||
	db.RegisterModel(new(ProjectIssue))
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func deleteProjectIssuesByProjectID(e db.Engine, projectID int64) error {
 | 
			
		||||
	_, err := e.Where("project_id=?", projectID).Delete(&ProjectIssue{})
 | 
			
		||||
func deleteProjectIssuesByProjectID(ctx context.Context, projectID int64) error {
 | 
			
		||||
	_, err := db.GetEngine(ctx).Where("project_id=?", projectID).Delete(&ProjectIssue{})
 | 
			
		||||
	return err
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -97,7 +97,7 @@ func MoveIssuesOnProjectBoard(board *Board, sortedIssueIDs map[int64]int64) erro
 | 
			
		||||
	})
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (pb *Board) removeIssues(e db.Engine) error {
 | 
			
		||||
	_, err := e.Exec("UPDATE `project_issue` SET project_board_id = 0 WHERE project_board_id = ? ", pb.ID)
 | 
			
		||||
func (pb *Board) removeIssues(ctx context.Context) error {
 | 
			
		||||
	_, err := db.GetEngine(ctx).Exec("UPDATE `project_issue` SET project_board_id = 0 WHERE project_board_id = ? ", pb.ID)
 | 
			
		||||
	return err
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user