Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf255b62

Browse files
committed
chore: Minimize the diff wrt original migration where possible
1 parent92911f5 commitf255b62

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

‎coderd/database/migrations/000371_api_key_scopes_array_allow_list.up.sql‎

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -146,20 +146,18 @@ ALTER TYPE api_key_scope ADD VALUE IF NOT EXISTS 'workspace_proxy:update';
146146
-- https://github.com/coder/coder/blob/main/coderd/database/dbpurge/dbpurge.go#L85
147147
DELETEFROM api_keysWHERE expires_at< NOW()- INTERVAL'7 days';
148148

149-
--
150149
-- Add new columns without defaults; backfill; then enforce NOT NULL
151-
--
152-
ALTERTABLE api_keys
153-
ADD COLUMN scopes api_key_scope[],
154-
ADD COLUMN allow_listtext[];
150+
ALTERTABLE api_keys ADD COLUMN scopes api_key_scope[];
151+
ALTERTABLE api_keys ADD COLUMN allow_listtext[];
155152

156153
-- Backfill existing rows for compatibility
157154
UPDATE api_keysSET
158155
scopes= ARRAY[scope::api_key_scope],
159156
allow_list= ARRAY['*:*'];
160157

161-
-- Enforce NOT NULL and drop legacy single-scope column
162-
ALTERTABLE api_keys
163-
ALTER COLUMN scopesSETNOT NULL,
164-
ALTER COLUMN allow_listSETNOT NULL,
165-
DROP COLUMN scope;
158+
-- Enforce NOT NULL
159+
ALTERTABLE api_keys ALTER COLUMN scopesSETNOT NULL;
160+
ALTERTABLE api_keys ALTER COLUMN allow_listSETNOT NULL;
161+
162+
-- Drop legacy single-scope column
163+
ALTERTABLE api_keys DROP COLUMN scope;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp