mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: rename 'last_used_at' column (#26749)
Renames the `last_used_at` column to `last_heartbeat_at` in `ai_gateway_keys` table. `ai_gateway_keys` table has not been released yet. All references updated.
This commit is contained in:
@@ -4,13 +4,13 @@ VALUES ($1, @name, $2, $3, NOW())
|
||||
RETURNING id, name, secret_prefix, created_at;
|
||||
|
||||
-- name: ListAIGatewayKeys :many
|
||||
SELECT id, name, secret_prefix, created_at, last_used_at
|
||||
SELECT id, name, secret_prefix, created_at, last_heartbeat_at
|
||||
FROM ai_gateway_keys
|
||||
ORDER BY created_at ASC;
|
||||
|
||||
-- name: DeleteAIGatewayKey :one
|
||||
DELETE FROM ai_gateway_keys WHERE id = $1
|
||||
RETURNING id, name, secret_prefix, created_at, last_used_at;
|
||||
RETURNING id, name, secret_prefix, created_at, last_heartbeat_at;
|
||||
|
||||
-- name: GetAIGatewayKeyByHashedSecret :one
|
||||
-- Authenticates a standalone AI Gateway replica by its hashed key secret,
|
||||
@@ -20,10 +20,10 @@ SELECT *
|
||||
FROM ai_gateway_keys
|
||||
WHERE hashed_secret = $1;
|
||||
|
||||
-- name: UpdateAIGatewayKeyLastUsedAt :execrows
|
||||
-- Records liveness for an active Gateway DRPC session. The database sets the
|
||||
-- name: UpdateAIGatewayKeyLastHeartbeatAt :execrows
|
||||
-- Records heartbeat liveness for an active Gateway DRPC session. The database sets the
|
||||
-- timestamp so it stays consistent regardless of clock drift between API
|
||||
-- replicas.
|
||||
UPDATE ai_gateway_keys
|
||||
SET last_used_at = NOW()
|
||||
SET last_heartbeat_at = NOW()
|
||||
WHERE id = $1;
|
||||
|
||||
Reference in New Issue
Block a user