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:
parent
d81e31ad78
commit
fd7d83ace6
232 changed files with 1463 additions and 2108 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue