Skip to content

Commit e517d8e

Browse files
committed
Allow null on prefix after downgrade
Without this I think the tests would fail since they are not adding a prefix and there is no default.
1 parent 70cedd6 commit e517d8e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

coderd/database/migrations/000195_oauth2_provider_codes.down.sql

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ DROP TABLE oauth2_provider_app_codes;
77
-- It is not possible to drop enum values from enum types, so the UP on
88
-- login_type has "IF NOT EXISTS".
99

10-
-- The constraint on the secret prefix (which is used as an id embedded in the
11-
-- secret) is dropped, but avoid completely reverting back to the previous
10+
-- The constraints on the secret prefix (which is used as an id embedded in the
11+
-- secret) are dropped, but avoid completely reverting back to the previous
1212
-- behavior since that will render existing secrets unusable once upgraded
1313
-- again. OAuth2 is blocked outside of development mode in previous versions,
1414
-- so users will not be able to create broken secrets. This is really just to
1515
-- make sure tests keep working (say for a bisect).
1616
ALTER TABLE ONLY oauth2_provider_app_secrets
17-
DROP CONSTRAINT oauth2_provider_app_secrets_secret_prefix_key;
17+
DROP CONSTRAINT oauth2_provider_app_secrets_secret_prefix_key,
18+
ALTER COLUMN secret_prefix DROP NOT NULL;

0 commit comments

Comments
 (0)