add temp endpoint for db cleanup
Some checks are pending
CI / Lint (push) Waiting to run
CI / Test (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-26 12:15:39 +10:00
parent 3b53455343
commit dd13fd6759
5 changed files with 77 additions and 14 deletions

View File

@@ -35,6 +35,11 @@ INSERT INTO "Updates" (
)
RETURNING *;
-- name: CleanupUpdates :exec
DELETE FROM "Updates"
WHERE "UpdateType" = sqlc.arg('updateType') AND "UpdateTime" <= sqlc.arg('updateTime')
RETURNING *;
-- name: CreateEvent :one
INSERT INTO "Events" (
"CloudId", "Source", "EventTime", "ChainId", "VmId", "VmName", "EventKey", "DatacenterId", "DatacenterName", "ComputeResourceId", "ComputeResourceName", "UserName"