Skip to content

Instantly share code, notes, and snippets.

@metaodi
Last active January 2, 2016 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save metaodi/8364558 to your computer and use it in GitHub Desktop.
Save metaodi/8364558 to your computer and use it in GitHub Desktop.
Copy values from one kort user to another to move a user to another OAuth provider
UPDATE kort.user
SET name = sub.name,
username = sub.username,
koin_count = sub.koin_count,
token = sub.token,
oauth_provider = sub.oauth_provider,
oauth_user_id = sub.oauth_user_id,
pic_url = sub.pic_url,
secret = sub.secret
FROM (SELECT name, username, koin_count, token, oauth_provider, oauth_user_id, pic_url, secret
FROM kort.user
WHERE user_id = <user id to copy>) as sub
WHERE user_id = <user id to change>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment