Skip to content

Instantly share code, notes, and snippets.

@ayax79
Created June 8, 2012 16:53
Show Gist options
  • Save ayax79/2896843 to your computer and use it in GitHub Desktop.
Save ayax79/2896843 to your computer and use it in GitHub Desktop.
#
# Migration to convert the posts.user_id from an internal id pointing to users.id columnt to be the external
# serv guid.
#
# This migration was introduced as part of the user_rewrite work to remove the manage users table reliance and double writing to serv
#
UP:
query:
1: ALTER TABLE posts MODIFY user_id varchar(40)
2: UPDATE posts LEFT JOIN users ON posts.user_id=users.id SET posts.user_id=users.core_user_guid;
DOWN:
query:
1: select 'no down'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment