| 1 | = Week Report = |
| 2 | |
| 3 | * 2008-03-24 |
| 4 | * [陽明生資] 取得實驗用主機 |
| 5 | * 如何使用 sqlite3 把 Trac Ticket 裡的廣告拿掉 |
| 6 | {{{ |
| 7 | $ sudo apt-get install sqlite3 |
| 8 | $ sudo sqlite3 /forge/trac_pool/edublog/db/trac.db |
| 9 | sqlite> select * from ticket_change where author="anonymous"; |
| 10 | |
| 11 | 1|1206200969|anonymous|comment|5|[http://hi.baidu.com/zlgdgzl baidu ] [http://zlgdgzl.blog.163.com/ 163] |
| 12 | .... Skiped .... |
| 13 | |
| 14 | sqlite> delete from ticket_change where time=1206200969; |
| 15 | }}} |
| 16 | * 如何查 SQLite 資料庫定義 |
| 17 | * 參考: [http://support.oss.org.tw/?q=node/157 SQLite 簡介 (1)] |
| 18 | {{{ |
| 19 | sqlite> .schema |
| 20 | CREATE TABLE attachment ( |
| 21 | type text, |
| 22 | id text, |
| 23 | filename text, |
| 24 | size integer, |
| 25 | time integer, |
| 26 | description text, |
| 27 | author text, |
| 28 | ipnr text, |
| 29 | UNIQUE (type,id,filename) |
| 30 | ); |
| 31 | CREATE TABLE auth_cookie ( |
| 32 | cookie text, |
| 33 | name text, |
| 34 | ipnr text, |
| 35 | time integer, |
| 36 | UNIQUE (cookie,ipnr,name) |
| 37 | ); |
| 38 | CREATE TABLE component ( |
| 39 | name text PRIMARY KEY, |
| 40 | owner text, |
| 41 | description text |
| 42 | ); |
| 43 | CREATE TABLE enum ( |
| 44 | type text, |
| 45 | name text, |
| 46 | value text, |
| 47 | UNIQUE (type,name) |
| 48 | ); |
| 49 | CREATE TABLE milestone ( |
| 50 | name text PRIMARY KEY, |
| 51 | due integer, |
| 52 | completed integer, |
| 53 | description text |
| 54 | ); |
| 55 | CREATE TABLE node_change ( |
| 56 | rev text, |
| 57 | path text, |
| 58 | node_type text, |
| 59 | change_type text, |
| 60 | base_path text, |
| 61 | base_rev text, |
| 62 | UNIQUE (rev,path,change_type) |
| 63 | ); |
| 64 | CREATE TABLE permission ( |
| 65 | username text, |
| 66 | action text, |
| 67 | UNIQUE (username,action) |
| 68 | ); |
| 69 | CREATE TABLE report ( |
| 70 | id integer PRIMARY KEY, |
| 71 | author text, |
| 72 | title text, |
| 73 | query text, |
| 74 | description text |
| 75 | ); |
| 76 | CREATE TABLE revision ( |
| 77 | rev text PRIMARY KEY, |
| 78 | time integer, |
| 79 | author text, |
| 80 | message text |
| 81 | ); |
| 82 | CREATE TABLE session ( |
| 83 | sid text, |
| 84 | authenticated integer, |
| 85 | last_visit integer, |
| 86 | UNIQUE (sid,authenticated) |
| 87 | ); |
| 88 | CREATE TABLE session_attribute ( |
| 89 | sid text, |
| 90 | authenticated integer, |
| 91 | name text, |
| 92 | value text, |
| 93 | UNIQUE (sid,authenticated,name) |
| 94 | ); |
| 95 | CREATE TABLE system ( |
| 96 | name text PRIMARY KEY, |
| 97 | value text |
| 98 | ); |
| 99 | CREATE TABLE ticket ( |
| 100 | id integer PRIMARY KEY, |
| 101 | type text, |
| 102 | time integer, |
| 103 | changetime integer, |
| 104 | component text, |
| 105 | severity text, |
| 106 | priority text, |
| 107 | owner text, |
| 108 | reporter text, |
| 109 | cc text, |
| 110 | version text, |
| 111 | milestone text, |
| 112 | status text, |
| 113 | resolution text, |
| 114 | summary text, |
| 115 | description text, |
| 116 | keywords text |
| 117 | ); |
| 118 | CREATE TABLE ticket_change ( |
| 119 | ticket integer, |
| 120 | time integer, |
| 121 | author text, |
| 122 | field text, |
| 123 | oldvalue text, |
| 124 | newvalue text, |
| 125 | UNIQUE (ticket,time,field) |
| 126 | ); |
| 127 | CREATE TABLE ticket_custom ( |
| 128 | ticket integer, |
| 129 | name text, |
| 130 | value text, |
| 131 | UNIQUE (ticket,name) |
| 132 | ); |
| 133 | CREATE TABLE version ( |
| 134 | name text PRIMARY KEY, |
| 135 | time integer, |
| 136 | description text |
| 137 | ); |
| 138 | CREATE TABLE wiki ( |
| 139 | name text, |
| 140 | version integer, |
| 141 | time integer, |
| 142 | author text, |
| 143 | ipnr text, |
| 144 | text text, |
| 145 | comment text, |
| 146 | readonly integer, |
| 147 | UNIQUE (name,version) |
| 148 | ); |
| 149 | CREATE INDEX node_change_rev_idx ON node_change (rev); |
| 150 | CREATE INDEX revision_time_idx ON revision (time); |
| 151 | CREATE INDEX session_authenticated_idx ON session (authenticated); |
| 152 | CREATE INDEX session_last_visit_idx ON session (last_visit); |
| 153 | CREATE INDEX ticket_change_ticket_idx ON ticket_change (ticket); |
| 154 | CREATE INDEX ticket_change_time_idx ON ticket_change (time); |
| 155 | CREATE INDEX ticket_status_idx ON ticket (status); |
| 156 | CREATE INDEX ticket_time_idx ON ticket (time); |
| 157 | CREATE INDEX wiki_time_idx ON wiki (time); |
| 158 | sqlite> .tables |
| 159 | attachment node_change session_attribute version |
| 160 | auth_cookie permission system wiki |
| 161 | component report ticket |
| 162 | enum revision ticket_change |
| 163 | milestone session ticket_custom |
| 164 | sqlite> |
| 165 | }}} |
| 166 | * 2008-03-25 |
| 167 | * |
| 168 | * 2008-03-26 |
| 169 | * |
| 170 | * 2008-03-27 |
| 171 | * |
| 172 | * 2008-03-28 |
| 173 | * 小組讀書會 |