[cvs] [Wiki] changed: RenameUsers
Wiki Guest
wikiguest at horde.org
Tue Jan 9 05:26:49 PST 2007
guest [213.197.150.2] Tue, 09 Jan 2007 05:26:49 -0800
Modified page: http://wiki.horde.org/RenameUsers
New Revision: 1.8
Change log: horde db structure update and minor bash fix
@@ -23,17 +23,19 @@
#!/bin/sh
function horde_rename() {
new=$2; old=$1
- echo Rename $old -> $new
+ echo "Rename $old -> $new"
mysql -u horde -ppassword horde << EOF
update hermes_timeslices set employee_id = '$new' where employee_id = '$old';
update horde_datatree set user_uid = '$new' where user_uid = '$old';
update horde_datatree set datatree_name = '$new' where datatree_name = '$old' and user_uid = '$new';
update horde_datatree_attributes set attribute_value = '$new' where attribute_value = '$old' and attribute_key = 'who';
update horde_datatree_attributes set attribute_key= '$new' where attribute_key = '$old' and attribute_name = 'perm_users';
+update horde_datatree_attributes set attribute_value = '$new' where attribute_value = '$old' and attribute_name = 'uid';
update horde_datatree_attributes set attribute_value = '$new' where attribute_value = '$old' and attribute_name = 'owner';
+update horde_histories set history_who = '$new' where history_who = '$old';
update horde_prefs set pref_uid = '$new' where pref_uid = '$old';
update kronolith_events set event_creator_id = '$new' where event_creator_id = '$old';
update kronolith_events set calendar_id = '$new' where calendar_id = '$old';
update mnemo_memos set memo_owner = '$new' where memo_owner = '$old';
@@ -41,9 +43,9 @@
update turba_objects set owner_id = '$new' where owner_id = '$old';
update whups_queues_users set user_uid = '$new' where user_uid = '$old';
update whups_users_searches set user_uid = '$new' where user_uid = '$old';
EOF
- echo Done with $new
+ echo "Done with $new"
}
horde_rename 'fred' 'fred at hisdomain.com'
</code>
More information about the cvs
mailing list