blob: f4023937b41765f013b1d53e9dc37a31853a54c1 [file] [log] [blame]
droy5625bf32015-11-13 10:10:09 -05001-- MySQL dump 10.10
2--
3-- Host: localhost Database: babel
4-- ------------------------------------------------------
5-- Server version 5.0.18
6
7/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
8/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
9/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
10/*!40101 SET NAMES utf8 */;
11/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
12/*!40103 SET TIME_ZONE='+00:00' */;
13/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
14/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
15/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
16/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
17
18DROP TABLE IF EXISTS event_log;
19CREATE TABLE `event_log` (
20 `event_id` int(10) unsigned NOT NULL auto_increment,
21 `table_name` varchar(100) NOT NULL,
22 `key_name` varchar(100) NOT NULL,
23 `key_value` varchar(100) default NULL,
24 `action` varchar(100) NOT NULL,
25 `userid` mediumint(9) NOT NULL,
26 `created_on` datetime NOT NULL,
27 PRIMARY KEY (`event_id`)
28) ENGINE=MyISAM DEFAULT CHARSET=utf8;
29
30DROP TABLE IF EXISTS `file_progress`;
31CREATE TABLE `file_progress` (
32 `file_id` int(10) unsigned NOT NULL,
33 `language_id` smallint(5) unsigned NOT NULL,
34 `pct_complete` float NOT NULL,
35 PRIMARY KEY (`file_id`, `language_id`),
36 CONSTRAINT `file_progress_ibfk_1` FOREIGN KEY (`file_id`) REFERENCES `files` (`file_id`) ON UPDATE CASCADE ON DELETE CASCADE,
37 CONSTRAINT `file_progress_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`language_id`) ON UPDATE CASCADE ON DELETE CASCADE
38) ENGINE=InnoDB DEFAULT CHARSET=utf8;
39
40DROP TABLE IF EXISTS `files`;
41CREATE TABLE `files` (
42 `file_id` int(10) unsigned NOT NULL auto_increment,
43 `project_id` varchar(100) NOT NULL,
44 `plugin_id` varchar(100) NOT NULL,
45 `version` varchar(64) NOT NULL,
46 `name` text NOT NULL,
47 `is_active` tinyint(3) unsigned NOT NULL default '1',
48 PRIMARY KEY (`file_id`),
49 KEY `project_id` (`project_id`),
50 CONSTRAINT `files_ibfk_1` FOREIGN KEY (`project_id`,`version`) REFERENCES `project_versions` (`project_id`,`version`) ON UPDATE CASCADE
51) ENGINE=InnoDB DEFAULT CHARSET=utf8;
52
53
54SET @OLD_SQL_MODE=@@SQL_MODE;
55DELIMITER ;;
56/*!50003 SET SESSION SQL_MODE="" */;;
57DROP TRIGGER IF EXISTS `upd_is_active`;;
58
59/* This trigger will recursively update the is_active status of the strings of a file */
60CREATE TRIGGER `upd_is_active` AFTER UPDATE ON `files` FOR EACH ROW BEGIN
61 UPDATE strings set is_active = NEW.is_active WHERE strings.file_id = NEW.file_id;
62
63 /* update project_progress table to indicate this proj/lang/vers stats are stale */
64 /* don't know if record is there or not, so do both an insert and an update */
65 /* This portion of the trigger is similar to what is in the translations table */
66 SET @PROJECT=(SELECT project_id FROM files WHERE file_id = NEW.file_id);
67 SET @VERSION=(SELECT version FROM files WHERE file_id = NEW.file_id);
68
69 UPDATE IGNORE project_progress SET is_stale = 1 where project_id = @PROJECT
70 AND version = @VERSION;
71END;
72;;
73DELIMITER ;
74/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */;
75
76
77--
78-- Table structure for table `languages`
79--
80
81DROP TABLE IF EXISTS `languages`;
82CREATE TABLE `languages` (
83 `language_id` smallint(5) unsigned NOT NULL auto_increment,
84 `iso_code` varchar(6) NOT NULL,
85 `locale` varchar(12) default NULL,
86 `name` varchar(50) NOT NULL,
87 `is_active` tinyint(3) unsigned NOT NULL default '1',
88 PRIMARY KEY (`language_id`),
89 KEY `iso_code` (`iso_code`),
90 KEY `locale` (`locale`)
91) ENGINE=InnoDB DEFAULT CHARSET=utf8;
92
93--
94-- Table structure for table `map_files`
95--
96
97DROP TABLE IF EXISTS `map_files`;
98CREATE TABLE `map_files` (
99 `project_id` varchar(100) NOT NULL,
100 `version` varchar(64) NOT NULL,
101 `filename` varchar(100) NOT NULL,
102 `location` varchar(255) NOT NULL,
103 `is_active` tinyint(3) unsigned NOT NULL default '1',
104 `is_map_file` tinyint(3) unsigned NOT NULL default '1',
105 PRIMARY KEY (`project_id`, `version`, `filename`),
106 CONSTRAINT `map_files_ibfk_1` FOREIGN KEY (`project_id`) REFERENCES `projects` (`project_id`) ON UPDATE CASCADE ON DELETE CASCADE
107) ENGINE=InnoDB DEFAULT CHARSET=utf8;
108
109--
110-- Table structure for table `project_source_locations`
111--
112
113DROP TABLE IF EXISTS `project_source_locations`;
114CREATE TABLE `project_source_locations` (
115 `project_id` varchar(100) NOT NULL,
116 `version` varchar(64) NOT NULL,
117 `location` varchar(255) NOT NULL,
118 PRIMARY KEY (`project_id`, `version`, `location`),
119 CONSTRAINT `project_source_locations_ibfk_1` FOREIGN KEY (`project_id`) REFERENCES `projects` (`project_id`) ON UPDATE CASCADE ON DELETE CASCADE
120) ENGINE=InnoDB DEFAULT CHARSET=utf8;
121
122--
123-- Table structure for table `plugin_exclude_patterns`
124--
125
126DROP TABLE IF EXISTS `plugin_exclude_patterns`;
127CREATE TABLE `plugin_exclude_patterns` (
128 `project_id` varchar(100) NOT NULL,
129 `version` varchar(64) NOT NULL,
130 `pattern` varchar(128) NOT NULL,
131 PRIMARY KEY (`project_id`, `version`, `pattern`),
132 CONSTRAINT `plugin_exclude_patterns_ibfk_1` FOREIGN KEY (`project_id`) REFERENCES `projects` (`project_id`) ON UPDATE CASCADE ON DELETE CASCADE
133) ENGINE=InnoDB DEFAULT CHARSET=utf8;
134
135--
136-- Table structure for table `profiles`
137--
138
139DROP TABLE IF EXISTS `profiles`;
140CREATE TABLE `profiles` (
141 `userid` mediumint(9) NOT NULL auto_increment,
142 `login_name` varchar(255) NOT NULL default '',
143 `cryptpassword` varchar(128) default NULL,
144 `realname` varchar(255) NOT NULL default '',
145 `disabledtext` mediumtext NOT NULL,
146 `mybugslink` tinyint(4) NOT NULL default '1',
147 `extern_id` varchar(64) default NULL,
148 `disable_mail` tinyint(4) NOT NULL default '0',
149 PRIMARY KEY (`userid`),
150 UNIQUE KEY `profiles_login_name_idx` (`login_name`)
151) ENGINE=MyISAM DEFAULT CHARSET=latin1;
152
153--
154-- Table structure for table `projects`
155--
156
157DROP TABLE IF EXISTS `projects`;
158CREATE TABLE `projects` (
159 `project_id` varchar(100) NOT NULL,
160 `is_active` tinyint(3) unsigned NOT NULL default '1',
161 PRIMARY KEY (`project_id`)
162) ENGINE=InnoDB DEFAULT CHARSET=utf8;
163
164--
165-- Table structure for table `project_progress`
166--
167
168DROP TABLE IF EXISTS `project_progress`;
169CREATE TABLE `project_progress` (
170 `project_id` varchar(100) NOT NULL,
171 `version` varchar(64) NOT NULL,
172 `language_id` smallint(5) unsigned NOT NULL,
173 `pct_complete` float NOT NULL,
174 `is_stale` tinyint unsigned not null default 0,
175 PRIMARY KEY (`project_id`, `version`, `language_id`),
176 CONSTRAINT `project_progress_ibfk_1` FOREIGN KEY (`project_id`, `version`) REFERENCES `project_versions` (`project_id`, `version`) ON UPDATE CASCADE ON DELETE CASCADE,
177 CONSTRAINT `project_progress_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`language_id`) ON UPDATE CASCADE ON DELETE CASCADE
178) ENGINE=InnoDB DEFAULT CHARSET=utf8;
179
180--
181-- Table structure for table `project_versions`
182--
183
184DROP TABLE IF EXISTS `project_versions`;
185CREATE TABLE `project_versions` (
186 `project_id` varchar(100) NOT NULL,
187 `version` varchar(64) NOT NULL,
188 `is_active` tinyint(3) unsigned NOT NULL default '1',
189 PRIMARY KEY (`project_id`, `version`),
190 CONSTRAINT `project_versions_ibfk_1` FOREIGN KEY (`project_id`) REFERENCES `projects` (`project_id`) ON UPDATE CASCADE ON DELETE CASCADE
191) ENGINE=InnoDB DEFAULT CHARSET=utf8;
192
193--
194-- Table structure for table `ratings`
195--
196
197DROP TABLE IF EXISTS `ratings`;
198CREATE TABLE `ratings` (
199 `translation_id` int(10) unsigned NOT NULL,
200 `userid` int(10) unsigned NOT NULL,
201 `rating` tinyint(3) unsigned NOT NULL default '0',
202 `created_on` datetime NOT NULL,
203 PRIMARY KEY (`translation_id`,`userid`),
204 CONSTRAINT `ratings_ibfk_1` FOREIGN KEY (`translation_id`) REFERENCES `translations` (`translation_id`) ON UPDATE CASCADE
205) ENGINE=InnoDB DEFAULT CHARSET=utf8;
206
207--
208-- Table structure for table `release_trains`
209--
210
211DROP TABLE IF EXISTS `release_trains`;
212CREATE TABLE `release_trains` (
213 `train_id` varchar(30) NOT NULL,
214 `train_version` varchar(64) NOT NULL,
215 `is_active` tinyint(3) unsigned NOT NULL default '1',
216 PRIMARY KEY (`train_id`, `train_version`)
217) ENGINE=InnoDB DEFAULT CHARSET=utf8;
218
219--
220-- Table structure for table `release_train_projects`
221--
222
223DROP TABLE IF EXISTS `release_train_projects`;
224CREATE TABLE `release_train_projects` (
225 `train_id` varchar(30) NOT NULL,
226 `project_id` varchar(100) NOT NULL,
227 `version` varchar(64) NOT NULL,
228 PRIMARY KEY (`train_id`, `project_id`, `version`),
229 CONSTRAINT `release_train_progress_ibfk_1` FOREIGN KEY (`project_id`, `version`) REFERENCES `project_versions` (`project_id`, `version`) ON UPDATE CASCADE ON DELETE CASCADE
230) ENGINE=InnoDB DEFAULT CHARSET=utf8;
231
232--
233-- Table structure for table `schema_info`
234--
235
236DROP TABLE IF EXISTS `schema_info`;
237CREATE TABLE `schema_info` (
238 `version` int(11) default NULL
239) ENGINE=MyISAM DEFAULT CHARSET=latin1;
240
241--
242-- Table structure for table `sessions`
243--
244
245DROP TABLE IF EXISTS `sessions`;
246CREATE TABLE `sessions` (
247 `id` int(11) unsigned NOT NULL auto_increment,
248 `userid` int(11) NOT NULL,
249 `gid` char(32) default NULL,
250 `subnet` char(15) default NULL,
251 `updated_at` datetime default NULL,
252 PRIMARY KEY (`id`),
253 KEY `gid` (`gid`),
254 KEY `userid` (`userid`)
255) ENGINE=InnoDB DEFAULT CHARSET=latin1;
256
257--
258-- Table structure for table `strings`
259--
260
261CREATE TABLE `strings` (
262 `string_id` int(10) unsigned NOT NULL auto_increment,
263 `file_id` int(10) unsigned NOT NULL,
264 `name` text NOT NULL,
265 `value` text NOT NULL,
266 `userid` int(10) unsigned NOT NULL,
267 `created_on` datetime NOT NULL,
268 `is_active` tinyint(1) unsigned default NULL,
269 `non_translatable` tinyint(4) default '0',
270 PRIMARY KEY (`string_id`),
271 KEY `file_id` (`file_id`),
272 KEY `userid` (`userid`),
273 CONSTRAINT `strings_ibfk_1` FOREIGN KEY (`file_id`) REFERENCES `files` (`file_id`) ON UPDATE CASCADE,
274 CONSTRAINT `strings_ibfk_2` FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON UPDATE CASCADE
275) ENGINE=InnoDB DEFAULT CHARSET=utf8;
276
277CREATE INDEX idx_value ON strings(value(40));
278
279DELIMITER ;;
280CREATE TRIGGER `upd_string` AFTER UPDATE ON `strings` FOR EACH ROW
281 BEGIN
282 IF(NEW.value <> OLD.value) THEN
283 UPDATE translations SET possibly_incorrect = 1 WHERE string_id = NEW.string_id;
284 END IF;
285 END;
286;;
287DELIMITER ;
288
289--
290-- Table structure for table `sys_values`
291--
292DROP TABLE IF EXISTS `sys_values`;
293CREATE TABLE `sys_values` (
294 `itemid` char(6) NOT NULL,
295 `value` text,
296 PRIMARY KEY (`itemid`)
297) ENGINE=InnoDB DEFAULT CHARSET=utf8;
298
299--
300-- Table structure for table `translation_archives`
301--
302
303DROP TABLE IF EXISTS `translation_archives`;
304CREATE TABLE `translation_archives` (
305 `translation_id` int(10) unsigned NOT NULL,
306 `string_id` int(10) unsigned NOT NULL,
307 `language_id` smallint(5) unsigned NOT NULL,
308 `version` int(10) unsigned NOT NULL default '1',
309 `value` text NOT NULL,
310 `is_active` tinyint(3) unsigned NOT NULL default '1',
311 `userid` int(10) unsigned NOT NULL,
312 `created_on` datetime NOT NULL,
313 PRIMARY KEY (`string_id`,`language_id`,`version`),
314 KEY `language_id` (`language_id`),
315 KEY `userid` (`userid`),
316 CONSTRAINT `translation_archives_ibfk_1` FOREIGN KEY (`string_id`) REFERENCES `strings` (`string_id`) ON UPDATE CASCADE,
317 CONSTRAINT `translation_archives_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`language_id`) ON UPDATE CASCADE,
318 CONSTRAINT `translation_archives_ibfk_3` FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON UPDATE CASCADE
319) ENGINE=InnoDB DEFAULT CHARSET=utf8;
320
321--
322-- Table structure for table `translations`
323--
324
325DROP TABLE IF EXISTS `translations`;
326CREATE TABLE `translations` (
327 `translation_id` int(10) unsigned NOT NULL auto_increment,
328 `string_id` int(10) unsigned NOT NULL,
329 `language_id` smallint(5) unsigned NOT NULL,
330 `version` int(10) unsigned NOT NULL default '1',
331 `value` text NOT NULL,
332 `possibly_incorrect` tinyint unsigned NOT NULL default '0',
333 `is_active` tinyint(3) unsigned NOT NULL default '1',
334 `userid` int(10) unsigned NOT NULL,
335 `created_on` datetime NOT NULL,
336 PRIMARY KEY (`string_id`,`language_id`,`version`),
337 KEY `translation_id` (`translation_id`),
338 KEY `language_id` (`language_id`),
339 KEY `userid` (`userid`),
340 KEY `created_on` (`created_on`),
341 CONSTRAINT `translations_ibfk_1` FOREIGN KEY (`string_id`) REFERENCES `strings` (`string_id`) ON UPDATE CASCADE,
342 CONSTRAINT `translations_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`language_id`) ON UPDATE CASCADE,
343 CONSTRAINT `translations_ibfk_3` FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON UPDATE CASCADE
344) ENGINE=InnoDB DEFAULT CHARSET=utf8;
345
346SET @OLD_SQL_MODE=@@SQL_MODE;
347DELIMITER ;;
348/*!50003 SET SESSION SQL_MODE="" */;;
349DROP TRIGGER IF EXISTS `ins_version`;;
350
351/* This trigger sets the version to max(version) + 1. It also updates the file_progress table */
352/* We check IF(NEW.version > 1) to determine if this is a NEW translation or one that replaces an existing one */
353/* (COUNT(t.string_id) + 1) because it's a BEFORE INSERT trigger, the translated str is not in the DB yet */
354/* and without the +1 the percent would always be "one behind" */
355CREATE TRIGGER `ins_version` BEFORE INSERT ON `translations` FOR EACH ROW BEGIN
356 SET NEW.version =
357 (SELECT IFNULL(MAX(version),0)+1 FROM translations
358 WHERE string_id = NEW.string_id and language_id = NEW.language_id);
359
360 /* Define a few fields we need here */
361 SET @FILE_ID=(SELECT file_id FROM strings WHERE string_id = NEW.string_id);
362 SET @PROJECT=(SELECT project_id FROM files WHERE file_id = @FILE_ID);
363 SET @VERSION=(SELECT version FROM files WHERE file_id = @FILE_ID);
364
365
366 /* update this file's progress */
367 DELETE FROM file_progress where file_id = @FILE_ID
368 AND language_id = NEW.language_id;
369
370 /* See notes above for the hairy select */
371 INSERT INTO file_progress SET file_id = @FILE_ID,
372 language_id = NEW.language_id,
373 pct_complete = (
374 SELECT IF(NEW.version > 1,
375 IF(COUNT(s.string_id) > 0, (COUNT(t.string_id))/COUNT(s.string_id)*100,0),
376 IF(COUNT(s.string_id) > 0, (COUNT(t.string_id) + 1)/COUNT(s.string_id)*100,0)
377 ) AS translate_percent
378 FROM files AS f
379 LEFT JOIN strings AS s ON (s.file_id = f.file_id AND s.value <> "" and s.is_active)
380 LEFT JOIN translations AS t ON (s.string_id = t.string_id
381 AND t.language_id = NEW.language_id AND t.is_active = 1)
382 WHERE f.file_id = @FILE_ID
383 );
384
385
386 /* update project_progress table to indicate this proj/lang/vers stats are stale */
387 /* don't know if record is there or not, so do both an insert and an update */
388 /* This portion of the trigger is similar to what is in the files table */
389 UPDATE IGNORE project_progress SET is_stale = 1 where project_id = @PROJECT
390 AND version = @VERSION
391 AND language_id = NEW.language_id;
392
393 INSERT IGNORE INTO project_progress SET is_stale = 1, project_id = @PROJECT,
394 version = @VERSION,
395 language_id = NEW.language_id;
396
397END;
398;;
399DELIMITER ;
400/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */;
401
402--
403-- Table structure for table `users`
404--
405
406DROP TABLE IF EXISTS `users`;
407CREATE TABLE `users` (
408 `userid` int(10) unsigned NOT NULL,
409 `username` varchar(256) NOT NULL default '',
410 `first_name` varchar(256) NOT NULL default '',
411 `last_name` varchar(256) NOT NULL default '',
412 `email` varchar(256) NOT NULL default '',
413 `primary_language_id` int(11) NOT NULL default '0',
414 `hours_per_week` int(11) NOT NULL default '0',
415 `password_hash` varchar(256) NOT NULL default '',
416 `is_committer` tinyint unsigned not null default 0,
417 `updated_on` date NOT NULL,
418 `updated_at` time NOT NULL,
419 `created_on` date NOT NULL,
420 `created_at` time NOT NULL,
421 PRIMARY KEY (`userid`),
422 KEY `primary_language_id` (`primary_language_id`)
423) ENGINE=InnoDB DEFAULT CHARSET=utf8;
424
425DROP TABLE IF EXISTS `scoreboard`;
426CREATE TABLE `scoreboard` (
427 `id` int unsigned not null auto_increment,
428 `itemid` char(6) NOT NULL,
429 `value` varchar(256) NOT NULL default '',
430 `quantity` double NOT NULL default 0,
431 PRIMARY KEY (`id`),
432 KEY(`quantity`)
433) ENGINE=InnoDB DEFAULT CHARSET=utf8;
434
435
436
437
438/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
439
440/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
441/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
442/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
443/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
444/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
445/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
446/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
447
448
449
450
451
452
453/*
454Babel data
455User: babel@eclipse.org
456pass: password
457*/
458
459insert into profiles set login_name = "test", cryptpassword = "", realname = "tester", disabledtext = false, mybugslink = 1, extern_id = 1, disable_mail = false;
460insert into users set userid = 1, username = "babel@eclipse.org",first_name="babel",last_name="fish",email="babel@eclipse.org",primary_language_id = "",password_hash = "HSD9a.ShTTdvo", is_committer = true, updated_on = NOW(), updated_at='',created_on = NOW(), created_at='';
461insert into users set userid = 2, username = "genie@eclipse.org",first_name="babel",last_name="genie",email="genie@eclipse.org",primary_language_id = "",password_hash = "HSD9a.ShTTdvo", is_committer = true, updated_on = NOW(), updated_at='',created_on = NOW(), created_at='';
462insert into users set userid = 3, username = "syncup@eclipse.org",first_name="babel",last_name="syncup",email="syncup@eclipse.org",primary_language_id = "",password_hash = "HSD9a.ShTTdvo", is_committer = true, updated_on = NOW(), updated_at='',created_on = NOW(), created_at='';
463
464insert into languages values (1, "en", null, "English", 1);
465insert into languages values (null, "fr", null, "French", 1);
466insert into languages values (null, "de", null, "German", 1);
467insert into languages values (null, "es", null, "Spanish", 1);
468insert into languages values (null, "it", null, "Italian", 1);
469insert into languages values (null, "ja", null, "Japanese", 1);
470insert into languages values (null, "ko", null, "Korean", 1);
471insert into languages values (null, "pt_BR", "Brazilian", "Portuguese", 1);
472insert into languages values (null, "zh", "Simplified", "Chinese", 1);
473insert into languages values (null, "zh_TW", "Traditional", "Chinese", 1);
474insert into languages values (null, "cs", null, "Czech", 1);
475insert into languages values (null, "hu", null, "Hungarian", 1);
476insert into languages values (null, "pl", null, "Polish", 1);
477insert into languages values (null, "ru", null, "Russian", 1);
478insert into languages values (null, "da", null, "Danish", 1);
479insert into languages values (null, "nl", null, "Dutch", 1);
480insert into languages values (null, "fi", null, "Finnish", 1);
481insert into languages values (null, "el", null, "Greek", 1);
482insert into languages values (null, "no", null, "Norwegian", 1);
483insert into languages values (null, "pt", null, "Portuguese", 1);
484insert into languages values (null, "sv", null, "Swedish", 1);
485insert into languages values (null, "tr", null, "Turkish", 1);
486insert into languages values (null, "ar", null, "Arabic", 1);
487insert into languages values (null, "iw", null, "Hebrew", 1);
488insert into languages values (null, "hi", null, "Hindi", 1);
489insert into languages values (null, "ro", null, "Romanian", 1);
490insert into languages values (null, "uk", null, "Ukrainian", 1);
491insert into languages values (null, "ca", null, "Catalan", 1);
492insert into languages values (null, "et", null, "Estonian", 1);
493insert into languages values (null, "en_CA", "Canadian", "English", 1);
494insert into languages values (null, "en_AU", "Australian", "English", 1);
495insert into languages values (null, "mn", null, "Mongolian", 1);
496insert into languages values (null, "id", null, "Indonesian", 1);
497insert into languages values (null, "bg", null, "Bulgarian", 1);
498insert into languages values (null, "sl", null, "Slovenian", 1);
499insert into languages values (null, "fa", null, "Persian", 1);
500insert into languages values (null, "sq", null, "Albanian", 1);
501insert into languages values (null, "ku", null, "Kurdish", 1);
502insert into languages values (null, "sr", null, "Serbian", 1);
503insert into languages values (null, "sk", null, "Slovak", 1);
504insert into languages values (null, "eu", null, "Basque", 1);
505insert into languages values (null, "ml", null, "Malayalam", 1);
506insert into languages values (null, "my", null, "Myanmar", 1);
507insert into languages values (null, "th", null, "Thai", 1);
508insert into languages values (null, "lt", null, "Lithuanian", 1);
509insert into languages values (null, "ne", null, "Nepali", 1);
510insert into languages values (null, "tl", null, "Klingon", 1);
511
512insert into release_trains values ("kepler", "4.3.0", 1);
513
514insert into projects values ("eclipse", 1);
515insert into projects values ("eclipse.orion", 1);
516
Kit Lo6d440cc2013-03-02 19:56:45 -0500517insert into project_versions values ("eclipse", "4.3", 1);
Kit Lo1869b2d2013-06-20 09:52:07 -0400518insert into project_versions values ("eclipse.orion", "3.0", 1);
Kit Lo6d440cc2013-03-02 19:56:45 -0500519
520insert into release_train_projects values ("kepler", "eclipse", "4.3");
Kit Lo1869b2d2013-06-20 09:52:07 -0400521insert into release_train_projects values ("kepler", "eclipse.orion", "3.0");
droy5625bf32015-11-13 10:10:09 -0500522
523insert into project_source_locations values ("eclipse", "4.3", "http://git.eclipse.org/c/equinox/rt.equinox.framework.git/snapshot/R4_3.zip");
524insert into project_source_locations values ("eclipse", "4.3", "http://git.eclipse.org/c/equinox/rt.equinox.p2.git/snapshot/R4_3.zip");
525insert into project_source_locations values ("eclipse", "4.3", "http://git.eclipse.org/c/jdt/eclipse.jdt.git/snapshot/R4_3.zip");
526insert into project_source_locations values ("eclipse", "4.3", "http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/snapshot/R4_3.zip");
527insert into project_source_locations values ("eclipse", "4.3", "http://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/snapshot/R4_3.zip");
528insert into project_source_locations values ("eclipse", "4.3", "http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/snapshot/R4_3.zip");
529insert into project_source_locations values ("eclipse", "4.3", "http://git.eclipse.org/c/pde/eclipse.pde.git/snapshot/R4_3.zip");
530insert into project_source_locations values ("eclipse", "4.3", "http://git.eclipse.org/c/pde/eclipse.pde.ui.git/snapshot/R4_3.zip");
531insert into project_source_locations values ("eclipse", "4.3", "http://git.eclipse.org/c/platform/eclipse.platform.git/snapshot/R4_3.zip");
532insert into project_source_locations values ("eclipse", "4.3", "http://git.eclipse.org/c/platform/eclipse.platform.debug.git/snapshot/R4_3.zip");
533insert into project_source_locations values ("eclipse", "4.3", "http://git.eclipse.org/c/platform/eclipse.platform.team.git/snapshot/R4_3.zip");
534insert into project_source_locations values ("eclipse", "4.3", "http://git.eclipse.org/c/platform/eclipse.platform.text.git/snapshot/R4_3.zip");
535insert into project_source_locations values ("eclipse", "4.3", "http://git.eclipse.org/c/platform/eclipse.platform.ua.git/snapshot/R4_3.zip");
536insert into project_source_locations values ("eclipse", "4.3", "http://git.eclipse.org/c/platform/eclipse.platform.ui.git/snapshot/R4_3.zip");
537insert into project_source_locations values ("eclipse.orion", "3.0", "http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/snapshot/R3_0.zip");
538
539insert into plugin_exclude_patterns values ("eclipse", "4.3", "/^com\\.ibm\\.icu.*$/");
540insert into plugin_exclude_patterns values ("eclipse", "4.3", "/^com\\.jcraft\\..*$/");
541insert into plugin_exclude_patterns values ("eclipse", "4.3", "/^javax\\..*$/");
542insert into plugin_exclude_patterns values ("eclipse", "4.3", "/^org\\.apache\\..*$/");
543insert into plugin_exclude_patterns values ("eclipse", "4.3", "/^org\\.hamcrest\\..*$/");
544insert into plugin_exclude_patterns values ("eclipse", "4.3", "/^org\\.junit.*$/");
545insert into plugin_exclude_patterns values ("eclipse", "4.3", "/^org\\.mortbay\\..*$/");
546insert into plugin_exclude_patterns values ("eclipse", "4.3", "/^org\\.objectweb\\..*$/");
547insert into plugin_exclude_patterns values ("eclipse", "4.3", "/^org\\.sat4j\\..*$/");
548insert into plugin_exclude_patterns values ("eclipse", "4.3", "/^org\\.w3c\\..*$/");
549insert into plugin_exclude_patterns values ("eclipse", "4.3", "/^.*\\/jface\\/resource\\/.*$/");
550insert into plugin_exclude_patterns values ("eclipse.orion", "3.0", "/^.*\\/bundle.properties$/");
551
552/* populate file_progress table */
553/* See also: dbmaintenance_15min.php */
554truncate table file_progress;
555INSERT INTO file_progress
556select f.file_id, l.language_id, IF(COUNT(s.string_id) > 0, COUNT(t.string_id)/COUNT(s.string_id)*100,100) AS translate_percent
557FROM files AS f
558 INNER JOIN languages as l ON l.is_active = 1
559 LEFT JOIN strings as s ON (s.file_id = f.file_id AND s.is_active AND s.value <> "" AND s.non_translatable = 0)
560 LEFT JOIN translations AS t ON (s.string_id = t.string_id
561 AND t.language_id = l.language_id AND t.is_active = 1)
562WHERE f.is_active = 1
563GROUP BY f.file_id, l.language_id;
564DELETE FROM file_progress WHERE pct_complete = 0;
565
566/* populate project_progress table */
567truncate table project_progress;
568INSERT INTO project_progress
569SELECT
570 p.project_id,
571 v.version,
572 l.language_id,
573 IF(COUNT(s.string_id) > 0, ROUND(COUNT(t.string_id)/COUNT(s.string_id) * 100, 2), 0) AS pct_complete,
574 0
575FROM projects as p
576 INNER JOIN project_versions AS v ON v.project_id = p.project_id
577 INNER JOIN files AS f
578 ON (f.project_id = p.project_id AND f.version = v.version AND f.is_active)
579 INNER JOIN strings AS s
580 ON (s.file_id = f.file_id AND s.is_active)
581 INNER JOIN languages AS l
582 LEFT JOIN translations AS t
583 ON (t.string_id = s.string_id AND t.language_id = l.language_id AND t.is_active)
584WHERE
585 s.value <> ""
586 AND s.non_translatable = 0
587 AND p.is_active
588GROUP BY p.project_id, v.version, l.language_id;
589
590/* populate scoreboard */
591truncate table scoreboard;
592INSERT INTO scoreboard SELECT NULL, "LANGPR", CONCAT(b.name,IF(ISNULL(b.locale),"",CONCAT(" ", b.locale))), count(*) as StringCount from translations as a inner join languages as b on b.language_id = a.language_id where a.value <> '' and a.is_active = 1 group by a.language_id order by StringCount desc;
593INSERT INTO scoreboard SELECT NULL, "TOPTR", CONCAT(first_name, IF(ISNULL(last_name),"",CONCAT(" ", last_name))), count(translations.string_id) as cnt from translations inner join users on users.userid = translations.userid where is_active=1 group by first_name, last_name order by cnt desc limit 20;
594INSERT INTO scoreboard SELECT NULL, "LASGEN", "Scoreboard Last Generated", MAX(translation_id) FROM translations;
595
596/* create a holding record for the MOTD */
597INSERT INTO sys_values VALUES ("MOTD", NULL);