Skip to content

Commit 4108ece

Browse files
committed
begin refactoring PR
1 parent 3a4d049 commit 4108ece

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
BEGIN;
22

3-
ALTER TABLE users ADD COLUMN login_type login_type NOT NULL DEFAULT 'password';
3+
CREATE TABLE IF NOT EXISTS users (
4+
user_id uuid NOT NULL,
5+
login_type login_type NOT NULL,
6+
linked_id text NOT NULL DEFAULT ''::text NOT NULL,
7+
oauth_access_token text DEFAULT ''::text NOT NULL,
8+
oauth_refresh_token text DEFAULT ''::text NOT NULL,
9+
oauth_id_token text DEFAULT ''::text NOT NULL,
10+
oauth_expiry timestamp with time zone DEFAULT '0001-01-01 00:00:00+00'::timestamp with time zone NOT NULL,
11+
UNIQUE(user_id, login_type),
12+
)
413
ALTER TABLE users ADD COLUMN linked_id text NOT NULL DEFAULT '';
514

615
UPDATE

0 commit comments

Comments
 (0)