mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore(db): remove 23 unused database methods (#22999)
Removes 22 database query methods with no callers outside generated code and the dbauthz wrapper layer (~1,600 lines). **Security keys (6)** — superseded by `cryptokeys` package: `GetAppSecurityKey`, `UpsertAppSecurityKey`, `GetOAuthSigningKey`, `UpsertOAuthSigningKey`, `GetCoordinatorResumeTokenSigningKey`, `UpsertCoordinatorResumeTokenSigningKey` **Superseded queries (4):** - `GetProvisionerJobsByIDs` → `GetProvisionerJobsByIDsWithQueuePosition` - `GetDeploymentDAUs` / `GetTemplateDAUs` → `GetTemplateInsightsByInterval` - `GetWorkspaceBuildParametersByBuildIDs` + its `GetAuthorized...` variant → unused **OAuth2 (2):** `GetOAuth2ProviderAppByRegistrationToken`, `UpdateOAuth2ProviderAppSecretByID` **Chat (4)** — pre-wired with no callers: `GetChatModelConfigByProviderAndModel`, `DeleteChatMessagesByChatID`, `ListChatsByRootID`, `ListChildChatsByParentID` **Other (6):** `DeleteGitSSHKey`, `UpdateUserLinkedID`, `GetFileIDByTemplateVersionID`, `GetTemplateVersionHasAITask`, `InsertUserGroupsByName`, `RemoveUserFromAllGroups`
This commit is contained in:
@@ -5,12 +5,6 @@ WHERE id = @id OR root_chat_id = @id;
|
||||
-- name: UnarchiveChatByID :exec
|
||||
UPDATE chats SET archived = false, updated_at = NOW() WHERE id = @id::uuid;
|
||||
|
||||
-- name: DeleteChatMessagesByChatID :exec
|
||||
DELETE FROM
|
||||
chat_messages
|
||||
WHERE
|
||||
chat_id = @chat_id::uuid;
|
||||
|
||||
-- name: DeleteChatMessagesAfterID :exec
|
||||
DELETE FROM
|
||||
chat_messages
|
||||
@@ -141,26 +135,6 @@ LIMIT
|
||||
-- Default to 50 to prevent accidental excessively large queries.
|
||||
COALESCE(NULLIF(@limit_opt :: int, 0), 50);
|
||||
|
||||
-- name: ListChildChatsByParentID :many
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
chats
|
||||
WHERE
|
||||
parent_chat_id = @parent_chat_id::uuid
|
||||
ORDER BY
|
||||
created_at ASC;
|
||||
|
||||
-- name: ListChatsByRootID :many
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
chats
|
||||
WHERE
|
||||
root_chat_id = @root_chat_id::uuid
|
||||
ORDER BY
|
||||
created_at ASC;
|
||||
|
||||
-- name: InsertChat :one
|
||||
INSERT INTO chats (
|
||||
owner_id,
|
||||
|
||||
Reference in New Issue
Block a user