Index: trunk/extensions/LiveTranslate/sql/LT_addTMField.sql |
— | — | @@ -0,0 +1,2 @@ |
| 2 | +ALTER TABLE /*_*/live_translate ADD COLUMN memory_id INT(4) unsigned NOT NULL; |
| 3 | +UPDATE /*_*/live_translate SET memory_id = 1; |
\ No newline at end of file |
Property changes on: trunk/extensions/LiveTranslate/sql/LT_addTMField.sql |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 4 | + native |
Index: trunk/extensions/LiveTranslate/LiveTranslate.hooks.php |
— | — | @@ -141,44 +141,61 @@ |
142 | 142 | if ( $wgDBtype == 'mysql' ) { |
143 | 143 | // Set up the current schema. |
144 | 144 | if ( $updater === null ) { |
145 | | - global $wgExtNewTables, $wgExtNewIndexes; |
| 145 | + global $wgExtNewTables, $wgExtNewIndexes, $wgExtNewFields; |
| 146 | + |
146 | 147 | $wgExtNewTables[] = array( |
147 | | - 'livetranslate', |
| 148 | + 'live_translate', |
148 | 149 | $egLiveTranslateIP . '/LiveTranslate.sql', |
149 | 150 | true |
150 | 151 | ); |
151 | 152 | $wgExtNewTables[] = array( |
152 | | - 'livetranslatememories', |
| 153 | + 'live_translate_memories', |
153 | 154 | $egLiveTranslateIP . '/LiveTranslate.sql', |
154 | 155 | true |
155 | | - ); |
| 156 | + ); |
| 157 | + |
156 | 158 | $wgExtNewIndexes[] = array( |
157 | 159 | 'live_translate', |
158 | 160 | 'word_translation', |
159 | 161 | $egLiveTranslateIP . '/sql/LT_IndexWordTranslation.sql', |
160 | 162 | true |
161 | | - ); |
| 163 | + ); |
| 164 | + |
| 165 | + $wgExtNewFields[] = array( |
| 166 | + 'live_translate', |
| 167 | + 'memory_id', |
| 168 | + $egLiveTranslateIP . '/sql/LT_addTMField.sql' |
| 169 | + ); |
162 | 170 | } |
163 | 171 | else { |
164 | 172 | $updater->addExtensionUpdate( array( |
165 | 173 | 'addTable', |
166 | | - 'livetranslate', |
| 174 | + 'live_translate', |
167 | 175 | $egLiveTranslateIP . '/LiveTranslate.sql', |
168 | 176 | true |
169 | 177 | ) ); |
170 | 178 | $updater->addExtensionUpdate( array( |
171 | 179 | 'addTable', |
172 | | - 'livetranslatememories', |
| 180 | + 'live_translate_memories', |
173 | 181 | $egLiveTranslateIP . '/LiveTranslate.sql', |
174 | 182 | true |
175 | | - ) ); |
| 183 | + ) ); |
| 184 | + |
176 | 185 | $updater->addExtensionUpdate( array( |
177 | 186 | 'addIndex', |
178 | 187 | 'live_translate', |
179 | 188 | 'word_translation', |
180 | 189 | $egLiveTranslateIP . '/sql/LT_IndexWordTranslation.sql', |
181 | 190 | true |
182 | | - ) ); |
| 191 | + ) ); |
| 192 | + |
| 193 | + $updater->addExtensionUpdate( array( |
| 194 | + 'addField', |
| 195 | + 'live_translate', |
| 196 | + 'memory_id', |
| 197 | + $egLiveTranslateIP . '/sql/LT_addTMField.sql', |
| 198 | + true |
| 199 | + ) ); |
183 | 200 | } |
184 | 201 | } |
185 | 202 | |
Index: trunk/extensions/LiveTranslate/LiveTranslate.sql |
— | — | @@ -5,12 +5,14 @@ |
6 | 6 | word_id INT(8) unsigned NOT NULL, |
7 | 7 | word_language VARCHAR(255) NOT NULL, |
8 | 8 | word_translation VARCHAR(255) NOT NULL, |
9 | | - word_primary INT(1) unsigned NOT NULL |
| 9 | + word_primary INT(1) unsigned NOT NULL, |
| 10 | + memory_id INT(4) unsigned NOT NULL |
10 | 11 | ) /*$wgDBTableOptions*/; |
11 | 12 | |
12 | 13 | -- Table to keep track of translation memories for the special words. |
13 | 14 | CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/live_translate_memories ( |
14 | 15 | memory_id INT(4) unsigned NOT NULL auto_increment PRIMARY KEY, |
15 | 16 | memory_type INT(2) unsigned NOT NULL, |
16 | | - memory_location VARCHAR(255) NOT NULL |
| 17 | + memory_location VARCHAR(255) NOT NULL, |
| 18 | + memory_local INT(1) unsigned NOT NULL |
17 | 19 | ) /*$wgDBTableOptions*/; |
\ No newline at end of file |