minor adjustments
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-10-02 08:29:49 +10:00
parent 3bc7f922d3
commit b9c1f65971
6 changed files with 41 additions and 16 deletions

View File

@@ -13,7 +13,7 @@ import (
const cleanupUpdates = `-- name: CleanupUpdates :exec
DELETE FROM "Updates"
WHERE "UpdateType" = ?1 AND "UpdateTime" <= ?2
RETURNING Uid, InventoryId, UpdateTime, UpdateType, NewVcpus, NewRam, NewResourcePool, EventKey, EventId, NewProvisionedDisk, UserName
RETURNING Uid, InventoryId, UpdateTime, UpdateType, NewVcpus, NewRam, NewResourcePool, EventKey, EventId, NewProvisionedDisk, UserName, PlaceholderChange
`
type CleanupUpdatesParams struct {
@@ -210,11 +210,11 @@ func (q *Queries) CreateInventoryHistory(ctx context.Context, arg CreateInventor
const createUpdate = `-- name: CreateUpdate :one
INSERT INTO "Updates" (
"InventoryId", "EventKey", "EventId", "UpdateTime", "UpdateType", "NewVcpus", "NewRam", "NewResourcePool", "NewProvisionedDisk", "UserName"
"InventoryId", "EventKey", "EventId", "UpdateTime", "UpdateType", "NewVcpus", "NewRam", "NewResourcePool", "NewProvisionedDisk", "UserName", "PlaceholderChange"
) VALUES(
?, ?, ?, ?, ?, ?, ?, ?, ?, ?
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?
)
RETURNING Uid, InventoryId, UpdateTime, UpdateType, NewVcpus, NewRam, NewResourcePool, EventKey, EventId, NewProvisionedDisk, UserName
RETURNING Uid, InventoryId, UpdateTime, UpdateType, NewVcpus, NewRam, NewResourcePool, EventKey, EventId, NewProvisionedDisk, UserName, PlaceholderChange
`
type CreateUpdateParams struct {
@@ -228,6 +228,7 @@ type CreateUpdateParams struct {
NewResourcePool sql.NullString
NewProvisionedDisk sql.NullFloat64
UserName sql.NullString
PlaceholderChange sql.NullString
}
func (q *Queries) CreateUpdate(ctx context.Context, arg CreateUpdateParams) (Updates, error) {
@@ -242,6 +243,7 @@ func (q *Queries) CreateUpdate(ctx context.Context, arg CreateUpdateParams) (Upd
arg.NewResourcePool,
arg.NewProvisionedDisk,
arg.UserName,
arg.PlaceholderChange,
)
var i Updates
err := row.Scan(
@@ -256,6 +258,7 @@ func (q *Queries) CreateUpdate(ctx context.Context, arg CreateUpdateParams) (Upd
&i.EventId,
&i.NewProvisionedDisk,
&i.UserName,
&i.PlaceholderChange,
)
return i, err
}
@@ -566,7 +569,7 @@ func (q *Queries) GetReportInventory(ctx context.Context) ([]Inventory, error) {
}
const getReportUpdates = `-- name: GetReportUpdates :many
SELECT Uid, InventoryId, UpdateTime, UpdateType, NewVcpus, NewRam, NewResourcePool, EventKey, EventId, NewProvisionedDisk, UserName FROM "Updates"
SELECT Uid, InventoryId, UpdateTime, UpdateType, NewVcpus, NewRam, NewResourcePool, EventKey, EventId, NewProvisionedDisk, UserName, PlaceholderChange FROM "Updates"
ORDER BY "UpdateTime"
`
@@ -591,6 +594,7 @@ func (q *Queries) GetReportUpdates(ctx context.Context) ([]Updates, error) {
&i.EventId,
&i.NewProvisionedDisk,
&i.UserName,
&i.PlaceholderChange,
); err != nil {
return nil, err
}