add temp cleanup function
Some checks are pending
CI / Test (push) Waiting to run
CI / Lint (push) Waiting to run
CI / End-to-End (push) Waiting to run
CI / Publish Docker (push) Blocked by required conditions
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-09-30 12:26:52 +10:00
parent ea63ffa178
commit 9802419713
4 changed files with 146 additions and 0 deletions

View File

@@ -22,6 +22,10 @@ WHERE "VmId" = sqlc.arg('vmId') AND "Datacenter" = sqlc.arg('datacenterName');
SELECT * FROM "Inventory"
WHERE "VmUuid" = sqlc.arg('vmUuid') AND "Datacenter" = sqlc.arg('datacenterName');
-- name: GetInventoryVcUrl :many
SELECT * FROM "Inventory"
WHERE "Vcenter" = sqlc.arg('vc');
-- name: GetInventoryEventId :one
SELECT * FROM "Inventory"
WHERE "CloudId" = ? LIMIT 1;
@@ -44,6 +48,11 @@ DELETE FROM "Inventory"
WHERE "VmId" = sqlc.arg('vmId') AND "Datacenter" = sqlc.arg('datacenterName')
RETURNING *;
-- name: InventoryCleanupVcenter :exec
DELETE FROM "Inventory"
WHERE "Vcenter" = sqlc.arg('vc')
RETURNING *;
-- name: CreateUpdate :one
INSERT INTO "Updates" (
"InventoryId", "EventKey", "EventId", "UpdateTime", "UpdateType", "NewVcpus", "NewRam", "NewResourcePool", "NewProvisionedDisk", "UserName"