Skip to content

Commit 7ba4532

Browse files
committed
(untested) SQL to backfill linked_accounts (deploy 2)
1 parent 1ff570e commit 7ba4532

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

script/backfill-linked-accounts.sql

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
INSERT INTO linked_accounts (user_id, provider, account_id, access_token, login, avatar)
2+
SELECT id, 0, gh_id, gh_access_token, gh_login, gh_avatar
3+
FROM users
4+
LEFT JOIN linked_accounts
5+
ON users.id = linked_accounts.user_id
6+
WHERE gh_id != -1
7+
AND linked_accounts.user_id IS NULL;

0 commit comments

Comments
 (0)