All checks were successful
continuous-integration/drone/push Build is passing
59 lines
1.5 KiB
SQL
59 lines
1.5 KiB
SQL
-- name: ListIncoming :many
|
|
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"
|
|
) VALUES(
|
|
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?
|
|
)
|
|
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"
|
|
) 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 *; |