Skip to content

Commit b12271f

Browse files
fix: make sql query PostgreSQL compatible (#8167)
1 parent dc6698d commit b12271f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

backend/plugins/dora/tasks/incident_from_issue_generator.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ func ConvertIssuesToIncidents(taskCtx plugin.SubTaskContext) errors.Error {
5757
FROM issues i
5858
LEFT JOIN board_issues bi ON bi.issue_id = i.id
5959
LEFT JOIN project_mapping pm ON pm.row_id = bi.board_id
60-
WHERE i.type = "INCIDENT"
60+
WHERE i.type = ?
6161
AND pm.project_name = ?
62-
AND pm.table = "boards")
62+
AND pm.table = ?)
6363
`
64-
if err := db.Exec(deleteIncidentsSql, data.Options.ProjectName); err != nil {
64+
if err := db.Exec(deleteIncidentsSql, "INCIDENT", data.Options.ProjectName, "boards"); err != nil {
6565
return errors.Default.Wrap(err, "error deleting previous incidents")
6666

6767
}
@@ -73,11 +73,11 @@ func ConvertIssuesToIncidents(taskCtx plugin.SubTaskContext) errors.Error {
7373
FROM issues i
7474
LEFT JOIN board_issues bi ON bi.issue_id = i.id
7575
LEFT JOIN project_mapping pm ON pm.row_id = bi.board_id
76-
WHERE i.type = "INCIDENT"
76+
WHERE i.type = ?
7777
AND pm.project_name = ?
78-
AND pm.table = "boards")
78+
AND pm.table = ?)
7979
`
80-
if err := db.Exec(deleteIncidentAssigneesSql, data.Options.ProjectName); err != nil {
80+
if err := db.Exec(deleteIncidentAssigneesSql, "INCIDENT", data.Options.ProjectName, "boards"); err != nil {
8181
return errors.Default.Wrap(err, "error deleting previous incident_assignees")
8282
}
8383

0 commit comments

Comments
 (0)