Skip to content

Commit d448763

Browse files
authored
fix: Remove unique index on auth tokens (coder#1120)
If a workspace is started multiple times, resources may not be invalidated. This means an auth token can be reused for a workspace. coderd closes old agent connections, so this is expected behavior, and the agent will reconnect properly.
1 parent 885d5f2 commit d448763

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

coderd/database/dump.sql

-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/migrations/000004_jobs.up.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ CREATE TABLE workspace_agents (
8080
last_connected_at timestamptz,
8181
disconnected_at timestamptz,
8282
resource_id uuid NOT NULL REFERENCES workspace_resources (id) ON DELETE CASCADE,
83-
auth_token uuid NOT NULL UNIQUE,
83+
auth_token uuid NOT NULL,
8484
auth_instance_id varchar(64),
8585
architecture varchar(64) NOT NULL,
8686
environment_variables jsonb,

0 commit comments

Comments
 (0)