This is an automated email from the ASF dual-hosted git repository. lynwee pushed a commit to branch lw-debug-zentao in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
commit a1ab04ae8875fb5fd7ccc0361ed089e8f1771160 Author: Lynwee Hou <[email protected]> AuthorDate: Fri Feb 23 12:10:36 2024 +0800 fix(zentao): update sql when generating table issue_changelogs --- backend/plugins/zentao/tasks/changelog_convertor.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/backend/plugins/zentao/tasks/changelog_convertor.go b/backend/plugins/zentao/tasks/changelog_convertor.go index 6269b7bfb..61d3d1ec5 100644 --- a/backend/plugins/zentao/tasks/changelog_convertor.go +++ b/backend/plugins/zentao/tasks/changelog_convertor.go @@ -81,10 +81,9 @@ func ConvertChangelog(taskCtx plugin.SubTaskContext) errors.Error { cursor, err := db.Cursor( dal.Select(fmt.Sprintf("*,%s.id cid,%s.id cdid,%s.id aid ", cn, cdn, an)), dal.From(&models.ZentaoChangelog{}), - dal.Join(fmt.Sprintf("LEFT JOIN %s on %s.changelog_id = %s.id", cdn, cdn, cn)), - dal.Join(fmt.Sprintf("LEFT JOIN %s on %s.realname = %s.actor", an, an, cn)), - dal.Where(fmt.Sprintf(`%s.project = ? and %s.connection_id = ?`, - cn, cn), + dal.Join(fmt.Sprintf("LEFT JOIN %s on %s.changelog_id = %s.id and %s.connection_id = %d", cdn, cdn, cn, cdn, data.Options.ConnectionId)), + dal.Join(fmt.Sprintf("LEFT JOIN %s on %s.realname = %s.actor and %s.connection_id = %d", an, an, cn, an, data.Options.ConnectionId)), + dal.Where(fmt.Sprintf(`%s.project = ? and %s.connection_id = ?`, cn, cn), data.Options.ProjectId, data.Options.ConnectionId), )
