Changes between Version 2 and Version 3 of RenameUsersScript


Ignore:
Timestamp:
Apr 1, 2007 3:35:27 PM (8 years ago)
Author:
lbonnet@…
Comment:

Fixed html escaping in SQL

Legend:

Unmodified
Added
Removed
Modified
  • RenameUsersScript

    v2 v3  
    1010 
    1111for i in \ 
    12         "old1 new1"\ 
    13         "old2 new2" 
     12        "old1 new1"\ 
     13        "old2 new2" 
    1414do 
    1515  OLDNAME=${i% *} 
    1616  NEWNAME=${i#* } 
    17   sqlite3 trac.db <<EOF 
    18 UPDATE "permission" SET username='$NEWNAME' WHERE username='$OLDNAME'; 
    19 UPDATE "auth_cookie" SET name='$NEWNAME' WHERE name='$OLDNAME'; 
    20 UPDATE "session" SET sid='$NEWNAME' WHERE sid='$OLDNAME'; 
    21 UPDATE "session_attribute" SET sid='$NEWNAME' WHERE sid='$OLDNAME'; 
    22 UPDATE "wiki" SET author='$NEWNAME' WHERE author='$OLDNAME'; 
    23 UPDATE "attachment" SET author='$NEWNAME' WHERE author='$OLDNAME'; 
    24 UPDATE "ticket" SET owner='$NEWNAME' WHERE owner='$OLDNAME'; 
    25 UPDATE "ticket" SET owner='$NEWNAME' WHERE owner='$OLDNAME'; 
    26 UPDATE "ticket" SET reporter='$NEWNAME' WHERE reporter='$OLDNAME'; 
    27 UPDATE "ticket_change" SET author='$NEWNAME' WHERE author='$OLDNAME'; 
    28 UPDATE "ticket_change" SET newvalue='$NEWNAME' WHERE newvalue='$OLDNAME' AND (field='qa_contact' OR fie 
     17  sqlite3 trac.db <<EOF 
     18UPDATE "permission" SET username='$NEWNAME' WHERE username='$OLDNAME'; 
     19UPDATE "auth_cookie" SET name='$NEWNAME' WHERE name='$OLDNAME'; 
     20UPDATE "session" SET sid='$NEWNAME' WHERE sid='$OLDNAME'; 
     21UPDATE "session_attribute" SET sid='$NEWNAME' WHERE sid='$OLDNAME'; 
     22UPDATE "wiki" SET author='$NEWNAME' WHERE author='$OLDNAME'; 
     23UPDATE "attachment" SET author='$NEWNAME' WHERE author='$OLDNAME'; 
     24UPDATE "ticket" SET owner='$NEWNAME' WHERE owner='$OLDNAME'; 
     25UPDATE "ticket" SET owner='$NEWNAME' WHERE owner='$OLDNAME'; 
     26UPDATE "ticket" SET reporter='$NEWNAME' WHERE reporter='$OLDNAME'; 
     27UPDATE "ticket_change" SET author='$NEWNAME' WHERE author='$OLDNAME'; 
     28UPDATE "ticket_change" SET newvalue='$NEWNAME' WHERE newvalue='$OLDNAME' AND (field='qa_contact' OR fie 
    2929ld='owner' OR field='reporter'); 
    30 UPDATE &#34;ticket_change&#34; SET oldvalue='$NEWNAME' WHERE oldvalue='$OLDNAME' AND (field='qa_contact' OR fie 
     30UPDATE "ticket_change" SET oldvalue='$NEWNAME' WHERE oldvalue='$OLDNAME' AND (field='qa_contact' OR fie 
    3131ld='owner'); 
    32 UPDATE &#34;component&#34; SET owner='$NEWNAME' WHERE owner='$OLDNAME'; 
     32UPDATE "component" SET owner='$NEWNAME' WHERE owner='$OLDNAME'; 
    3333EOF 
    3434done