blob: 62ecdeb8c3aae6599e9c05f70993cf70e4d67691 [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 */
droy2251ca92010-01-20 14:08:49 +000065 /* 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
droy0757c2c2009-03-31 19:37:36 +000069 UPDATE IGNORE project_progress SET is_stale = 1 where project_id = @PROJECT
droy2251ca92010-01-20 14:08:49 +000070 AND version = @VERSION;
droy0757c2c2009-03-31 19:37:36 +000071END;
72;;
73DELIMITER ;
74/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */;
75
76
droy27e97e02007-11-27 16:44:19 +000077--
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,
droyc94a4522008-02-05 15:36:53 +000084 `iso_code` varchar(6) NOT NULL,
droy27e97e02007-11-27 16:44:19 +000085 `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
droy3bb0c962008-01-17 20:45:01 +000093--
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',
kitlod66aa992010-01-22 17:18:19 +0000104 `is_map_file` tinyint(3) unsigned NOT NULL default '1',
droy3bb0c962008-01-17 20:45:01 +0000105 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
droy27e97e02007-11-27 16:44:19 +0000109--
kitlod66aa992010-01-22 17:18:19 +0000110-- Table structure for table `plugin_exclude_patterns`
111--
112
113DROP TABLE IF EXISTS `plugin_exclude_patterns`;
114CREATE TABLE `plugin_exclude_patterns` (
115 `project_id` varchar(100) NOT NULL,
116 `version` varchar(64) NOT NULL,
117 `pattern` varchar(128) NOT NULL,
118 PRIMARY KEY (`project_id`, `version`, `pattern`),
119 CONSTRAINT `plugin_exclude_patterns_ibfk_1` FOREIGN KEY (`project_id`) REFERENCES `projects` (`project_id`) ON UPDATE CASCADE ON DELETE CASCADE
120) ENGINE=InnoDB DEFAULT CHARSET=utf8;
121
122--
droy27e97e02007-11-27 16:44:19 +0000123-- Table structure for table `profiles`
124--
125
126DROP TABLE IF EXISTS `profiles`;
127CREATE TABLE `profiles` (
128 `userid` mediumint(9) NOT NULL auto_increment,
129 `login_name` varchar(255) NOT NULL default '',
130 `cryptpassword` varchar(128) default NULL,
131 `realname` varchar(255) NOT NULL default '',
132 `disabledtext` mediumtext NOT NULL,
133 `mybugslink` tinyint(4) NOT NULL default '1',
134 `extern_id` varchar(64) default NULL,
135 `disable_mail` tinyint(4) NOT NULL default '0',
136 PRIMARY KEY (`userid`),
137 UNIQUE KEY `profiles_login_name_idx` (`login_name`)
138) ENGINE=MyISAM DEFAULT CHARSET=latin1;
139
140--
141-- Table structure for table `projects`
142--
143
144DROP TABLE IF EXISTS `projects`;
145CREATE TABLE `projects` (
146 `project_id` varchar(100) NOT NULL,
147 `is_active` tinyint(3) unsigned NOT NULL default '1',
148 PRIMARY KEY (`project_id`)
149) ENGINE=InnoDB DEFAULT CHARSET=utf8;
150
kitloe3fea252010-01-25 02:13:49 +0000151--
152-- Table structure for table `project_progress`
153--
154
droyd664f912008-05-14 15:45:10 +0000155DROP TABLE IF EXISTS `project_progress`;
156CREATE TABLE `project_progress` (
157 `project_id` varchar(100) NOT NULL,
158 `version` varchar(64) NOT NULL,
159 `language_id` smallint(5) unsigned NOT NULL,
160 `pct_complete` float NOT NULL,
droy6e6fb6d2008-05-15 17:11:29 +0000161 `is_stale` tinyint unsigned not null default 0,
droyd664f912008-05-14 15:45:10 +0000162 PRIMARY KEY (`project_id`, `version`, `language_id`),
163 CONSTRAINT `project_progress_ibfk_1` FOREIGN KEY (`project_id`, `version`) REFERENCES `project_versions` (`project_id`, `version`) ON UPDATE CASCADE ON DELETE CASCADE,
164 CONSTRAINT `project_progress_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`language_id`) ON UPDATE CASCADE ON DELETE CASCADE
165) ENGINE=InnoDB DEFAULT CHARSET=utf8;
166
kitloe3fea252010-01-25 02:13:49 +0000167--
168-- Table structure for table `project_versions`
169--
droyd664f912008-05-14 15:45:10 +0000170
droyc081e862007-11-30 16:37:35 +0000171DROP TABLE IF EXISTS `project_versions`;
172CREATE TABLE `project_versions` (
173 `project_id` varchar(100) NOT NULL,
droy44cb1ba2007-12-18 15:19:34 +0000174 `version` varchar(64) NOT NULL,
droyc081e862007-11-30 16:37:35 +0000175 `is_active` tinyint(3) unsigned NOT NULL default '1',
176 PRIMARY KEY (`project_id`, `version`),
177 CONSTRAINT `project_versions_ibfk_1` FOREIGN KEY (`project_id`) REFERENCES `projects` (`project_id`) ON UPDATE CASCADE ON DELETE CASCADE
178) ENGINE=InnoDB DEFAULT CHARSET=utf8;
179
droy27e97e02007-11-27 16:44:19 +0000180--
181-- Table structure for table `ratings`
182--
183
184DROP TABLE IF EXISTS `ratings`;
185CREATE TABLE `ratings` (
186 `translation_id` int(10) unsigned NOT NULL,
187 `userid` int(10) unsigned NOT NULL,
188 `rating` tinyint(3) unsigned NOT NULL default '0',
189 `created_on` datetime NOT NULL,
190 PRIMARY KEY (`translation_id`,`userid`),
191 CONSTRAINT `ratings_ibfk_1` FOREIGN KEY (`translation_id`) REFERENCES `translations` (`translation_id`) ON UPDATE CASCADE
192) ENGINE=InnoDB DEFAULT CHARSET=utf8;
193
kitloe3fea252010-01-25 02:13:49 +0000194--
195-- Table structure for table `release_trains`
196--
197
198DROP TABLE IF EXISTS `release_trains`;
199CREATE TABLE `release_trains` (
200 `train_id` varchar(30) NOT NULL,
201 `train_version` varchar(64) NOT NULL,
202 PRIMARY KEY (`train_id`, `train_version`)
203) ENGINE=InnoDB DEFAULT CHARSET=utf8;
204
205--
206-- Table structure for table `release_train_projects`
207--
208
droy684f2b62008-06-02 20:52:29 +0000209DROP TABLE IF EXISTS `release_train_projects`;
210CREATE TABLE `release_train_projects` (
211 `train_id` varchar(30) NOT NULL,
212 `project_id` varchar(100) NOT NULL,
213 `version` varchar(64) NOT NULL,
214 PRIMARY KEY (`train_id`, `project_id`, `version`),
215 CONSTRAINT `release_train_progress_ibfk_1` FOREIGN KEY (`project_id`, `version`) REFERENCES `project_versions` (`project_id`, `version`) ON UPDATE CASCADE ON DELETE CASCADE
216) ENGINE=InnoDB DEFAULT CHARSET=utf8;
217
droy27e97e02007-11-27 16:44:19 +0000218--
219-- Table structure for table `schema_info`
220--
221
222DROP TABLE IF EXISTS `schema_info`;
223CREATE TABLE `schema_info` (
224 `version` int(11) default NULL
225) ENGINE=MyISAM DEFAULT CHARSET=latin1;
226
227--
228-- Table structure for table `sessions`
229--
230
231DROP TABLE IF EXISTS `sessions`;
232CREATE TABLE `sessions` (
233 `id` int(11) unsigned NOT NULL auto_increment,
234 `userid` int(11) NOT NULL,
235 `gid` char(32) default NULL,
236 `subnet` char(15) default NULL,
237 `updated_at` datetime default NULL,
238 PRIMARY KEY (`id`),
239 KEY `gid` (`gid`),
240 KEY `userid` (`userid`)
241) ENGINE=InnoDB DEFAULT CHARSET=latin1;
242
243--
244-- Table structure for table `strings`
245--
246
droy27e97e02007-11-27 16:44:19 +0000247CREATE TABLE `strings` (
248 `string_id` int(10) unsigned NOT NULL auto_increment,
249 `file_id` int(10) unsigned NOT NULL,
250 `name` text NOT NULL,
251 `value` text NOT NULL,
252 `userid` int(10) unsigned NOT NULL,
253 `created_on` datetime NOT NULL,
254 `is_active` tinyint(1) unsigned default NULL,
droy0e2dff42008-09-24 15:35:34 +0000255 `non_translatable` tinyint(4) default '0',
droy27e97e02007-11-27 16:44:19 +0000256 PRIMARY KEY (`string_id`),
257 KEY `file_id` (`file_id`),
258 KEY `userid` (`userid`),
259 CONSTRAINT `strings_ibfk_1` FOREIGN KEY (`file_id`) REFERENCES `files` (`file_id`) ON UPDATE CASCADE,
260 CONSTRAINT `strings_ibfk_2` FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON UPDATE CASCADE
atoulmeabd65d52009-01-09 23:47:54 +0000261) ENGINE=InnoDB DEFAULT CHARSET=utf8;
droy27e97e02007-11-27 16:44:19 +0000262
droy68864612009-04-14 15:44:05 +0000263CREATE INDEX idx_value ON strings(value(40));
droy44cb1ba2007-12-18 15:19:34 +0000264
droy44cb1ba2007-12-18 15:19:34 +0000265DELIMITER ;;
266CREATE TRIGGER `upd_string` AFTER UPDATE ON `strings` FOR EACH ROW
267 BEGIN
268 IF(NEW.value <> OLD.value) THEN
269 UPDATE translations SET possibly_incorrect = 1 WHERE string_id = NEW.string_id;
270 END IF;
271 END;
272;;
273DELIMITER ;
274
droy0757c2c2009-03-31 19:37:36 +0000275--
276-- Table structure for table `sys_values`
277--
278DROP TABLE IF EXISTS `sys_values`;
279CREATE TABLE `sys_values` (
280 `itemid` char(6) NOT NULL,
281 `value` text,
282 PRIMARY KEY (`itemid`)
283) ENGINE=InnoDB DEFAULT CHARSET=utf8;
droy44cb1ba2007-12-18 15:19:34 +0000284
droy27e97e02007-11-27 16:44:19 +0000285--
286-- Table structure for table `translation_archives`
287--
288
289DROP TABLE IF EXISTS `translation_archives`;
290CREATE TABLE `translation_archives` (
291 `translation_id` int(10) unsigned NOT NULL,
292 `string_id` int(10) unsigned NOT NULL,
293 `language_id` smallint(5) unsigned NOT NULL,
294 `version` int(10) unsigned NOT NULL default '1',
295 `value` text NOT NULL,
296 `is_active` tinyint(3) unsigned NOT NULL default '1',
297 `userid` int(10) unsigned NOT NULL,
298 `created_on` datetime NOT NULL,
299 PRIMARY KEY (`string_id`,`language_id`,`version`),
300 KEY `language_id` (`language_id`),
301 KEY `userid` (`userid`),
302 CONSTRAINT `translation_archives_ibfk_1` FOREIGN KEY (`string_id`) REFERENCES `strings` (`string_id`) ON UPDATE CASCADE,
303 CONSTRAINT `translation_archives_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`language_id`) ON UPDATE CASCADE,
304 CONSTRAINT `translation_archives_ibfk_3` FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON UPDATE CASCADE
305) ENGINE=InnoDB DEFAULT CHARSET=utf8;
306
307--
308-- Table structure for table `translations`
309--
310
311DROP TABLE IF EXISTS `translations`;
312CREATE TABLE `translations` (
313 `translation_id` int(10) unsigned NOT NULL auto_increment,
314 `string_id` int(10) unsigned NOT NULL,
315 `language_id` smallint(5) unsigned NOT NULL,
316 `version` int(10) unsigned NOT NULL default '1',
317 `value` text NOT NULL,
droy44cb1ba2007-12-18 15:19:34 +0000318 `possibly_incorrect` tinyint unsigned NOT NULL default '0',
droy27e97e02007-11-27 16:44:19 +0000319 `is_active` tinyint(3) unsigned NOT NULL default '1',
320 `userid` int(10) unsigned NOT NULL,
321 `created_on` datetime NOT NULL,
322 PRIMARY KEY (`string_id`,`language_id`,`version`),
323 KEY `translation_id` (`translation_id`),
324 KEY `language_id` (`language_id`),
325 KEY `userid` (`userid`),
droyd664f912008-05-14 15:45:10 +0000326 KEY `created_on` (`created_on`),
droy27e97e02007-11-27 16:44:19 +0000327 CONSTRAINT `translations_ibfk_1` FOREIGN KEY (`string_id`) REFERENCES `strings` (`string_id`) ON UPDATE CASCADE,
328 CONSTRAINT `translations_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`language_id`) ON UPDATE CASCADE,
329 CONSTRAINT `translations_ibfk_3` FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON UPDATE CASCADE
330) ENGINE=InnoDB DEFAULT CHARSET=utf8;
331
droy5d4b64c2008-02-29 15:22:10 +0000332SET @OLD_SQL_MODE=@@SQL_MODE;
droy27e97e02007-11-27 16:44:19 +0000333DELIMITER ;;
334/*!50003 SET SESSION SQL_MODE="" */;;
droy28b28792008-05-21 20:54:29 +0000335DROP TRIGGER IF EXISTS `ins_version`;;
droy27e97e02007-11-27 16:44:19 +0000336
droy5d4b64c2008-02-29 15:22:10 +0000337/* This trigger sets the version to max(version) + 1. It also updates the file_progress table */
droyd664f912008-05-14 15:45:10 +0000338/* 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 +0000339/* (COUNT(t.string_id) + 1) because it's a BEFORE INSERT trigger, the translated str is not in the DB yet */
340/* and without the +1 the percent would always be "one behind" */
341CREATE TRIGGER `ins_version` BEFORE INSERT ON `translations` FOR EACH ROW BEGIN
342 SET NEW.version =
343 (SELECT IFNULL(MAX(version),0)+1 FROM translations
344 WHERE string_id = NEW.string_id and language_id = NEW.language_id);
droyd664f912008-05-14 15:45:10 +0000345
346 /* Define a few fields we need here */
347 SET @FILE_ID=(SELECT file_id FROM strings WHERE string_id = NEW.string_id);
348 SET @PROJECT=(SELECT project_id FROM files WHERE file_id = @FILE_ID);
349 SET @VERSION=(SELECT version FROM files WHERE file_id = @FILE_ID);
droy5d4b64c2008-02-29 15:22:10 +0000350
droyd664f912008-05-14 15:45:10 +0000351
352 /* update this file's progress */
353 DELETE FROM file_progress where file_id = @FILE_ID
droy5d4b64c2008-02-29 15:22:10 +0000354 AND language_id = NEW.language_id;
355
droyd664f912008-05-14 15:45:10 +0000356 /* See notes above for the hairy select */
357 INSERT INTO file_progress SET file_id = @FILE_ID,
droy5d4b64c2008-02-29 15:22:10 +0000358 language_id = NEW.language_id,
359 pct_complete = (
droyd664f912008-05-14 15:45:10 +0000360 SELECT IF(NEW.version > 1,
361 IF(COUNT(s.string_id) > 0, (COUNT(t.string_id))/COUNT(s.string_id)*100,0),
362 IF(COUNT(s.string_id) > 0, (COUNT(t.string_id) + 1)/COUNT(s.string_id)*100,0)
363 ) AS translate_percent
droy5d4b64c2008-02-29 15:22:10 +0000364 FROM files AS f
droyd664f912008-05-14 15:45:10 +0000365 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 +0000366 LEFT JOIN translations AS t ON (s.string_id = t.string_id
367 AND t.language_id = NEW.language_id AND t.is_active = 1)
droyd664f912008-05-14 15:45:10 +0000368 WHERE f.file_id = @FILE_ID
369 );
droy6e6fb6d2008-05-15 17:11:29 +0000370
371
372 /* update project_progress table to indicate this proj/lang/vers stats are stale */
373 /* don't know if record is there or not, so do both an insert and an update */
droy0757c2c2009-03-31 19:37:36 +0000374 /* This portion of the trigger is similar to what is in the files table */
droy6e6fb6d2008-05-15 17:11:29 +0000375 UPDATE IGNORE project_progress SET is_stale = 1 where project_id = @PROJECT
droyd664f912008-05-14 15:45:10 +0000376 AND version = @VERSION
377 AND language_id = NEW.language_id;
droy6e6fb6d2008-05-15 17:11:29 +0000378
379 INSERT IGNORE INTO project_progress SET is_stale = 1, project_id = @PROJECT,
380 version = @VERSION,
381 language_id = NEW.language_id;
droyd664f912008-05-14 15:45:10 +0000382
droy5d4b64c2008-02-29 15:22:10 +0000383END;
384;;
droy27e97e02007-11-27 16:44:19 +0000385DELIMITER ;
386/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */;
387
388--
389-- Table structure for table `users`
390--
391
392DROP TABLE IF EXISTS `users`;
393CREATE TABLE `users` (
394 `userid` int(10) unsigned NOT NULL,
395 `username` varchar(256) NOT NULL default '',
396 `first_name` varchar(256) NOT NULL default '',
397 `last_name` varchar(256) NOT NULL default '',
398 `email` varchar(256) NOT NULL default '',
399 `primary_language_id` int(11) NOT NULL default '0',
400 `hours_per_week` int(11) NOT NULL default '0',
401 `password_hash` varchar(256) NOT NULL default '',
droy8da30b32007-11-29 21:00:26 +0000402 `is_committer` tinyint unsigned not null default 0,
droy27e97e02007-11-27 16:44:19 +0000403 `updated_on` date NOT NULL,
404 `updated_at` time NOT NULL,
405 `created_on` date NOT NULL,
406 `created_at` time NOT NULL,
407 PRIMARY KEY (`userid`),
408 KEY `primary_language_id` (`primary_language_id`)
409) ENGINE=InnoDB DEFAULT CHARSET=utf8;
droy97c86192007-11-28 22:00:22 +0000410
droy5bb81172008-04-04 19:25:24 +0000411DROP TABLE IF EXISTS `scoreboard`;
412CREATE TABLE `scoreboard` (
413 `id` int unsigned not null auto_increment,
414 `itemid` char(6) NOT NULL,
415 `value` varchar(256) NOT NULL default '',
416 `quantity` double NOT NULL default 0,
417 PRIMARY KEY (`id`),
418 KEY(`quantity`)
419) ENGINE=InnoDB DEFAULT CHARSET=utf8;
420
421
droy97c86192007-11-28 22:00:22 +0000422
423
droy27e97e02007-11-27 16:44:19 +0000424/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
425
426/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
427/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
428/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
429/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
430/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
431/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
432/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
433
droy6426bc02008-02-01 19:35:19 +0000434
435
436
437
438
439/*
440Babel data
441User: babel@eclipse.org
442pass: password
443*/
444
445insert 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 +0000446insert 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 +0000447
448insert into languages values (1, "en", null, "English", 1);
449insert into languages values (null, "fr", null, "French", 1);
450insert into languages values (null, "de", null, "German", 1);
451insert into languages values (null, "es", null, "Spanish", 1);
452insert into languages values (null, "it", null, "Italian", 1);
453insert into languages values (null, "ja", null, "Japanese", 1);
454insert into languages values (null, "ko", null, "Korean", 1);
455insert into languages values (null, "pt_BR", "Brazilian", "Portuguese", 1);
456insert into languages values (null, "zh", "Simplified", "Chinese", 1);
457insert into languages values (null, "zh_TW", "Traditional", "Chinese", 1);
458insert into languages values (null, "cs", null, "Czech", 1);
459insert into languages values (null, "hu", null, "Hungarian", 1);
460insert into languages values (null, "pl", null, "Polish", 1);
461insert into languages values (null, "ru", null, "Russian", 1);
462insert into languages values (null, "da", null, "Danish", 1);
463insert into languages values (null, "nl", null, "Dutch", 1);
464insert into languages values (null, "fi", null, "Finnish", 1);
465insert into languages values (null, "el", null, "Greek", 1);
466insert into languages values (null, "no", null, "Norwegian", 1);
467insert into languages values (null, "pt", null, "Portuguese", 1);
468insert into languages values (null, "sv", null, "Swedish", 1);
469insert into languages values (null, "tr", null, "Turkish", 1);
470insert into languages values (null, "ar", null, "Arabic", 1);
471insert into languages values (null, "iw", null, "Hebrew", 1);
472insert into languages values (null, "hi", null, "Hindi", 1);
473insert into languages values (null, "ro", null, "Romanian", 1);
474insert into languages values (null, "uk", null, "Ukrainian", 1);
475insert into languages values (null, "ca", null, "Catalan", 1);
476insert into languages values (null, "et", null, "Estonian", 1);
477insert into languages values (null, "en_CA", "Canadian", "English", 1);
478insert into languages values (null, "en_AU", "Australian", "English", 1);
479insert into languages values (null, "mn", null, "Mongolian", 1);
480insert into languages values (null, "id", null, "Indonesian", 1);
481insert into languages values (null, "bg", null, "Bulgarian", 1);
482insert into languages values (null, "tl", null, "Klingon", 1);
483
droy6426bc02008-02-01 19:35:19 +0000484insert into projects set project_id = 'eclipse', is_active = 1 ;
droy2df74062008-07-03 12:45:46 +0000485insert into projects set project_id = 'birt', is_active = 1 ;
486insert into projects set project_id = 'modeling.emf', is_active = 1 ;
487insert into projects set project_id = 'modeling.emft', is_active = 1 ;
488insert into projects set project_id = 'modeling.gmf', is_active = 1 ;
489insert into projects set project_id = 'modeling.mdt', is_active = 1 ;
490insert into projects set project_id = 'stp', is_active = 1 ;
491insert into projects set project_id = 'tools.cdt', is_active = 1 ;
492insert into projects set project_id = 'tools.gef', is_active = 1 ;
493insert into projects set project_id = 'tools.pdt', is_active = 1 ;
494insert into projects set project_id = 'webtools', is_active = 1 ;
495
kitlo2e780dc2010-01-12 17:58:32 +0000496insert into project_versions set project_id = "eclipse", version = "3.3.1", is_active = 1;
497insert into project_versions set project_id = "birt", version = "2.2.0", is_active = 1;
498insert into project_versions set project_id = "stp", version = "0.8", is_active = 1;
droy2bbc1ff2008-10-30 20:30:25 +0000499
droy6426bc02008-02-01 19:35:19 +0000500insert into project_versions set project_id = "eclipse", version = "3.4", is_active = 1;
droy2df74062008-07-03 12:45:46 +0000501insert into project_versions set project_id = "birt", version = "2.3.0", is_active = 1;
502insert into project_versions set project_id = "modeling.emf", version = "2.4.0", is_active = 1;
503insert into project_versions set project_id = "modeling.emft", version = "0.8", is_active = 1;
504insert into project_versions set project_id = "modeling.gmf", version = "2.1", is_active = 1;
505insert into project_versions set project_id = "modeling.mdt", version = "2.4.0", is_active = 1;
506insert into project_versions set project_id = "stp", version = "1.0", is_active = 1;
507insert into project_versions set project_id = "tools.cdt", version = "5.0", is_active = 1;
508insert into project_versions set project_id = "tools.gef", version = "3.4", is_active = 1;
509insert into project_versions set project_id = "tools.pdt", version = "1.5.1", is_active = 1;
510insert into project_versions set project_id = "webtools", version = "3.0", is_active = 1;
droy6426bc02008-02-01 19:35:19 +0000511
kitlo2e780dc2010-01-12 17:58:32 +0000512insert into project_versions set project_id = "eclipse", version = "3.5", is_active = 1;
513insert into project_versions set project_id = "birt", version = "2.5.0", is_active = 1;
514insert into project_versions set project_id = "webtools", version = "3.1", is_active = 1;
515
516insert into project_versions set project_id = "eclipse", version = "3.6", is_active = 1;
kitloe3fea252010-01-25 02:13:49 +0000517
518insert into release_trains values ('europa', '3.3.1');
519insert into release_trains values ('ganymede', '3.4.0');
520insert into release_trains values ('galileo', '3.5.0');
521insert into release_trains values ('helios', '3.6.0');
kitlo2e780dc2010-01-12 17:58:32 +0000522
523insert into release_train_projects values ('europa', 'eclipse', '3.3.1');
524insert into release_train_projects values ('europa', 'birt', '2.2.0');
525insert into release_train_projects values ('europa', 'stp', '0.8');
526
527insert into release_train_projects values ('ganymede', 'eclipse', '3.4');
528insert into release_train_projects values ('ganymede', 'birt', '2.3.0');
529insert into release_train_projects values ('ganymede', 'modeling.emf', '2.4.0');
530insert into release_train_projects values ('ganymede', 'modeling.emft', '0.8');
531insert into release_train_projects values ('ganymede', 'modeling.gmf', '2.1');
532insert into release_train_projects values ('ganymede', 'modeling.mdt', '2.4.0');
533insert into release_train_projects values ('ganymede', 'stp', '1.0');
534insert into release_train_projects values ('ganymede', 'tools.cdt', '5.0');
535insert into release_train_projects values ('ganymede', 'tools.gef', '3.4');
536insert into release_train_projects values ('ganymede', 'tools.pdt', '1.5.1');
537insert into release_train_projects values ('ganymede', 'webtools', '3.0');
538
539insert into release_train_projects values ('galileo', 'eclipse', '3.5');
540insert into release_train_projects values ('galileo', 'birt', '2.5.0');
541insert into release_train_projects values ('galileo', 'webtools', '3.1');
542
543insert into release_train_projects values ('helios', 'eclipse', '3.6');
kitlo2e780dc2010-01-12 17:58:32 +0000544
droy6426bc02008-02-01 19:35:19 +0000545/* MAP INPUTS */
kitlod66aa992010-01-22 17:18:19 +0000546insert 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, 1);
547insert 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, 1);
548insert 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, 1);
549insert 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, 1);
550insert 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, 1);
551insert 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, 1);
552insert 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, 1);
553insert 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, 1);
554insert 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, 1);
555insert 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, 1);
556insert 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, 1);
557insert 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, 1);
558insert 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, 1);
559insert 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, 1);
560insert 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, 1);
561insert 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, 1);
562insert 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, 1);
563insert 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, 1);
564insert 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, 1);
565insert 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, 1);
566insert 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, 1);
567insert 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, 1);
568insert 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, 1);
569insert 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, 1);
570insert 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, 1);
571insert 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, 1);
droybafb7c42008-02-29 18:24:38 +0000572
kitloe3fea252010-01-25 02:13:49 +0000573insert into map_files values ("eclipse", "3.6", "eclipse-3.6-updateSite", "http://download.eclipse.org/eclipse/updates/3.6milestones/S-3.6M4-200912101301", 1, 0);
574
575insert into plugin_exclude_patterns values ("eclipse", "3.6", "/^com\.jcraft\..*$/");
576insert into plugin_exclude_patterns values ("eclipse", "3.6", "/^javax\..*$/");
577insert into plugin_exclude_patterns values ("eclipse", "3.6", "/^org\.apache\..*$/");
578insert into plugin_exclude_patterns values ("eclipse", "3.6", "/^org\.hamcrest\..*$/");
579insert into plugin_exclude_patterns values ("eclipse", "3.6", "/^org\.junit.*$/");
580insert into plugin_exclude_patterns values ("eclipse", "3.6", "/^org\.mortbay\..*$/");
581insert into plugin_exclude_patterns values ("eclipse", "3.6", "/^org\.objectweb\..*$/");
582insert into plugin_exclude_patterns values ("eclipse", "3.6", "/^org\.sat4j\..*$/");
583
droybafb7c42008-02-29 18:24:38 +0000584/* populate file_progress table */
droydc294842008-05-21 17:38:57 +0000585/* See also: dbmaintenance_15min.php */
droybafb7c42008-02-29 18:24:38 +0000586truncate table file_progress;
587INSERT INTO file_progress
droyc2c26102008-05-21 16:01:40 +0000588select 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 +0000589FROM files AS f
590 INNER JOIN languages as l ON l.is_active = 1
droy45413ea2008-07-28 14:36:23 +0000591 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 +0000592 LEFT JOIN translations AS t ON (s.string_id = t.string_id
593 AND t.language_id = l.language_id AND t.is_active = 1)
594WHERE f.is_active = 1
595GROUP BY f.file_id, l.language_id;
droy5bb81172008-04-04 19:25:24 +0000596DELETE FROM file_progress WHERE pct_complete = 0;
597
droyd664f912008-05-14 15:45:10 +0000598/* populate project_progress table */
599truncate table project_progress;
600INSERT INTO project_progress
601SELECT
602 p.project_id,
603 v.version,
604 l.language_id,
droyb156beb2008-05-15 17:16:44 +0000605 IF(COUNT(s.string_id) > 0, ROUND(COUNT(t.string_id)/COUNT(s.string_id) * 100, 2), 0) AS pct_complete,
606 0
droyd664f912008-05-14 15:45:10 +0000607FROM projects as p
608 INNER JOIN project_versions AS v ON v.project_id = p.project_id
609 INNER JOIN files AS f
610 ON (f.project_id = p.project_id AND f.version = v.version AND f.is_active)
611 INNER JOIN strings AS s
612 ON (s.file_id = f.file_id AND s.is_active)
613 INNER JOIN languages AS l
614 LEFT JOIN translations AS t
615 ON (t.string_id = s.string_id AND t.language_id = l.language_id AND t.is_active)
616WHERE
617 s.value <> ""
droy45413ea2008-07-28 14:36:23 +0000618 AND s.non_translatable = 0
droyd664f912008-05-14 15:45:10 +0000619 AND p.is_active
620GROUP BY p.project_id, v.version, l.language_id;
621
droy5bb81172008-04-04 19:25:24 +0000622/* populate scoreboard */
623truncate table scoreboard;
624INSERT 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;
625INSERT 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 +0000626INSERT INTO scoreboard SELECT NULL, "LASGEN", "Scoreboard Last Generated", MAX(translation_id) FROM translations;
627
628/* create a holding record for the MOTD */
kitloe3fea252010-01-25 02:13:49 +0000629INSERT INTO sys_values VALUES ("MOTD", NULL);