blob: 81f5141ba0911afad18ba8ae85a4ed694de17820 [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,
droyb9c2cb12008-10-08 13:58:14 +000044 `plugin_id` varchar(100) NOT NULL,
droy44cb1ba2007-12-18 15:19:34 +000045 `version` varchar(64) NOT NULL,
droy27e97e02007-11-27 16:44:19 +000046 `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`),
droyc081e862007-11-30 16:37:35 +000050 CONSTRAINT `files_ibfk_1` FOREIGN KEY (`project_id`,`version`) REFERENCES `project_versions` (`project_id`,`version`) ON UPDATE CASCADE
droy27e97e02007-11-27 16:44:19 +000051) ENGINE=InnoDB DEFAULT CHARSET=utf8;
droy0757c2c2009-03-31 19:37:36 +000052
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 UPDATE IGNORE project_progress SET is_stale = 1 where project_id = @PROJECT
67 AND version = @VERSION;
68
69 INSERT IGNORE INTO project_progress SET is_stale = 1, project_id = @PROJECT,
70 version = @VERSION;
71
72END;
73;;
74DELIMITER ;
75/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */;
76
77
droy27e97e02007-11-27 16:44:19 +000078--
79-- Table structure for table `languages`
80--
81
82DROP TABLE IF EXISTS `languages`;
83CREATE TABLE `languages` (
84 `language_id` smallint(5) unsigned NOT NULL auto_increment,
droyc94a4522008-02-05 15:36:53 +000085 `iso_code` varchar(6) NOT NULL,
droy27e97e02007-11-27 16:44:19 +000086 `locale` varchar(12) default NULL,
87 `name` varchar(50) NOT NULL,
88 `is_active` tinyint(3) unsigned NOT NULL default '1',
89 PRIMARY KEY (`language_id`),
90 KEY `iso_code` (`iso_code`),
91 KEY `locale` (`locale`)
92) ENGINE=InnoDB DEFAULT CHARSET=utf8;
93
droy3bb0c962008-01-17 20:45:01 +000094
95
96--
97-- Table structure for table `map_files`
98--
99
100DROP TABLE IF EXISTS `map_files`;
101CREATE TABLE `map_files` (
102 `project_id` varchar(100) NOT NULL,
103 `version` varchar(64) NOT NULL,
104 `filename` varchar(100) NOT NULL,
105 `location` varchar(255) NOT NULL,
106 `is_active` tinyint(3) unsigned NOT NULL default '1',
107 PRIMARY KEY (`project_id`, `version`, `filename`),
108 CONSTRAINT `map_files_ibfk_1` FOREIGN KEY (`project_id`) REFERENCES `projects` (`project_id`) ON UPDATE CASCADE ON DELETE CASCADE
109) ENGINE=InnoDB DEFAULT CHARSET=utf8;
110
droy27e97e02007-11-27 16:44:19 +0000111--
112-- Table structure for table `profiles`
113--
114
115DROP TABLE IF EXISTS `profiles`;
116CREATE TABLE `profiles` (
117 `userid` mediumint(9) NOT NULL auto_increment,
118 `login_name` varchar(255) NOT NULL default '',
119 `cryptpassword` varchar(128) default NULL,
120 `realname` varchar(255) NOT NULL default '',
121 `disabledtext` mediumtext NOT NULL,
122 `mybugslink` tinyint(4) NOT NULL default '1',
123 `extern_id` varchar(64) default NULL,
124 `disable_mail` tinyint(4) NOT NULL default '0',
125 PRIMARY KEY (`userid`),
126 UNIQUE KEY `profiles_login_name_idx` (`login_name`)
127) ENGINE=MyISAM DEFAULT CHARSET=latin1;
128
129--
130-- Table structure for table `projects`
131--
132
133DROP TABLE IF EXISTS `projects`;
134CREATE TABLE `projects` (
135 `project_id` varchar(100) NOT NULL,
136 `is_active` tinyint(3) unsigned NOT NULL default '1',
137 PRIMARY KEY (`project_id`)
138) ENGINE=InnoDB DEFAULT CHARSET=utf8;
139
droyd664f912008-05-14 15:45:10 +0000140DROP TABLE IF EXISTS `project_progress`;
141CREATE TABLE `project_progress` (
142 `project_id` varchar(100) NOT NULL,
143 `version` varchar(64) NOT NULL,
144 `language_id` smallint(5) unsigned NOT NULL,
145 `pct_complete` float NOT NULL,
droy6e6fb6d2008-05-15 17:11:29 +0000146 `is_stale` tinyint unsigned not null default 0,
droyd664f912008-05-14 15:45:10 +0000147 PRIMARY KEY (`project_id`, `version`, `language_id`),
148 CONSTRAINT `project_progress_ibfk_1` FOREIGN KEY (`project_id`, `version`) REFERENCES `project_versions` (`project_id`, `version`) ON UPDATE CASCADE ON DELETE CASCADE,
149 CONSTRAINT `project_progress_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`language_id`) ON UPDATE CASCADE ON DELETE CASCADE
150) ENGINE=InnoDB DEFAULT CHARSET=utf8;
151
152
153
droyc081e862007-11-30 16:37:35 +0000154DROP TABLE IF EXISTS `project_versions`;
155CREATE TABLE `project_versions` (
156 `project_id` varchar(100) NOT NULL,
droy44cb1ba2007-12-18 15:19:34 +0000157 `version` varchar(64) NOT NULL,
droyc081e862007-11-30 16:37:35 +0000158 `is_active` tinyint(3) unsigned NOT NULL default '1',
159 PRIMARY KEY (`project_id`, `version`),
160 CONSTRAINT `project_versions_ibfk_1` FOREIGN KEY (`project_id`) REFERENCES `projects` (`project_id`) ON UPDATE CASCADE ON DELETE CASCADE
161) ENGINE=InnoDB DEFAULT CHARSET=utf8;
162
droy27e97e02007-11-27 16:44:19 +0000163--
164-- Table structure for table `ratings`
165--
166
167DROP TABLE IF EXISTS `ratings`;
168CREATE TABLE `ratings` (
169 `translation_id` int(10) unsigned NOT NULL,
170 `userid` int(10) unsigned NOT NULL,
171 `rating` tinyint(3) unsigned NOT NULL default '0',
172 `created_on` datetime NOT NULL,
173 PRIMARY KEY (`translation_id`,`userid`),
174 CONSTRAINT `ratings_ibfk_1` FOREIGN KEY (`translation_id`) REFERENCES `translations` (`translation_id`) ON UPDATE CASCADE
175) ENGINE=InnoDB DEFAULT CHARSET=utf8;
176
droy684f2b62008-06-02 20:52:29 +0000177DROP TABLE IF EXISTS `release_train_projects`;
178CREATE TABLE `release_train_projects` (
179 `train_id` varchar(30) NOT NULL,
180 `project_id` varchar(100) NOT NULL,
181 `version` varchar(64) NOT NULL,
182 PRIMARY KEY (`train_id`, `project_id`, `version`),
183 CONSTRAINT `release_train_progress_ibfk_1` FOREIGN KEY (`project_id`, `version`) REFERENCES `project_versions` (`project_id`, `version`) ON UPDATE CASCADE ON DELETE CASCADE
184) ENGINE=InnoDB DEFAULT CHARSET=utf8;
185
droy27e97e02007-11-27 16:44:19 +0000186--
187-- Table structure for table `schema_info`
188--
189
190DROP TABLE IF EXISTS `schema_info`;
191CREATE TABLE `schema_info` (
192 `version` int(11) default NULL
193) ENGINE=MyISAM DEFAULT CHARSET=latin1;
194
195--
196-- Table structure for table `sessions`
197--
198
199DROP TABLE IF EXISTS `sessions`;
200CREATE TABLE `sessions` (
201 `id` int(11) unsigned NOT NULL auto_increment,
202 `userid` int(11) NOT NULL,
203 `gid` char(32) default NULL,
204 `subnet` char(15) default NULL,
205 `updated_at` datetime default NULL,
206 PRIMARY KEY (`id`),
207 KEY `gid` (`gid`),
208 KEY `userid` (`userid`)
209) ENGINE=InnoDB DEFAULT CHARSET=latin1;
210
211--
212-- Table structure for table `strings`
213--
214
droy27e97e02007-11-27 16:44:19 +0000215CREATE TABLE `strings` (
216 `string_id` int(10) unsigned NOT NULL auto_increment,
217 `file_id` int(10) unsigned NOT NULL,
218 `name` text NOT NULL,
219 `value` text NOT NULL,
220 `userid` int(10) unsigned NOT NULL,
221 `created_on` datetime NOT NULL,
222 `is_active` tinyint(1) unsigned default NULL,
droy0e2dff42008-09-24 15:35:34 +0000223 `non_translatable` tinyint(4) default '0',
droy27e97e02007-11-27 16:44:19 +0000224 PRIMARY KEY (`string_id`),
225 KEY `file_id` (`file_id`),
226 KEY `userid` (`userid`),
227 CONSTRAINT `strings_ibfk_1` FOREIGN KEY (`file_id`) REFERENCES `files` (`file_id`) ON UPDATE CASCADE,
228 CONSTRAINT `strings_ibfk_2` FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON UPDATE CASCADE
atoulmeabd65d52009-01-09 23:47:54 +0000229) ENGINE=InnoDB DEFAULT CHARSET=utf8;
droy27e97e02007-11-27 16:44:19 +0000230
droy68864612009-04-14 15:44:05 +0000231CREATE INDEX idx_value ON strings(value(40));
droy44cb1ba2007-12-18 15:19:34 +0000232
droy44cb1ba2007-12-18 15:19:34 +0000233DELIMITER ;;
234CREATE TRIGGER `upd_string` AFTER UPDATE ON `strings` FOR EACH ROW
235 BEGIN
236 IF(NEW.value <> OLD.value) THEN
237 UPDATE translations SET possibly_incorrect = 1 WHERE string_id = NEW.string_id;
238 END IF;
239 END;
240;;
241DELIMITER ;
242
droy0757c2c2009-03-31 19:37:36 +0000243--
244-- Table structure for table `sys_values`
245--
246DROP TABLE IF EXISTS `sys_values`;
247CREATE TABLE `sys_values` (
248 `itemid` char(6) NOT NULL,
249 `value` text,
250 PRIMARY KEY (`itemid`)
251) ENGINE=InnoDB DEFAULT CHARSET=utf8;
droy44cb1ba2007-12-18 15:19:34 +0000252
droy27e97e02007-11-27 16:44:19 +0000253--
254-- Table structure for table `translation_archives`
255--
256
257DROP TABLE IF EXISTS `translation_archives`;
258CREATE TABLE `translation_archives` (
259 `translation_id` int(10) unsigned NOT NULL,
260 `string_id` int(10) unsigned NOT NULL,
261 `language_id` smallint(5) unsigned NOT NULL,
262 `version` int(10) unsigned NOT NULL default '1',
263 `value` text NOT NULL,
264 `is_active` tinyint(3) unsigned NOT NULL default '1',
265 `userid` int(10) unsigned NOT NULL,
266 `created_on` datetime NOT NULL,
267 PRIMARY KEY (`string_id`,`language_id`,`version`),
268 KEY `language_id` (`language_id`),
269 KEY `userid` (`userid`),
270 CONSTRAINT `translation_archives_ibfk_1` FOREIGN KEY (`string_id`) REFERENCES `strings` (`string_id`) ON UPDATE CASCADE,
271 CONSTRAINT `translation_archives_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`language_id`) ON UPDATE CASCADE,
272 CONSTRAINT `translation_archives_ibfk_3` FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON UPDATE CASCADE
273) ENGINE=InnoDB DEFAULT CHARSET=utf8;
274
275--
276-- Table structure for table `translations`
277--
278
279DROP TABLE IF EXISTS `translations`;
280CREATE TABLE `translations` (
281 `translation_id` int(10) unsigned NOT NULL auto_increment,
282 `string_id` int(10) unsigned NOT NULL,
283 `language_id` smallint(5) unsigned NOT NULL,
284 `version` int(10) unsigned NOT NULL default '1',
285 `value` text NOT NULL,
droy44cb1ba2007-12-18 15:19:34 +0000286 `possibly_incorrect` tinyint unsigned NOT NULL default '0',
droy27e97e02007-11-27 16:44:19 +0000287 `is_active` tinyint(3) unsigned NOT NULL default '1',
288 `userid` int(10) unsigned NOT NULL,
289 `created_on` datetime NOT NULL,
290 PRIMARY KEY (`string_id`,`language_id`,`version`),
291 KEY `translation_id` (`translation_id`),
292 KEY `language_id` (`language_id`),
293 KEY `userid` (`userid`),
droyd664f912008-05-14 15:45:10 +0000294 KEY `created_on` (`created_on`),
droy27e97e02007-11-27 16:44:19 +0000295 CONSTRAINT `translations_ibfk_1` FOREIGN KEY (`string_id`) REFERENCES `strings` (`string_id`) ON UPDATE CASCADE,
296 CONSTRAINT `translations_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`language_id`) ON UPDATE CASCADE,
297 CONSTRAINT `translations_ibfk_3` FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON UPDATE CASCADE
298) ENGINE=InnoDB DEFAULT CHARSET=utf8;
299
droy5d4b64c2008-02-29 15:22:10 +0000300SET @OLD_SQL_MODE=@@SQL_MODE;
droy27e97e02007-11-27 16:44:19 +0000301DELIMITER ;;
302/*!50003 SET SESSION SQL_MODE="" */;;
droy28b28792008-05-21 20:54:29 +0000303DROP TRIGGER IF EXISTS `ins_version`;;
droy27e97e02007-11-27 16:44:19 +0000304
droy5d4b64c2008-02-29 15:22:10 +0000305/* This trigger sets the version to max(version) + 1. It also updates the file_progress table */
droyd664f912008-05-14 15:45:10 +0000306/* 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 +0000307/* (COUNT(t.string_id) + 1) because it's a BEFORE INSERT trigger, the translated str is not in the DB yet */
308/* and without the +1 the percent would always be "one behind" */
309CREATE TRIGGER `ins_version` BEFORE INSERT ON `translations` FOR EACH ROW BEGIN
310 SET NEW.version =
311 (SELECT IFNULL(MAX(version),0)+1 FROM translations
312 WHERE string_id = NEW.string_id and language_id = NEW.language_id);
droyd664f912008-05-14 15:45:10 +0000313
314 /* Define a few fields we need here */
315 SET @FILE_ID=(SELECT file_id FROM strings WHERE string_id = NEW.string_id);
316 SET @PROJECT=(SELECT project_id FROM files WHERE file_id = @FILE_ID);
317 SET @VERSION=(SELECT version FROM files WHERE file_id = @FILE_ID);
droy5d4b64c2008-02-29 15:22:10 +0000318
droyd664f912008-05-14 15:45:10 +0000319
320 /* update this file's progress */
321 DELETE FROM file_progress where file_id = @FILE_ID
droy5d4b64c2008-02-29 15:22:10 +0000322 AND language_id = NEW.language_id;
323
droyd664f912008-05-14 15:45:10 +0000324 /* See notes above for the hairy select */
325 INSERT INTO file_progress SET file_id = @FILE_ID,
droy5d4b64c2008-02-29 15:22:10 +0000326 language_id = NEW.language_id,
327 pct_complete = (
droyd664f912008-05-14 15:45:10 +0000328 SELECT IF(NEW.version > 1,
329 IF(COUNT(s.string_id) > 0, (COUNT(t.string_id))/COUNT(s.string_id)*100,0),
330 IF(COUNT(s.string_id) > 0, (COUNT(t.string_id) + 1)/COUNT(s.string_id)*100,0)
331 ) AS translate_percent
droy5d4b64c2008-02-29 15:22:10 +0000332 FROM files AS f
droyd664f912008-05-14 15:45:10 +0000333 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 +0000334 LEFT JOIN translations AS t ON (s.string_id = t.string_id
335 AND t.language_id = NEW.language_id AND t.is_active = 1)
droyd664f912008-05-14 15:45:10 +0000336 WHERE f.file_id = @FILE_ID
337 );
droy6e6fb6d2008-05-15 17:11:29 +0000338
339
340 /* update project_progress table to indicate this proj/lang/vers stats are stale */
341 /* don't know if record is there or not, so do both an insert and an update */
droy0757c2c2009-03-31 19:37:36 +0000342 /* This portion of the trigger is similar to what is in the files table */
droy6e6fb6d2008-05-15 17:11:29 +0000343 UPDATE IGNORE project_progress SET is_stale = 1 where project_id = @PROJECT
droyd664f912008-05-14 15:45:10 +0000344 AND version = @VERSION
345 AND language_id = NEW.language_id;
droy6e6fb6d2008-05-15 17:11:29 +0000346
347 INSERT IGNORE INTO project_progress SET is_stale = 1, project_id = @PROJECT,
348 version = @VERSION,
349 language_id = NEW.language_id;
droyd664f912008-05-14 15:45:10 +0000350
droy5d4b64c2008-02-29 15:22:10 +0000351END;
352;;
droy27e97e02007-11-27 16:44:19 +0000353DELIMITER ;
354/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */;
355
356--
357-- Table structure for table `users`
358--
359
360DROP TABLE IF EXISTS `users`;
361CREATE TABLE `users` (
362 `userid` int(10) unsigned NOT NULL,
363 `username` varchar(256) NOT NULL default '',
364 `first_name` varchar(256) NOT NULL default '',
365 `last_name` varchar(256) NOT NULL default '',
366 `email` varchar(256) NOT NULL default '',
367 `primary_language_id` int(11) NOT NULL default '0',
368 `hours_per_week` int(11) NOT NULL default '0',
369 `password_hash` varchar(256) NOT NULL default '',
droy8da30b32007-11-29 21:00:26 +0000370 `is_committer` tinyint unsigned not null default 0,
droy27e97e02007-11-27 16:44:19 +0000371 `updated_on` date NOT NULL,
372 `updated_at` time NOT NULL,
373 `created_on` date NOT NULL,
374 `created_at` time NOT NULL,
375 PRIMARY KEY (`userid`),
376 KEY `primary_language_id` (`primary_language_id`)
377) ENGINE=InnoDB DEFAULT CHARSET=utf8;
droy97c86192007-11-28 22:00:22 +0000378
droy5bb81172008-04-04 19:25:24 +0000379DROP TABLE IF EXISTS `scoreboard`;
380CREATE TABLE `scoreboard` (
381 `id` int unsigned not null auto_increment,
382 `itemid` char(6) NOT NULL,
383 `value` varchar(256) NOT NULL default '',
384 `quantity` double NOT NULL default 0,
385 PRIMARY KEY (`id`),
386 KEY(`quantity`)
387) ENGINE=InnoDB DEFAULT CHARSET=utf8;
388
389
droy97c86192007-11-28 22:00:22 +0000390
391
droy27e97e02007-11-27 16:44:19 +0000392/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
393
394/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
395/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
396/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
397/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
398/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
399/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
400/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
401
droy6426bc02008-02-01 19:35:19 +0000402
403
404
405
406
407/*
408Babel data
409User: babel@eclipse.org
410pass: password
411*/
412
413insert into profiles set login_name = "test", cryptpassword = "", realname = "tester", disabledtext = false, mybugslink = 1, extern_id = 1, disable_mail = false;
droyeccd9832008-07-22 18:04:11 +0000414insert 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='';
kitlo2e780dc2010-01-12 17:58:32 +0000415
416insert into languages values (1, "en", null, "English", 1);
417insert into languages values (null, "fr", null, "French", 1);
418insert into languages values (null, "de", null, "German", 1);
419insert into languages values (null, "es", null, "Spanish", 1);
420insert into languages values (null, "it", null, "Italian", 1);
421insert into languages values (null, "ja", null, "Japanese", 1);
422insert into languages values (null, "ko", null, "Korean", 1);
423insert into languages values (null, "pt_BR", "Brazilian", "Portuguese", 1);
424insert into languages values (null, "zh", "Simplified", "Chinese", 1);
425insert into languages values (null, "zh_TW", "Traditional", "Chinese", 1);
426insert into languages values (null, "cs", null, "Czech", 1);
427insert into languages values (null, "hu", null, "Hungarian", 1);
428insert into languages values (null, "pl", null, "Polish", 1);
429insert into languages values (null, "ru", null, "Russian", 1);
430insert into languages values (null, "da", null, "Danish", 1);
431insert into languages values (null, "nl", null, "Dutch", 1);
432insert into languages values (null, "fi", null, "Finnish", 1);
433insert into languages values (null, "el", null, "Greek", 1);
434insert into languages values (null, "no", null, "Norwegian", 1);
435insert into languages values (null, "pt", null, "Portuguese", 1);
436insert into languages values (null, "sv", null, "Swedish", 1);
437insert into languages values (null, "tr", null, "Turkish", 1);
438insert into languages values (null, "ar", null, "Arabic", 1);
439insert into languages values (null, "iw", null, "Hebrew", 1);
440insert into languages values (null, "hi", null, "Hindi", 1);
441insert into languages values (null, "ro", null, "Romanian", 1);
442insert into languages values (null, "uk", null, "Ukrainian", 1);
443insert into languages values (null, "ca", null, "Catalan", 1);
444insert into languages values (null, "et", null, "Estonian", 1);
445insert into languages values (null, "en_CA", "Canadian", "English", 1);
446insert into languages values (null, "en_AU", "Australian", "English", 1);
447insert into languages values (null, "mn", null, "Mongolian", 1);
448insert into languages values (null, "id", null, "Indonesian", 1);
449insert into languages values (null, "bg", null, "Bulgarian", 1);
450insert into languages values (null, "tl", null, "Klingon", 1);
451
droy6426bc02008-02-01 19:35:19 +0000452insert into projects set project_id = 'eclipse', is_active = 1 ;
droy2df74062008-07-03 12:45:46 +0000453insert into projects set project_id = 'birt', is_active = 1 ;
454insert into projects set project_id = 'modeling.emf', is_active = 1 ;
455insert into projects set project_id = 'modeling.emft', is_active = 1 ;
456insert into projects set project_id = 'modeling.gmf', is_active = 1 ;
457insert into projects set project_id = 'modeling.mdt', is_active = 1 ;
458insert into projects set project_id = 'stp', is_active = 1 ;
459insert into projects set project_id = 'tools.cdt', is_active = 1 ;
460insert into projects set project_id = 'tools.gef', is_active = 1 ;
461insert into projects set project_id = 'tools.pdt', is_active = 1 ;
462insert into projects set project_id = 'webtools', is_active = 1 ;
463
kitlo2e780dc2010-01-12 17:58:32 +0000464insert into project_versions set project_id = "eclipse", version = "3.3.1", is_active = 1;
465insert into project_versions set project_id = "birt", version = "2.2.0", is_active = 1;
466insert into project_versions set project_id = "stp", version = "0.8", is_active = 1;
droy2bbc1ff2008-10-30 20:30:25 +0000467
droy6426bc02008-02-01 19:35:19 +0000468insert into project_versions set project_id = "eclipse", version = "3.4", is_active = 1;
droy2df74062008-07-03 12:45:46 +0000469insert into project_versions set project_id = "birt", version = "2.3.0", is_active = 1;
470insert into project_versions set project_id = "modeling.emf", version = "2.4.0", is_active = 1;
471insert into project_versions set project_id = "modeling.emft", version = "0.8", is_active = 1;
472insert into project_versions set project_id = "modeling.gmf", version = "2.1", is_active = 1;
473insert into project_versions set project_id = "modeling.mdt", version = "2.4.0", is_active = 1;
474insert into project_versions set project_id = "stp", version = "1.0", is_active = 1;
475insert into project_versions set project_id = "tools.cdt", version = "5.0", is_active = 1;
476insert into project_versions set project_id = "tools.gef", version = "3.4", is_active = 1;
477insert into project_versions set project_id = "tools.pdt", version = "1.5.1", is_active = 1;
478insert into project_versions set project_id = "webtools", version = "3.0", is_active = 1;
droy6426bc02008-02-01 19:35:19 +0000479
kitlo2e780dc2010-01-12 17:58:32 +0000480insert into project_versions set project_id = "eclipse", version = "3.5", is_active = 1;
481insert into project_versions set project_id = "birt", version = "2.5.0", is_active = 1;
482insert into project_versions set project_id = "webtools", version = "3.1", is_active = 1;
483
484insert into project_versions set project_id = "eclipse", version = "3.6", is_active = 1;
485insert into project_versions set project_id = "birt", version = "2.6.0", is_active = 1;
486insert into project_versions set project_id = "webtools", version = "3.2", is_active = 1;
487
488insert into release_train_projects values ('europa', 'eclipse', '3.3.1');
489insert into release_train_projects values ('europa', 'birt', '2.2.0');
490insert into release_train_projects values ('europa', 'stp', '0.8');
491
492insert into release_train_projects values ('ganymede', 'eclipse', '3.4');
493insert into release_train_projects values ('ganymede', 'birt', '2.3.0');
494insert into release_train_projects values ('ganymede', 'modeling.emf', '2.4.0');
495insert into release_train_projects values ('ganymede', 'modeling.emft', '0.8');
496insert into release_train_projects values ('ganymede', 'modeling.gmf', '2.1');
497insert into release_train_projects values ('ganymede', 'modeling.mdt', '2.4.0');
498insert into release_train_projects values ('ganymede', 'stp', '1.0');
499insert into release_train_projects values ('ganymede', 'tools.cdt', '5.0');
500insert into release_train_projects values ('ganymede', 'tools.gef', '3.4');
501insert into release_train_projects values ('ganymede', 'tools.pdt', '1.5.1');
502insert into release_train_projects values ('ganymede', 'webtools', '3.0');
503
504insert into release_train_projects values ('galileo', 'eclipse', '3.5');
505insert into release_train_projects values ('galileo', 'birt', '2.5.0');
506insert into release_train_projects values ('galileo', 'webtools', '3.1');
507
508insert into release_train_projects values ('helios', 'eclipse', '3.6');
509insert into release_train_projects values ('helios', 'birt', '2.6.0');
510insert into release_train_projects values ('helios', 'webtools', '3.2');
511
droy6426bc02008-02-01 19:35:19 +0000512/* MAP INPUTS */
513insert 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);
514insert 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);
515insert 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);
516insert 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);
517insert 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);
518insert 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);
519insert 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);
520insert 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);
521insert 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);
522insert 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);
523insert 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);
524insert 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);
525insert 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);
526insert 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);
527insert 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);
528insert 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);
529insert 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);
530insert 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);
531insert 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);
532insert 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);
533insert 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);
534insert 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);
535insert 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);
536insert 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);
537insert 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 +0000538insert 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 +0000539
540/* populate file_progress table */
droydc294842008-05-21 17:38:57 +0000541/* See also: dbmaintenance_15min.php */
droybafb7c42008-02-29 18:24:38 +0000542truncate table file_progress;
543INSERT INTO file_progress
droyc2c26102008-05-21 16:01:40 +0000544select 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 +0000545FROM files AS f
546 INNER JOIN languages as l ON l.is_active = 1
droy45413ea2008-07-28 14:36:23 +0000547 LEFT JOIN strings as s ON (s.file_id = f.file_id AND s.is_active AND s.value <> "" AND s.non_translatable = 0)
droybafb7c42008-02-29 18:24:38 +0000548 LEFT JOIN translations AS t ON (s.string_id = t.string_id
549 AND t.language_id = l.language_id AND t.is_active = 1)
550WHERE f.is_active = 1
551GROUP BY f.file_id, l.language_id;
droy5bb81172008-04-04 19:25:24 +0000552DELETE FROM file_progress WHERE pct_complete = 0;
553
droyd664f912008-05-14 15:45:10 +0000554/* populate project_progress table */
555truncate table project_progress;
556INSERT INTO project_progress
557SELECT
558 p.project_id,
559 v.version,
560 l.language_id,
droyb156beb2008-05-15 17:16:44 +0000561 IF(COUNT(s.string_id) > 0, ROUND(COUNT(t.string_id)/COUNT(s.string_id) * 100, 2), 0) AS pct_complete,
562 0
droyd664f912008-05-14 15:45:10 +0000563FROM projects as p
564 INNER JOIN project_versions AS v ON v.project_id = p.project_id
565 INNER JOIN files AS f
566 ON (f.project_id = p.project_id AND f.version = v.version AND f.is_active)
567 INNER JOIN strings AS s
568 ON (s.file_id = f.file_id AND s.is_active)
569 INNER JOIN languages AS l
570 LEFT JOIN translations AS t
571 ON (t.string_id = s.string_id AND t.language_id = l.language_id AND t.is_active)
572WHERE
573 s.value <> ""
droy45413ea2008-07-28 14:36:23 +0000574 AND s.non_translatable = 0
droyd664f912008-05-14 15:45:10 +0000575 AND p.is_active
576GROUP BY p.project_id, v.version, l.language_id;
577
droy5bb81172008-04-04 19:25:24 +0000578/* populate scoreboard */
579truncate table scoreboard;
580INSERT 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;
581INSERT 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;
droy0757c2c2009-03-31 19:37:36 +0000582INSERT INTO scoreboard SELECT NULL, "LASGEN", "Scoreboard Last Generated", MAX(translation_id) FROM translations;
583
584/* create a holding record for the MOTD */
585INSERT INTO sys_values VALUES ("MOTD", NULL);