Skip to content

Commit e44bf71

Browse files
committed
fix(coderd/database): deterministic query ordering and enabled index
1 parent 3f6b2e2 commit e44bf71

4 files changed

Lines changed: 10 additions & 4 deletions

File tree

coderd/database/migrations/000453_multi_provider_configs.down.sql renamed to coderd/database/migrations/000454_multi_provider_configs.down.sql

File renamed without changes.

coderd/database/migrations/000453_multi_provider_configs.up.sql renamed to coderd/database/migrations/000454_multi_provider_configs.up.sql

File renamed without changes.

coderd/database/queries.sql.go

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries/chatproviders.sql

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ WHERE
1818
provider = @provider::text
1919
AND enabled = TRUE
2020
ORDER BY
21-
created_at ASC
21+
created_at ASC,
22+
id ASC
2223
LIMIT 1;
2324

2425
-- name: GetChatProviders :many
@@ -27,7 +28,9 @@ SELECT
2728
FROM
2829
chat_providers
2930
ORDER BY
30-
provider ASC;
31+
provider ASC,
32+
created_at ASC,
33+
id ASC;
3134

3235
-- name: GetEnabledChatProviders :many
3336
SELECT

0 commit comments

Comments
 (0)