Skip to content

Commit 7b082ef

Browse files
committed
add extra case
1 parent 549fee9 commit 7b082ef

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

coderd/database/migrations/testdata/fixtures/000189_duplicate_user_links.up.sql

+5
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,8 @@ INSERT INTO public.users(id, email, username, hashed_password, created_at, updat
1212
INSERT INTO public.organization_members VALUES ('fc1511ef-4fcf-4a3b-98a1-8df64160e35a', 'bb640d07-ca8a-4869-b6bc-ae61ebb2fda1', '2022-11-02 13:05:21.447595+02', '2022-11-02 13:05:21.447595+02', '{}') ON CONFLICT DO NOTHING;
1313
INSERT INTO public.user_links(user_id, login_type, linked_id, oauth_access_token)
1414
VALUES('fc1511ef-4fcf-4a3b-98a1-8df64160e35a', 'github', '100', '');
15+
16+
-- Additionally, there is no unique constraint on user_id. So also add another user_link for the same user.
17+
-- This has happened on a production database.
18+
INSERT INTO public.user_links(user_id, login_type, linked_id, oauth_access_token)
19+
VALUES('fc1511ef-4fcf-4a3b-98a1-8df64160e35a', 'oidc', 'foo', '');

0 commit comments

Comments
 (0)