update ATTACHMENTS a, usermigration u
set a.creator = u.newusername
where a.creator = u.oldusername;

update ATTACHMENTS a, usermigration u
set a.lastmodifier = u.newusername
where a.lastmodifier = u.oldusername;

update CONTENT a, usermigration u
set a.creator = u.newusername
where a.creator = u.oldusername;

update CONTENT a, usermigration u
set a.lastmodifier = u.newusername
where a.lastmodifier = u.oldusername;

update CONTENT a, usermigration u
set a.username = u.newusername
where a.username = u.oldusername;

update CONTENTLOCK a, usermigration u
set a.creator = u.newusername
where a.creator = u.oldusername;

update CONTENTLOCK a, usermigration u
set a.lastmodifier = u.newusername
where a.lastmodifier = u.oldusername;

update CONTENT_LABEL a, usermigration u
set a.owner = u.newusername
where a.owner = u.oldusername;

update CONTENT_PERM a, usermigration u
set a.creator = u.newusername
where a.creator = u.oldusername;

update CONTENT_PERM a, usermigration u
set a.lastmodifier = u.newusername
where a.lastmodifier = u.oldusername;

update CONTENT_PERM a, usermigration u
set a.username = u.newusername
where a.username = u.oldusername;

update CWD_USER a, usermigration u
set a.lower_user_name = u.newusername
where a.lower_user_name = u.oldusername;

update CWD_USER a, usermigration u
set a.user_name = u.newusername
where a.user_name = u.oldusername;

update EXTRNLNKS a, usermigration u
set a.creator = u.newusername
where a.creator = u.oldusername;

update EXTRNLNKS a, usermigration u
set a.lastmodifier = u.newusername
where a.lastmodifier = u.oldusername;

update FOLLOW_CONNECTIONS a, usermigration u
set a.followee = u.newusername
where a.followee = u.oldusername;

update FOLLOW_CONNECTIONS a, usermigration u
set a.follower = u.newusername
where a.follower = u.oldusername;

update LABEL a, usermigration u
set a.owner = u.newusername
where a.owner = u.oldusername;

update LINKS a, usermigration u
set a.creator = u.newusername
where a.creator = u.oldusername;

update LINKS a, usermigration u
set a.lastmodifier = u.newusername
where a.lastmodifier = u.oldusername;

update NOTIFICATIONS a, usermigration u
set a.creator = u.newusername
where a.creator = u.oldusername;

update NOTIFICATIONS a, usermigration u
set a.lastmodifier = u.newusername
where a.lastmodifier = u.oldusername;

update NOTIFICATIONS a, usermigration u
set a.username = u.newusername
where a.username = u.oldusername;

update PAGETEMPLATES a, usermigration u
set a.creator = u.newusername
where a.creator = u.oldusername;

update PAGETEMPLATES a, usermigration u
set a.lastmodifier = u.newusername
where a.lastmodifier = u.oldusername;

update REMEMBERMETOKEN a, usermigration u
set a.username = u.newusername
where a.username = u.oldusername;

update SPACEGROUPS a, usermigration u
set a.creator = u.newusername
where a.creator = u.oldusername;

update SPACEGROUPS a, usermigration u
set a.lastmodifier = u.newusername
where a.lastmodifier = u.oldusername;

update SPACEPERMISSIONS a, usermigration u
set a.creator = u.newusername
where a.creator = u.oldusername;

update SPACEPERMISSIONS a, usermigration u
set a.lastmodifier = u.newusername
where a.lastmodifier = u.oldusername;

update SPACEPERMISSIONS a, usermigration u
set a.permusername = u.newusername
where a.permusername = u.oldusername;

update SPACES a, usermigration u
set a.creator = u.newusername
where a.creator = u.oldusername;

update SPACES a, usermigration u
set a.lastmodifier = u.newusername
where a.lastmodifier = u.oldusername;

update TRACKBACKLINKS a, usermigration u
set a.creator = u.newusername
where a.creator = u.oldusername;

update TRACKBACKLINKS a, usermigration u
set a.lastmodifier = u.newusername
where a.lastmodifier = u.oldusername;

update OS_PROPERTYENTRY a, usermigration u
set a.entity_name = concat('CWD_', u.newusername)
where a.entity_name = concat('CWD_', u.oldusername);

update SPACES a, usermigration u
set a.spacekey = concat('~', u.newusername)
where a.spacekey = concat('~', u.oldusername);
 
update BANDANA a, usermigration u
set a.bandanacontext = concat('~', u.newusername)
where a.bandanacontext = concat('~', u.oldusername);
