Skip to content

Commit c1b9871

Browse files
committed
new migration
1 parent f748d3d commit c1b9871

File tree

8 files changed

+71
-200
lines changed

8 files changed

+71
-200
lines changed

coderd/database/dump.sql

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

coderd/database/migrations/000034_linked_user_id.up.sql

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
BEGIN;
22

3-
ALTER TYPE login_type ADD VALUE 'oidc';
4-
53
CREATE TABLE IF NOT EXISTS user_links (
64
user_id uuid NOT NULL,
75
login_type login_type NOT NULL,
@@ -39,6 +37,10 @@ FROM
3937
) as keys
4038
WHERE x=1 AND keys.login_type != 'password';
4139

42-
ALTER TABLE api_keys RENAME COLUMN login_type TO _login_type
40+
ALTER TABLE api_keys
41+
DROP COLUMN oauth_access_token,
42+
DROP COLUMN oauth_refresh_token,
43+
DROP COLUMN oauth_id_token,
44+
DROP COLUMN oauth_expiry;
4345

4446
COMMIT;

coderd/database/models.go

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

coderd/database/postgres/postgres.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ func Open() (string, func(), error) {
138138
}
139139
retryErr = database.MigrateUp(db)
140140
if retryErr != nil {
141+
fmt.Printf("err: %v\n", retryErr)
141142
return xerrors.Errorf("migrate db: %w", retryErr)
142143
}
143144

coderd/database/querier.go

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

0 commit comments

Comments
 (0)