many fixes
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-03-24 23:05:44 +11:00
parent d750033efd
commit a3de1b2b03
10 changed files with 207 additions and 37 deletions

View File

@@ -4,7 +4,7 @@ ORDER BY "id";
-- name: CreateIncoming :one
INSERT INTO "Incoming" (
"incident_number", "description", "short_description", "urgency", "impact", "state", "external_id", "work_notes", "assignment_group", "assigned_to", "category", "subcategory", "created_at"
"incident_number", "description", "short_description", "urgency", "impact", "state", "external_id", "work_notes", "assignment_group", "assigned_to", "category", "sub_category", "created_at"
) VALUES(
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?
)
@@ -12,7 +12,7 @@ RETURNING *;
-- name: CreateIncident :one
INSERT INTO incidents (
"description", "short_description", "urgency", "impact", "state", "external_id", "assignment_group", "assigned_to", "category", "subcategory", "created_at", "sys_id"
"description", "short_description", "urgency", "impact", "state", "external_id", "assignment_group", "assigned_to", "category", "sub_category", "created_at", "sys_id"
) VALUES(
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?
)
@@ -23,6 +23,11 @@ UPDATE incidents
SET incident_number = sqlc.arg('incidentNumber')
WHERE external_id = sqlc.arg('externalId');
-- name: UpdateIncidentNumberSysId :exec
UPDATE incidents
SET incident_number = sqlc.arg('incidentNumber')
WHERE sys_id = sqlc.arg('sysId');
-- name: UpdateIncidentState :exec
UPDATE incidents
SET state = sqlc.arg('state')
@@ -40,7 +45,7 @@ SET
assignment_group = ?,
assigned_to = ?,
category = ?,
subcategory = ?
sub_category = ?
WHERE incident_number = ?;
-- name: GetIncident :one
@@ -52,7 +57,8 @@ SELECT * FROM incidents;
-- name: GetIncidentReport :many
SELECT incidents.*, GROUP_CONCAT(worknotes.note, '<br />') AS all_notes
FROM incidents LEFT JOIN worknotes ON incidents.incident_number = worknotes.incident_number;
FROM incidents LEFT JOIN worknotes ON incidents.incident_number = worknotes.incident_number
GROUP BY incidents.id;
-- name: CreateWorkNote :one
INSERT into worknotes (