blob: 7c9dd7f86d6d20736a888d64140af319f3c31d54 [file] [log] [blame]
droy27e97e02007-11-27 16:44:19 +00001-- MySQL dump 10.10
2--
3-- Host: localhost Database: babelstg
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
droyd0a9b1a2008-01-29 19:51:46 +000018DROP TABLE IF EXISTS event_log;
droy3e7f3a82007-11-29 19:35:51 +000019CREATE 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;
droy27e97e02007-11-27 16:44:19 +000029
droy5d4b64c2008-02-29 15:22:10 +000030DROP 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
droy27e97e02007-11-27 16:44:19 +000040DROP TABLE IF EXISTS `files`;
41CREATE TABLE `files` (
droye5c99812007-11-28 21:36:51 +000042 `file_id` int(10) unsigned NOT NULL auto_increment,
droy27e97e02007-11-27 16:44:19 +000043 `project_id` varchar(100) NOT NULL,
droy44cb1ba2007-12-18 15:19:34 +000044 `version` varchar(64) NOT NULL,
droy27e97e02007-11-27 16:44:19 +000045 `name` text NOT NULL,
46 `is_active` tinyint(3) unsigned NOT NULL default '1',
47 PRIMARY KEY (`file_id`),
48 KEY `project_id` (`project_id`),
droyc081e862007-11-30 16:37:35 +000049 CONSTRAINT `files_ibfk_1` FOREIGN KEY (`project_id`,`version`) REFERENCES `project_versions` (`project_id`,`version`) ON UPDATE CASCADE
droy27e97e02007-11-27 16:44:19 +000050) ENGINE=InnoDB DEFAULT CHARSET=utf8;
droy27e97e02007-11-27 16:44:19 +000051--
52-- Table structure for table `languages`
53--
54
55DROP TABLE IF EXISTS `languages`;
56CREATE TABLE `languages` (
57 `language_id` smallint(5) unsigned NOT NULL auto_increment,
droyc94a4522008-02-05 15:36:53 +000058 `iso_code` varchar(6) NOT NULL,
droy27e97e02007-11-27 16:44:19 +000059 `locale` varchar(12) default NULL,
60 `name` varchar(50) NOT NULL,
61 `is_active` tinyint(3) unsigned NOT NULL default '1',
62 PRIMARY KEY (`language_id`),
63 KEY `iso_code` (`iso_code`),
64 KEY `locale` (`locale`)
65) ENGINE=InnoDB DEFAULT CHARSET=utf8;
66
droy3bb0c962008-01-17 20:45:01 +000067
68
69--
70-- Table structure for table `map_files`
71--
72
73DROP TABLE IF EXISTS `map_files`;
74CREATE TABLE `map_files` (
75 `project_id` varchar(100) NOT NULL,
76 `version` varchar(64) NOT NULL,
77 `filename` varchar(100) NOT NULL,
78 `location` varchar(255) NOT NULL,
79 `is_active` tinyint(3) unsigned NOT NULL default '1',
80 PRIMARY KEY (`project_id`, `version`, `filename`),
81 CONSTRAINT `map_files_ibfk_1` FOREIGN KEY (`project_id`) REFERENCES `projects` (`project_id`) ON UPDATE CASCADE ON DELETE CASCADE
82) ENGINE=InnoDB DEFAULT CHARSET=utf8;
83
droy27e97e02007-11-27 16:44:19 +000084--
85-- Table structure for table `profiles`
86--
87
88DROP TABLE IF EXISTS `profiles`;
89CREATE TABLE `profiles` (
90 `userid` mediumint(9) NOT NULL auto_increment,
91 `login_name` varchar(255) NOT NULL default '',
92 `cryptpassword` varchar(128) default NULL,
93 `realname` varchar(255) NOT NULL default '',
94 `disabledtext` mediumtext NOT NULL,
95 `mybugslink` tinyint(4) NOT NULL default '1',
96 `extern_id` varchar(64) default NULL,
97 `disable_mail` tinyint(4) NOT NULL default '0',
98 PRIMARY KEY (`userid`),
99 UNIQUE KEY `profiles_login_name_idx` (`login_name`)
100) ENGINE=MyISAM DEFAULT CHARSET=latin1;
101
102--
103-- Table structure for table `projects`
104--
105
106DROP TABLE IF EXISTS `projects`;
107CREATE TABLE `projects` (
108 `project_id` varchar(100) NOT NULL,
109 `is_active` tinyint(3) unsigned NOT NULL default '1',
110 PRIMARY KEY (`project_id`)
111) ENGINE=InnoDB DEFAULT CHARSET=utf8;
112
droyd664f912008-05-14 15:45:10 +0000113DROP TABLE IF EXISTS `project_progress`;
114CREATE TABLE `project_progress` (
115 `project_id` varchar(100) NOT NULL,
116 `version` varchar(64) NOT NULL,
117 `language_id` smallint(5) unsigned NOT NULL,
118 `pct_complete` float NOT NULL,
droy6e6fb6d2008-05-15 17:11:29 +0000119 `is_stale` tinyint unsigned not null default 0,
droyd664f912008-05-14 15:45:10 +0000120 PRIMARY KEY (`project_id`, `version`, `language_id`),
121 CONSTRAINT `project_progress_ibfk_1` FOREIGN KEY (`project_id`, `version`) REFERENCES `project_versions` (`project_id`, `version`) ON UPDATE CASCADE ON DELETE CASCADE,
122 CONSTRAINT `project_progress_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`language_id`) ON UPDATE CASCADE ON DELETE CASCADE
123) ENGINE=InnoDB DEFAULT CHARSET=utf8;
124
125
126
droyc081e862007-11-30 16:37:35 +0000127DROP TABLE IF EXISTS `project_versions`;
128CREATE TABLE `project_versions` (
129 `project_id` varchar(100) NOT NULL,
droy44cb1ba2007-12-18 15:19:34 +0000130 `version` varchar(64) NOT NULL,
droyc081e862007-11-30 16:37:35 +0000131 `is_active` tinyint(3) unsigned NOT NULL default '1',
132 PRIMARY KEY (`project_id`, `version`),
133 CONSTRAINT `project_versions_ibfk_1` FOREIGN KEY (`project_id`) REFERENCES `projects` (`project_id`) ON UPDATE CASCADE ON DELETE CASCADE
134) ENGINE=InnoDB DEFAULT CHARSET=utf8;
135
droy27e97e02007-11-27 16:44:19 +0000136--
137-- Table structure for table `ratings`
138--
139
140DROP TABLE IF EXISTS `ratings`;
141CREATE TABLE `ratings` (
142 `translation_id` int(10) unsigned NOT NULL,
143 `userid` int(10) unsigned NOT NULL,
144 `rating` tinyint(3) unsigned NOT NULL default '0',
145 `created_on` datetime NOT NULL,
146 PRIMARY KEY (`translation_id`,`userid`),
147 CONSTRAINT `ratings_ibfk_1` FOREIGN KEY (`translation_id`) REFERENCES `translations` (`translation_id`) ON UPDATE CASCADE
148) ENGINE=InnoDB DEFAULT CHARSET=utf8;
149
droy684f2b62008-06-02 20:52:29 +0000150DROP TABLE IF EXISTS `release_train_projects`;
151CREATE TABLE `release_train_projects` (
152 `train_id` varchar(30) NOT NULL,
153 `project_id` varchar(100) NOT NULL,
154 `version` varchar(64) NOT NULL,
155 PRIMARY KEY (`train_id`, `project_id`, `version`),
156 CONSTRAINT `release_train_progress_ibfk_1` FOREIGN KEY (`project_id`, `version`) REFERENCES `project_versions` (`project_id`, `version`) ON UPDATE CASCADE ON DELETE CASCADE
157) ENGINE=InnoDB DEFAULT CHARSET=utf8;
158
droy27e97e02007-11-27 16:44:19 +0000159--
160-- Table structure for table `schema_info`
161--
162
163DROP TABLE IF EXISTS `schema_info`;
164CREATE TABLE `schema_info` (
165 `version` int(11) default NULL
166) ENGINE=MyISAM DEFAULT CHARSET=latin1;
167
168--
169-- Table structure for table `sessions`
170--
171
172DROP TABLE IF EXISTS `sessions`;
173CREATE TABLE `sessions` (
174 `id` int(11) unsigned NOT NULL auto_increment,
175 `userid` int(11) NOT NULL,
176 `gid` char(32) default NULL,
177 `subnet` char(15) default NULL,
178 `updated_at` datetime default NULL,
179 PRIMARY KEY (`id`),
180 KEY `gid` (`gid`),
181 KEY `userid` (`userid`)
182) ENGINE=InnoDB DEFAULT CHARSET=latin1;
183
184--
185-- Table structure for table `strings`
186--
187
188DROP TABLE IF EXISTS `strings`;
189CREATE TABLE `strings` (
190 `string_id` int(10) unsigned NOT NULL auto_increment,
191 `file_id` int(10) unsigned NOT NULL,
192 `name` text NOT NULL,
193 `value` text NOT NULL,
194 `userid` int(10) unsigned NOT NULL,
195 `created_on` datetime NOT NULL,
196 `is_active` tinyint(1) unsigned default NULL,
197 PRIMARY KEY (`string_id`),
198 KEY `file_id` (`file_id`),
199 KEY `userid` (`userid`),
200 CONSTRAINT `strings_ibfk_1` FOREIGN KEY (`file_id`) REFERENCES `files` (`file_id`) ON UPDATE CASCADE,
201 CONSTRAINT `strings_ibfk_2` FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON UPDATE CASCADE
202) ENGINE=InnoDB DEFAULT CHARSET=utf8;
203
droy44cb1ba2007-12-18 15:19:34 +0000204
droy44cb1ba2007-12-18 15:19:34 +0000205DELIMITER ;;
206CREATE TRIGGER `upd_string` AFTER UPDATE ON `strings` FOR EACH ROW
207 BEGIN
208 IF(NEW.value <> OLD.value) THEN
209 UPDATE translations SET possibly_incorrect = 1 WHERE string_id = NEW.string_id;
210 END IF;
211 END;
212;;
213DELIMITER ;
214
215
216
droy27e97e02007-11-27 16:44:19 +0000217--
218-- Table structure for table `translation_archives`
219--
220
221DROP TABLE IF EXISTS `translation_archives`;
222CREATE TABLE `translation_archives` (
223 `translation_id` int(10) unsigned NOT NULL,
224 `string_id` int(10) unsigned NOT NULL,
225 `language_id` smallint(5) unsigned NOT NULL,
226 `version` int(10) unsigned NOT NULL default '1',
227 `value` text NOT NULL,
228 `is_active` tinyint(3) unsigned NOT NULL default '1',
229 `userid` int(10) unsigned NOT NULL,
230 `created_on` datetime NOT NULL,
231 PRIMARY KEY (`string_id`,`language_id`,`version`),
232 KEY `language_id` (`language_id`),
233 KEY `userid` (`userid`),
234 CONSTRAINT `translation_archives_ibfk_1` FOREIGN KEY (`string_id`) REFERENCES `strings` (`string_id`) ON UPDATE CASCADE,
235 CONSTRAINT `translation_archives_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`language_id`) ON UPDATE CASCADE,
236 CONSTRAINT `translation_archives_ibfk_3` FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON UPDATE CASCADE
237) ENGINE=InnoDB DEFAULT CHARSET=utf8;
238
239--
240-- Table structure for table `translations`
241--
242
243DROP TABLE IF EXISTS `translations`;
244CREATE TABLE `translations` (
245 `translation_id` int(10) unsigned NOT NULL auto_increment,
246 `string_id` int(10) unsigned NOT NULL,
247 `language_id` smallint(5) unsigned NOT NULL,
248 `version` int(10) unsigned NOT NULL default '1',
249 `value` text NOT NULL,
droy44cb1ba2007-12-18 15:19:34 +0000250 `possibly_incorrect` tinyint unsigned NOT NULL default '0',
droy27e97e02007-11-27 16:44:19 +0000251 `is_active` tinyint(3) unsigned NOT NULL default '1',
252 `userid` int(10) unsigned NOT NULL,
253 `created_on` datetime NOT NULL,
254 PRIMARY KEY (`string_id`,`language_id`,`version`),
255 KEY `translation_id` (`translation_id`),
256 KEY `language_id` (`language_id`),
257 KEY `userid` (`userid`),
droyd664f912008-05-14 15:45:10 +0000258 KEY `created_on` (`created_on`),
droy27e97e02007-11-27 16:44:19 +0000259 CONSTRAINT `translations_ibfk_1` FOREIGN KEY (`string_id`) REFERENCES `strings` (`string_id`) ON UPDATE CASCADE,
260 CONSTRAINT `translations_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`language_id`) ON UPDATE CASCADE,
261 CONSTRAINT `translations_ibfk_3` FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON UPDATE CASCADE
262) ENGINE=InnoDB DEFAULT CHARSET=utf8;
263
droy5d4b64c2008-02-29 15:22:10 +0000264SET @OLD_SQL_MODE=@@SQL_MODE;
droy27e97e02007-11-27 16:44:19 +0000265DELIMITER ;;
266/*!50003 SET SESSION SQL_MODE="" */;;
droy28b28792008-05-21 20:54:29 +0000267DROP TRIGGER IF EXISTS `ins_version`;;
droy27e97e02007-11-27 16:44:19 +0000268
droy5d4b64c2008-02-29 15:22:10 +0000269/* This trigger sets the version to max(version) + 1. It also updates the file_progress table */
droyd664f912008-05-14 15:45:10 +0000270/* We check IF(NEW.version > 1) to determine if this is a NEW translation or one that replaces an existing one */
droy5d4b64c2008-02-29 15:22:10 +0000271/* (COUNT(t.string_id) + 1) because it's a BEFORE INSERT trigger, the translated str is not in the DB yet */
272/* and without the +1 the percent would always be "one behind" */
273CREATE TRIGGER `ins_version` BEFORE INSERT ON `translations` FOR EACH ROW BEGIN
274 SET NEW.version =
275 (SELECT IFNULL(MAX(version),0)+1 FROM translations
276 WHERE string_id = NEW.string_id and language_id = NEW.language_id);
droyd664f912008-05-14 15:45:10 +0000277
278 /* Define a few fields we need here */
279 SET @FILE_ID=(SELECT file_id FROM strings WHERE string_id = NEW.string_id);
280 SET @PROJECT=(SELECT project_id FROM files WHERE file_id = @FILE_ID);
281 SET @VERSION=(SELECT version FROM files WHERE file_id = @FILE_ID);
droy5d4b64c2008-02-29 15:22:10 +0000282
droyd664f912008-05-14 15:45:10 +0000283
284 /* update this file's progress */
285 DELETE FROM file_progress where file_id = @FILE_ID
droy5d4b64c2008-02-29 15:22:10 +0000286 AND language_id = NEW.language_id;
287
droyd664f912008-05-14 15:45:10 +0000288 /* See notes above for the hairy select */
289 INSERT INTO file_progress SET file_id = @FILE_ID,
droy5d4b64c2008-02-29 15:22:10 +0000290 language_id = NEW.language_id,
291 pct_complete = (
droyd664f912008-05-14 15:45:10 +0000292 SELECT IF(NEW.version > 1,
293 IF(COUNT(s.string_id) > 0, (COUNT(t.string_id))/COUNT(s.string_id)*100,0),
294 IF(COUNT(s.string_id) > 0, (COUNT(t.string_id) + 1)/COUNT(s.string_id)*100,0)
295 ) AS translate_percent
droy5d4b64c2008-02-29 15:22:10 +0000296 FROM files AS f
droyd664f912008-05-14 15:45:10 +0000297 LEFT JOIN strings AS s ON (s.file_id = f.file_id AND s.value <> "" and s.is_active)
droy5d4b64c2008-02-29 15:22:10 +0000298 LEFT JOIN translations AS t ON (s.string_id = t.string_id
299 AND t.language_id = NEW.language_id AND t.is_active = 1)
droyd664f912008-05-14 15:45:10 +0000300 WHERE f.file_id = @FILE_ID
301 );
droy6e6fb6d2008-05-15 17:11:29 +0000302
303
304 /* update project_progress table to indicate this proj/lang/vers stats are stale */
305 /* don't know if record is there or not, so do both an insert and an update */
306 UPDATE IGNORE project_progress SET is_stale = 1 where project_id = @PROJECT
droyd664f912008-05-14 15:45:10 +0000307 AND version = @VERSION
308 AND language_id = NEW.language_id;
droy6e6fb6d2008-05-15 17:11:29 +0000309
310 INSERT IGNORE INTO project_progress SET is_stale = 1, project_id = @PROJECT,
311 version = @VERSION,
312 language_id = NEW.language_id;
droyd664f912008-05-14 15:45:10 +0000313
droy5d4b64c2008-02-29 15:22:10 +0000314END;
315;;
droy27e97e02007-11-27 16:44:19 +0000316DELIMITER ;
317/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */;
318
319--
320-- Table structure for table `users`
321--
322
323DROP TABLE IF EXISTS `users`;
324CREATE TABLE `users` (
325 `userid` int(10) unsigned NOT NULL,
326 `username` varchar(256) NOT NULL default '',
327 `first_name` varchar(256) NOT NULL default '',
328 `last_name` varchar(256) NOT NULL default '',
329 `email` varchar(256) NOT NULL default '',
330 `primary_language_id` int(11) NOT NULL default '0',
331 `hours_per_week` int(11) NOT NULL default '0',
332 `password_hash` varchar(256) NOT NULL default '',
droy8da30b32007-11-29 21:00:26 +0000333 `is_committer` tinyint unsigned not null default 0,
droy27e97e02007-11-27 16:44:19 +0000334 `updated_on` date NOT NULL,
335 `updated_at` time NOT NULL,
336 `created_on` date NOT NULL,
337 `created_at` time NOT NULL,
338 PRIMARY KEY (`userid`),
339 KEY `primary_language_id` (`primary_language_id`)
340) ENGINE=InnoDB DEFAULT CHARSET=utf8;
droy97c86192007-11-28 22:00:22 +0000341
droy5bb81172008-04-04 19:25:24 +0000342DROP TABLE IF EXISTS `scoreboard`;
343CREATE TABLE `scoreboard` (
344 `id` int unsigned not null auto_increment,
345 `itemid` char(6) NOT NULL,
346 `value` varchar(256) NOT NULL default '',
347 `quantity` double NOT NULL default 0,
348 PRIMARY KEY (`id`),
349 KEY(`quantity`)
350) ENGINE=InnoDB DEFAULT CHARSET=utf8;
351
352
droy97c86192007-11-28 22:00:22 +0000353
354
droy27e97e02007-11-27 16:44:19 +0000355/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
356
357/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
358/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
359/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
360/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
361/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
362/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
363/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
364
droy6426bc02008-02-01 19:35:19 +0000365
366
367
368
369
370/*
371Babel data
372User: babel@eclipse.org
373pass: password
374*/
375
376insert into profiles set login_name = "test", cryptpassword = "", realname = "tester", disabledtext = false, mybugslink = 1, extern_id = 1, disable_mail = false;
377insert 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;
378insert into projects set project_id = 'eclipse', is_active = 1 ;
379INSERT INTO `languages` VALUES (1,'en',NULL,'English',1),
380(2,'fr',NULL,'French',1),
381(3,'ja',NULL,'Japanese',1),
382(4,'de',NULL,'German',1),
383(5,'es',NULL,'Spanish',1),
384(7,'it',NULL,'Italian',1),
385(8,'ja',NULL,'Japanese',1),
386(9,'ko',NULL,'Korean',1),
kitloa2b243f2008-03-05 14:55:26 +0000387(10,'pt_BR','Brazilian','Portuguese',1),
droy6426bc02008-02-01 19:35:19 +0000388(11,'zh','Simplified','Chinese',1),
droyc94a4522008-02-05 15:36:53 +0000389(12,'zh_TW','Traditional','Chinese',1),
droy6426bc02008-02-01 19:35:19 +0000390(13,'cs',NULL,'Czech',1),
391(14,'hu',NULL,'Hungarian',1),
392(15,'pl',NULL,'Polish',1),
393(16,'ru',NULL,'Russian',1),
kitlocba17902008-02-14 19:16:02 +0000394(17,'da',NULL,'Danish',1),
droy6426bc02008-02-01 19:35:19 +0000395(18,'nl',NULL,'Dutch',1),
396(19,'fi',NULL,'Finnish',1),
397(20,'el',NULL,'Greek',1),
398(21,'no',NULL,'Norwegian',1),
399(22,'pt',NULL,'Portuguese',1),
400(23,'sv',NULL,'Swedish',1),
401(24,'tr',NULL,'Turkish',1),
402(25,'ar',NULL,'Arabic',1),
kitlocba17902008-02-14 19:16:02 +0000403(26,'iw',NULL,'Hebrew',1);
droyc94a4522008-02-05 15:36:53 +0000404insert into languages set iso_code = 'hi', name = "Hindi";
droy99907e42008-03-05 21:59:21 +0000405insert into languages set iso_code = 'ro', name = "Romanian";
droyd664f912008-05-14 15:45:10 +0000406insert into languages set iso_code = 'uk', name = "Ukrainian";
droyd0b89592008-05-15 19:18:20 +0000407insert into languages set iso_code = 'es_CA', name = "Spanish-Catalonian";
droy6426bc02008-02-01 19:35:19 +0000408insert into project_versions set project_id = "eclipse", version = "3.4", is_active = 1;
409
410
411/* MAP INPUTS */
412insert into map_files values ("eclipse", "3.4", "ant.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/ant.map?view=co", 1);
413insert into map_files values ("eclipse", "3.4", "base.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/base.map?view=co", 1);
414insert into map_files values ("eclipse", "3.4", "compare.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/compare.map?view=co", 1);
415insert into map_files values ("eclipse", "3.4", "core-hpux.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/core-hpux.map?view=co", 1);
416insert into map_files values ("eclipse", "3.4", "core-macosx.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/core-macosx.map?view=co", 1);
417insert into map_files values ("eclipse", "3.4", "core-qnx.map","http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/core-qnx.map?view=co", 1);
418insert into map_files values ("eclipse", "3.4", "core-variables.map","http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/core-variables.map?view=co", 1);
419insert into map_files values ("eclipse", "3.4", "core.map","http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/core.map?view=co", 1);
420insert into map_files values ("eclipse", "3.4", "doc.map","http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/doc.map?view=co", 1);
421insert into map_files values ("eclipse", "3.4", "equinox-incubator.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/equinox-incubator.map?view=co", 1);
422insert into map_files values ("eclipse", "3.4", "feature.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/feature.map?view=co", 1);
423insert into map_files values ("eclipse", "3.4", "jdtapt.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/jdtapt.map?view=co", 1);
424insert into map_files values ("eclipse", "3.4", "jdtcore.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/jdtcore.map?view=co", 1);
425insert into map_files values ("eclipse", "3.4", "jdtdebug.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/jdtdebug.map?view=co", 1);
426insert into map_files values ("eclipse", "3.4", "jdtui.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/jdtui.map?view=co", 1);
427insert into map_files values ("eclipse", "3.4", "orbit.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/orbit.map?view=co", 1);
428insert into map_files values ("eclipse", "3.4", "pde.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/pde.map?view=co", 1);
429insert into map_files values ("eclipse", "3.4", "rcp.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/rcp.map?view=co", 1);
430insert into map_files values ("eclipse", "3.4", "releng.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/releng.map?view=co", 1);
431insert into map_files values ("eclipse", "3.4", "swt.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/swt.map?view=co", 1);
432insert into map_files values ("eclipse", "3.4", "team.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/team.map?view=co", 1);
433insert into map_files values ("eclipse", "3.4", "testframework.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/testframework.map?view=co", 1);
434insert into map_files values ("eclipse", "3.4", "text.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/text.map?view=co", 1);
435insert into map_files values ("eclipse", "3.4", "ui.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/ui.map?view=co", 1);
436insert into map_files values ("eclipse", "3.4", "update.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/update.map?view=co", 1);
droy5d4b64c2008-02-29 15:22:10 +0000437insert into map_files values ("eclipse", "3.4", "userassist.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/userassist.map?view=co", 1);
droybafb7c42008-02-29 18:24:38 +0000438
droy684f2b62008-06-02 20:52:29 +0000439
440insert into release_train_projects values ('europa', 'eclipse', '3.3.1');
droy379e51d2008-06-11 19:36:02 +0000441insert into release_train_projects values ('europa', 'stp', '0.8');
droy684f2b62008-06-02 20:52:29 +0000442insert into release_train_projects values ('ganymede', 'birt', '2.3.0');
443insert into release_train_projects values ('ganymede', 'eclipse', '3.4');
444insert into release_train_projects values ('ganymede', 'modeling.emf', '2.4.0');
445insert into release_train_projects values ('ganymede', 'modeling.emft', '0.8');
446insert into release_train_projects values ('ganymede', 'modeling.gmf', '2.1');
447insert into release_train_projects values ('ganymede', 'modeling.mdt', '2.4.0');
448insert into release_train_projects values ('ganymede', 'stp', '1.0');
449insert into release_train_projects values ('ganymede', 'tools.cdt', '5.0');
450insert into release_train_projects values ('ganymede', 'tools.gef', '3.4');
451insert into release_train_projects values ('ganymede', 'tools.pdt', '1.5.1');
452insert into release_train_projects values ('ganymede', 'webtools', '3.0');
453
droybafb7c42008-02-29 18:24:38 +0000454/* populate file_progress table */
droydc294842008-05-21 17:38:57 +0000455/* See also: dbmaintenance_15min.php */
droybafb7c42008-02-29 18:24:38 +0000456truncate table file_progress;
457INSERT INTO file_progress
droyc2c26102008-05-21 16:01:40 +0000458select 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
droybafb7c42008-02-29 18:24:38 +0000459FROM files AS f
460 INNER JOIN languages as l ON l.is_active = 1
droy0850a002008-05-27 15:48:37 +0000461 LEFT JOIN strings as s ON (s.file_id = f.file_id AND s.is_active AND s.value <> "")
droybafb7c42008-02-29 18:24:38 +0000462 LEFT JOIN translations AS t ON (s.string_id = t.string_id
463 AND t.language_id = l.language_id AND t.is_active = 1)
464WHERE f.is_active = 1
465GROUP BY f.file_id, l.language_id;
droy5bb81172008-04-04 19:25:24 +0000466DELETE FROM file_progress WHERE pct_complete = 0;
467
droyd664f912008-05-14 15:45:10 +0000468/* populate project_progress table */
469truncate table project_progress;
470INSERT INTO project_progress
471SELECT
472 p.project_id,
473 v.version,
474 l.language_id,
droyb156beb2008-05-15 17:16:44 +0000475 IF(COUNT(s.string_id) > 0, ROUND(COUNT(t.string_id)/COUNT(s.string_id) * 100, 2), 0) AS pct_complete,
476 0
droyd664f912008-05-14 15:45:10 +0000477FROM projects as p
478 INNER JOIN project_versions AS v ON v.project_id = p.project_id
479 INNER JOIN files AS f
480 ON (f.project_id = p.project_id AND f.version = v.version AND f.is_active)
481 INNER JOIN strings AS s
482 ON (s.file_id = f.file_id AND s.is_active)
483 INNER JOIN languages AS l
484 LEFT JOIN translations AS t
485 ON (t.string_id = s.string_id AND t.language_id = l.language_id AND t.is_active)
486WHERE
487 s.value <> ""
488 AND p.is_active
489GROUP BY p.project_id, v.version, l.language_id;
490
droy5bb81172008-04-04 19:25:24 +0000491/* populate scoreboard */
492truncate table scoreboard;
493INSERT 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;
494INSERT 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;
495INSERT INTO scoreboard SELECT NULL, "LASGEN", "Scoreboard Last Generated", MAX(translation_id) FROM translations;