enhance implementation
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
SELECT * FROM "Incoming"
|
||||
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"
|
||||
@@ -12,6 +11,49 @@ INSERT INTO "Incoming" (
|
||||
RETURNING *;
|
||||
|
||||
-- name: CreateIncident :one
|
||||
INSERT INTO incidents (external_id)
|
||||
VALUES (?)
|
||||
RETURNING id;
|
||||
INSERT INTO incidents (
|
||||
"description", "short_description", "urgency", "impact", "state", "external_id", "assignment_group", "assigned_to", "category", "subcategory", "created_at", "sys_id"
|
||||
) VALUES(
|
||||
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?
|
||||
)
|
||||
RETURNING *;
|
||||
|
||||
-- name: UpdateIncidentNumber :exec
|
||||
UPDATE incidents
|
||||
SET incident_number = sqlc.arg('incidentNumber')
|
||||
WHERE external_id = sqlc.arg('externalId');
|
||||
|
||||
-- name: UpdateIncidentState :exec
|
||||
UPDATE incidents
|
||||
SET state = sqlc.arg('state')
|
||||
WHERE incident_number = sqlc.arg('incidentNumber');
|
||||
|
||||
-- name: UpdateIncident :exec
|
||||
UPDATE incidents
|
||||
SET
|
||||
external_id = ?,
|
||||
description = ?,
|
||||
short_description = ?,
|
||||
urgency = ?,
|
||||
impact = ?,
|
||||
state = ?,
|
||||
assignment_group = ?,
|
||||
assigned_to = ?,
|
||||
category = ?,
|
||||
subcategory = ?
|
||||
WHERE incident_number = ?;
|
||||
|
||||
-- name: GetIncident :one
|
||||
SELECT * from incidents
|
||||
WHERE incident_number = sqlc.arg('incidentNumber');
|
||||
|
||||
-- name: ListIncidents :many
|
||||
SELECT * FROM incidents;
|
||||
|
||||
-- name: CreateWorkNote :one
|
||||
INSERT into worknotes (
|
||||
"incident_number", "note"
|
||||
) VALUES(
|
||||
?, ?
|
||||
)
|
||||
RETURNING *;
|
Reference in New Issue
Block a user