<pre class="prettyprint lang-php">#修改禅道系统用户名更新历史数据的SQL语句

#将'001491'替换为'001494' 的语句：
update zt_action set actor='001494' where actor='001491';
update zt_action set extra='001494' where extra='001491';
update zt_story set openedBy='001494' where openedBy='001491';
update zt_story set assignedTo='001494' where assignedTo='001491';
update zt_story set lastEditedBy='001494' where lastEditedBy='001491';
update zt_story set closedBy='001494' where closedBy='001491';
update zt_bug set openedBy='001494' where openedBy='001491';
update zt_bug set assignedTo='001494' where assignedTo='001491';
update zt_bug set resolvedBy='001494' where resolvedBy='001491';
update zt_bug set closedBy='001494' where closedBy='001491';
update zt_bug set lastEditedBy='001494' where lastEditedBy='001491';
update zt_doc set addedBy='001494' where addedBy='001491';
update zt_doc set editedBy='001494' where editedBy='001491';
update zt_case set scriptedBy='001494' where scriptedBy='001491';
update zt_case set openedBy='001494' where openedBy='001491';
update zt_case set lastEditedBy='001494' where lastEditedBy='001491';
update zt_case set lastRunner='001494' where lastRunner='001491';
update zt_testsuite set addedBy='001494' where addedBy='001491';
update zt_task set assignedTo='001494' where assignedTo='001491';
update zt_task set finishedBy='001494' where finishedBy='001491';
update zt_task set closedBy='001494' where closedBy='001491';
update zt_task set openedBy='001494' where openedBy='001491';
update zt_product set PO='001494' where PO='001491';
update zt_product set QD='001494' where QD='001491';
update zt_product set RD='001494' where RD='001491';
update zt_project set PM='001494' where PM='001491';
update zt_project set PO='001494' where PO='001491';
update zt_project set QD='001494' where QD='001491';
update zt_project set RD='001494' where RD='001491';
update zt_project set openedBy='001494' where openedBy='001491';
update zt_project set closedBy='001494' where closedBy='001491';
update zt_project set canceledBy='001494' where canceledBy='001491';
update zt_product set createdBy='001494' where createdBy='001491';
update zt_todo set account='001494' where account='001491';
update zt_todo set assignedTo='001494' where assignedTo='001491';
update zt_module set owner='001494' where owner='001491';
update zt_userview set account='001494' where account='001491';
update zt_team set account='001494' where account='001491';
update zt_effort set account='001494' where account='001491';
update zt_build set builder='001494' where builder='001491';
update zt_testrun set assignedTo='001494' where assignedTo='001491';
update zt_file set addedBy='001494' where addedBy='001491';
update zt_usergroup set account='001494' where account='001491';

#更新需求评审人信息
update zt_storyreview set reviewer= ‘001494’ where reviewer = ‘001491’;

#将jingcai1、xlwu、changli创建的项目，白名单增加网申团队
update zt_project set acl='custom', whitelist=CONCAT(whitelist, ',22')  where openedBy = 'jingcai1' or openedBy='xlwu' or openedBy ='changli';

#执行之后，刷新权限
truncate zt_userview;
</pre>