blob: 1d5cec115e5796f4e8510e396223df4f8d26fb9d [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,
Kit Lo6d440cc2013-03-02 19:56:45 -050037 CONSTRAINT `file_progress_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`language_id`) ON UPDATE CASCADE ON DELETE CASCADE
droy5d4b64c2008-02-29 15:22:10 +000038) 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
Kit Lo6d440cc2013-03-02 19:56:45 -050097DROP TABLE IF EXISTS `project_source_locations`;
98CREATE TABLE `project_source_locations` (
droy3bb0c962008-01-17 20:45:01 +000099 `project_id` varchar(100) NOT NULL,
100 `version` varchar(64) NOT NULL,
droy3bb0c962008-01-17 20:45:01 +0000101 `location` varchar(255) NOT NULL,
Kit Lo6d440cc2013-03-02 19:56:45 -0500102 PRIMARY KEY (`project_id`, `version`, `location`),
103 CONSTRAINT `project_source_locations_ibfk_1` FOREIGN KEY (`project_id`) REFERENCES `projects` (`project_id`) ON UPDATE CASCADE ON DELETE CASCADE
droy3bb0c962008-01-17 20:45:01 +0000104) ENGINE=InnoDB DEFAULT CHARSET=utf8;
105
droy27e97e02007-11-27 16:44:19 +0000106--
kitlod66aa992010-01-22 17:18:19 +0000107-- Table structure for table `plugin_exclude_patterns`
108--
109
110DROP TABLE IF EXISTS `plugin_exclude_patterns`;
111CREATE TABLE `plugin_exclude_patterns` (
112 `project_id` varchar(100) NOT NULL,
113 `version` varchar(64) NOT NULL,
114 `pattern` varchar(128) NOT NULL,
115 PRIMARY KEY (`project_id`, `version`, `pattern`),
116 CONSTRAINT `plugin_exclude_patterns_ibfk_1` FOREIGN KEY (`project_id`) REFERENCES `projects` (`project_id`) ON UPDATE CASCADE ON DELETE CASCADE
117) ENGINE=InnoDB DEFAULT CHARSET=utf8;
118
119--
droy27e97e02007-11-27 16:44:19 +0000120-- Table structure for table `profiles`
121--
122
123DROP TABLE IF EXISTS `profiles`;
124CREATE TABLE `profiles` (
125 `userid` mediumint(9) NOT NULL auto_increment,
126 `login_name` varchar(255) NOT NULL default '',
127 `cryptpassword` varchar(128) default NULL,
128 `realname` varchar(255) NOT NULL default '',
129 `disabledtext` mediumtext NOT NULL,
130 `mybugslink` tinyint(4) NOT NULL default '1',
131 `extern_id` varchar(64) default NULL,
132 `disable_mail` tinyint(4) NOT NULL default '0',
133 PRIMARY KEY (`userid`),
134 UNIQUE KEY `profiles_login_name_idx` (`login_name`)
135) ENGINE=MyISAM DEFAULT CHARSET=latin1;
136
137--
138-- Table structure for table `projects`
139--
140
141DROP TABLE IF EXISTS `projects`;
142CREATE TABLE `projects` (
143 `project_id` varchar(100) NOT NULL,
144 `is_active` tinyint(3) unsigned NOT NULL default '1',
145 PRIMARY KEY (`project_id`)
146) ENGINE=InnoDB DEFAULT CHARSET=utf8;
147
kitloe3fea252010-01-25 02:13:49 +0000148--
149-- Table structure for table `project_progress`
150--
151
droyd664f912008-05-14 15:45:10 +0000152DROP TABLE IF EXISTS `project_progress`;
153CREATE TABLE `project_progress` (
154 `project_id` varchar(100) NOT NULL,
155 `version` varchar(64) NOT NULL,
156 `language_id` smallint(5) unsigned NOT NULL,
157 `pct_complete` float NOT NULL,
droy6e6fb6d2008-05-15 17:11:29 +0000158 `is_stale` tinyint unsigned not null default 0,
droyd664f912008-05-14 15:45:10 +0000159 PRIMARY KEY (`project_id`, `version`, `language_id`),
160 CONSTRAINT `project_progress_ibfk_1` FOREIGN KEY (`project_id`, `version`) REFERENCES `project_versions` (`project_id`, `version`) ON UPDATE CASCADE ON DELETE CASCADE,
161 CONSTRAINT `project_progress_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`language_id`) ON UPDATE CASCADE ON DELETE CASCADE
162) ENGINE=InnoDB DEFAULT CHARSET=utf8;
163
kitloe3fea252010-01-25 02:13:49 +0000164--
165-- Table structure for table `project_versions`
166--
droyd664f912008-05-14 15:45:10 +0000167
droyc081e862007-11-30 16:37:35 +0000168DROP TABLE IF EXISTS `project_versions`;
169CREATE TABLE `project_versions` (
170 `project_id` varchar(100) NOT NULL,
droy44cb1ba2007-12-18 15:19:34 +0000171 `version` varchar(64) NOT NULL,
droyc081e862007-11-30 16:37:35 +0000172 `is_active` tinyint(3) unsigned NOT NULL default '1',
173 PRIMARY KEY (`project_id`, `version`),
174 CONSTRAINT `project_versions_ibfk_1` FOREIGN KEY (`project_id`) REFERENCES `projects` (`project_id`) ON UPDATE CASCADE ON DELETE CASCADE
175) ENGINE=InnoDB DEFAULT CHARSET=utf8;
176
droy27e97e02007-11-27 16:44:19 +0000177--
178-- Table structure for table `ratings`
179--
180
181DROP TABLE IF EXISTS `ratings`;
182CREATE TABLE `ratings` (
183 `translation_id` int(10) unsigned NOT NULL,
184 `userid` int(10) unsigned NOT NULL,
185 `rating` tinyint(3) unsigned NOT NULL default '0',
186 `created_on` datetime NOT NULL,
187 PRIMARY KEY (`translation_id`,`userid`),
188 CONSTRAINT `ratings_ibfk_1` FOREIGN KEY (`translation_id`) REFERENCES `translations` (`translation_id`) ON UPDATE CASCADE
189) ENGINE=InnoDB DEFAULT CHARSET=utf8;
190
kitloe3fea252010-01-25 02:13:49 +0000191--
192-- Table structure for table `release_trains`
193--
194
195DROP TABLE IF EXISTS `release_trains`;
196CREATE TABLE `release_trains` (
197 `train_id` varchar(30) NOT NULL,
198 `train_version` varchar(64) NOT NULL,
kitlo29f4a972010-08-08 00:14:04 +0000199 `is_active` tinyint(3) unsigned NOT NULL default '1',
kitloe3fea252010-01-25 02:13:49 +0000200 PRIMARY KEY (`train_id`, `train_version`)
201) ENGINE=InnoDB DEFAULT CHARSET=utf8;
202
203--
204-- Table structure for table `release_train_projects`
205--
206
droy684f2b62008-06-02 20:52:29 +0000207DROP TABLE IF EXISTS `release_train_projects`;
208CREATE TABLE `release_train_projects` (
209 `train_id` varchar(30) NOT NULL,
210 `project_id` varchar(100) NOT NULL,
211 `version` varchar(64) NOT NULL,
212 PRIMARY KEY (`train_id`, `project_id`, `version`),
213 CONSTRAINT `release_train_progress_ibfk_1` FOREIGN KEY (`project_id`, `version`) REFERENCES `project_versions` (`project_id`, `version`) ON UPDATE CASCADE ON DELETE CASCADE
214) ENGINE=InnoDB DEFAULT CHARSET=utf8;
215
droy27e97e02007-11-27 16:44:19 +0000216--
217-- Table structure for table `schema_info`
218--
219
220DROP TABLE IF EXISTS `schema_info`;
221CREATE TABLE `schema_info` (
222 `version` int(11) default NULL
223) ENGINE=MyISAM DEFAULT CHARSET=latin1;
224
225--
226-- Table structure for table `sessions`
227--
228
229DROP TABLE IF EXISTS `sessions`;
230CREATE TABLE `sessions` (
231 `id` int(11) unsigned NOT NULL auto_increment,
232 `userid` int(11) NOT NULL,
233 `gid` char(32) default NULL,
234 `subnet` char(15) default NULL,
235 `updated_at` datetime default NULL,
236 PRIMARY KEY (`id`),
237 KEY `gid` (`gid`),
238 KEY `userid` (`userid`)
239) ENGINE=InnoDB DEFAULT CHARSET=latin1;
240
241--
242-- Table structure for table `strings`
243--
244
droy27e97e02007-11-27 16:44:19 +0000245CREATE TABLE `strings` (
246 `string_id` int(10) unsigned NOT NULL auto_increment,
247 `file_id` int(10) unsigned NOT NULL,
248 `name` text NOT NULL,
249 `value` text NOT NULL,
250 `userid` int(10) unsigned NOT NULL,
251 `created_on` datetime NOT NULL,
252 `is_active` tinyint(1) unsigned default NULL,
droy0e2dff42008-09-24 15:35:34 +0000253 `non_translatable` tinyint(4) default '0',
droy27e97e02007-11-27 16:44:19 +0000254 PRIMARY KEY (`string_id`),
255 KEY `file_id` (`file_id`),
256 KEY `userid` (`userid`),
257 CONSTRAINT `strings_ibfk_1` FOREIGN KEY (`file_id`) REFERENCES `files` (`file_id`) ON UPDATE CASCADE,
258 CONSTRAINT `strings_ibfk_2` FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON UPDATE CASCADE
atoulmeabd65d52009-01-09 23:47:54 +0000259) ENGINE=InnoDB DEFAULT CHARSET=utf8;
droy27e97e02007-11-27 16:44:19 +0000260
droy68864612009-04-14 15:44:05 +0000261CREATE INDEX idx_value ON strings(value(40));
droy44cb1ba2007-12-18 15:19:34 +0000262
droy44cb1ba2007-12-18 15:19:34 +0000263DELIMITER ;;
264CREATE TRIGGER `upd_string` AFTER UPDATE ON `strings` FOR EACH ROW
265 BEGIN
266 IF(NEW.value <> OLD.value) THEN
267 UPDATE translations SET possibly_incorrect = 1 WHERE string_id = NEW.string_id;
268 END IF;
269 END;
270;;
271DELIMITER ;
272
droy0757c2c2009-03-31 19:37:36 +0000273--
274-- Table structure for table `sys_values`
275--
276DROP TABLE IF EXISTS `sys_values`;
277CREATE TABLE `sys_values` (
278 `itemid` char(6) NOT NULL,
279 `value` text,
280 PRIMARY KEY (`itemid`)
281) ENGINE=InnoDB DEFAULT CHARSET=utf8;
droy44cb1ba2007-12-18 15:19:34 +0000282
droy27e97e02007-11-27 16:44:19 +0000283--
284-- Table structure for table `translation_archives`
285--
286
287DROP TABLE IF EXISTS `translation_archives`;
288CREATE TABLE `translation_archives` (
289 `translation_id` int(10) unsigned NOT NULL,
290 `string_id` int(10) unsigned NOT NULL,
291 `language_id` smallint(5) unsigned NOT NULL,
292 `version` int(10) unsigned NOT NULL default '1',
293 `value` text NOT NULL,
294 `is_active` tinyint(3) unsigned NOT NULL default '1',
295 `userid` int(10) unsigned NOT NULL,
296 `created_on` datetime NOT NULL,
297 PRIMARY KEY (`string_id`,`language_id`,`version`),
298 KEY `language_id` (`language_id`),
299 KEY `userid` (`userid`),
300 CONSTRAINT `translation_archives_ibfk_1` FOREIGN KEY (`string_id`) REFERENCES `strings` (`string_id`) ON UPDATE CASCADE,
301 CONSTRAINT `translation_archives_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`language_id`) ON UPDATE CASCADE,
302 CONSTRAINT `translation_archives_ibfk_3` FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON UPDATE CASCADE
303) ENGINE=InnoDB DEFAULT CHARSET=utf8;
304
305--
306-- Table structure for table `translations`
307--
308
309DROP TABLE IF EXISTS `translations`;
310CREATE TABLE `translations` (
311 `translation_id` int(10) unsigned NOT NULL auto_increment,
312 `string_id` int(10) unsigned NOT NULL,
313 `language_id` smallint(5) unsigned NOT NULL,
314 `version` int(10) unsigned NOT NULL default '1',
315 `value` text NOT NULL,
droy44cb1ba2007-12-18 15:19:34 +0000316 `possibly_incorrect` tinyint unsigned NOT NULL default '0',
droy27e97e02007-11-27 16:44:19 +0000317 `is_active` tinyint(3) unsigned NOT NULL default '1',
318 `userid` int(10) unsigned NOT NULL,
319 `created_on` datetime NOT NULL,
320 PRIMARY KEY (`string_id`,`language_id`,`version`),
321 KEY `translation_id` (`translation_id`),
322 KEY `language_id` (`language_id`),
323 KEY `userid` (`userid`),
droyd664f912008-05-14 15:45:10 +0000324 KEY `created_on` (`created_on`),
droy27e97e02007-11-27 16:44:19 +0000325 CONSTRAINT `translations_ibfk_1` FOREIGN KEY (`string_id`) REFERENCES `strings` (`string_id`) ON UPDATE CASCADE,
326 CONSTRAINT `translations_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`language_id`) ON UPDATE CASCADE,
327 CONSTRAINT `translations_ibfk_3` FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON UPDATE CASCADE
328) ENGINE=InnoDB DEFAULT CHARSET=utf8;
329
droy5d4b64c2008-02-29 15:22:10 +0000330SET @OLD_SQL_MODE=@@SQL_MODE;
droy27e97e02007-11-27 16:44:19 +0000331DELIMITER ;;
332/*!50003 SET SESSION SQL_MODE="" */;;
droy28b28792008-05-21 20:54:29 +0000333DROP TRIGGER IF EXISTS `ins_version`;;
droy27e97e02007-11-27 16:44:19 +0000334
droy5d4b64c2008-02-29 15:22:10 +0000335/* This trigger sets the version to max(version) + 1. It also updates the file_progress table */
droyd664f912008-05-14 15:45:10 +0000336/* 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 +0000337/* (COUNT(t.string_id) + 1) because it's a BEFORE INSERT trigger, the translated str is not in the DB yet */
338/* and without the +1 the percent would always be "one behind" */
339CREATE TRIGGER `ins_version` BEFORE INSERT ON `translations` FOR EACH ROW BEGIN
340 SET NEW.version =
341 (SELECT IFNULL(MAX(version),0)+1 FROM translations
342 WHERE string_id = NEW.string_id and language_id = NEW.language_id);
droyd664f912008-05-14 15:45:10 +0000343
344 /* Define a few fields we need here */
345 SET @FILE_ID=(SELECT file_id FROM strings WHERE string_id = NEW.string_id);
346 SET @PROJECT=(SELECT project_id FROM files WHERE file_id = @FILE_ID);
347 SET @VERSION=(SELECT version FROM files WHERE file_id = @FILE_ID);
droy5d4b64c2008-02-29 15:22:10 +0000348
droyd664f912008-05-14 15:45:10 +0000349
350 /* update this file's progress */
351 DELETE FROM file_progress where file_id = @FILE_ID
droy5d4b64c2008-02-29 15:22:10 +0000352 AND language_id = NEW.language_id;
353
droyd664f912008-05-14 15:45:10 +0000354 /* See notes above for the hairy select */
355 INSERT INTO file_progress SET file_id = @FILE_ID,
droy5d4b64c2008-02-29 15:22:10 +0000356 language_id = NEW.language_id,
357 pct_complete = (
droyd664f912008-05-14 15:45:10 +0000358 SELECT IF(NEW.version > 1,
359 IF(COUNT(s.string_id) > 0, (COUNT(t.string_id))/COUNT(s.string_id)*100,0),
360 IF(COUNT(s.string_id) > 0, (COUNT(t.string_id) + 1)/COUNT(s.string_id)*100,0)
361 ) AS translate_percent
droy5d4b64c2008-02-29 15:22:10 +0000362 FROM files AS f
droyd664f912008-05-14 15:45:10 +0000363 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 +0000364 LEFT JOIN translations AS t ON (s.string_id = t.string_id
365 AND t.language_id = NEW.language_id AND t.is_active = 1)
droyd664f912008-05-14 15:45:10 +0000366 WHERE f.file_id = @FILE_ID
367 );
droy6e6fb6d2008-05-15 17:11:29 +0000368
369
370 /* update project_progress table to indicate this proj/lang/vers stats are stale */
371 /* don't know if record is there or not, so do both an insert and an update */
droy0757c2c2009-03-31 19:37:36 +0000372 /* This portion of the trigger is similar to what is in the files table */
droy6e6fb6d2008-05-15 17:11:29 +0000373 UPDATE IGNORE project_progress SET is_stale = 1 where project_id = @PROJECT
droyd664f912008-05-14 15:45:10 +0000374 AND version = @VERSION
375 AND language_id = NEW.language_id;
droy6e6fb6d2008-05-15 17:11:29 +0000376
377 INSERT IGNORE INTO project_progress SET is_stale = 1, project_id = @PROJECT,
378 version = @VERSION,
379 language_id = NEW.language_id;
droyd664f912008-05-14 15:45:10 +0000380
droy5d4b64c2008-02-29 15:22:10 +0000381END;
382;;
droy27e97e02007-11-27 16:44:19 +0000383DELIMITER ;
384/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */;
385
386--
387-- Table structure for table `users`
388--
389
390DROP TABLE IF EXISTS `users`;
391CREATE TABLE `users` (
392 `userid` int(10) unsigned NOT NULL,
393 `username` varchar(256) NOT NULL default '',
394 `first_name` varchar(256) NOT NULL default '',
395 `last_name` varchar(256) NOT NULL default '',
396 `email` varchar(256) NOT NULL default '',
397 `primary_language_id` int(11) NOT NULL default '0',
398 `hours_per_week` int(11) NOT NULL default '0',
399 `password_hash` varchar(256) NOT NULL default '',
droy8da30b32007-11-29 21:00:26 +0000400 `is_committer` tinyint unsigned not null default 0,
droy27e97e02007-11-27 16:44:19 +0000401 `updated_on` date NOT NULL,
402 `updated_at` time NOT NULL,
403 `created_on` date NOT NULL,
404 `created_at` time NOT NULL,
405 PRIMARY KEY (`userid`),
406 KEY `primary_language_id` (`primary_language_id`)
407) ENGINE=InnoDB DEFAULT CHARSET=utf8;
droy97c86192007-11-28 22:00:22 +0000408
droy5bb81172008-04-04 19:25:24 +0000409DROP TABLE IF EXISTS `scoreboard`;
410CREATE TABLE `scoreboard` (
411 `id` int unsigned not null auto_increment,
412 `itemid` char(6) NOT NULL,
413 `value` varchar(256) NOT NULL default '',
414 `quantity` double NOT NULL default 0,
415 PRIMARY KEY (`id`),
416 KEY(`quantity`)
417) ENGINE=InnoDB DEFAULT CHARSET=utf8;
418
419
droy97c86192007-11-28 22:00:22 +0000420
421
droy27e97e02007-11-27 16:44:19 +0000422/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
423
424/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
425/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
426/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
427/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
428/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
429/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
430/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
431
droy6426bc02008-02-01 19:35:19 +0000432
433
434
435
436
437/*
438Babel data
439User: babel@eclipse.org
440pass: password
441*/
442
443insert 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 +0000444insert 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='';
kitlo32cd7442010-02-15 16:29:22 +0000445insert into users set userid = 2, username = "genie@eclipse.org",first_name="babel",last_name="genie",email="genie@eclipse.org",primary_language_id = "",password_hash = "HSD9a.ShTTdvo", is_committer = true, updated_on = NOW(), updated_at='',created_on = NOW(), created_at='';
446insert into users set userid = 3, username = "syncup@eclipse.org",first_name="babel",last_name="syncup",email="syncup@eclipse.org",primary_language_id = "",password_hash = "HSD9a.ShTTdvo", is_committer = true, updated_on = NOW(), updated_at='',created_on = NOW(), created_at='';
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);
kitlo396bcca2010-02-11 20:03:25 +0000482insert into languages values (null, "sl", null, "Slovenian", 1);
kitlof7ec1e82010-07-31 18:42:23 +0000483insert into languages values (null, "fa", null, "Persian", 1);
kitlo98f08072010-12-14 06:09:23 +0000484insert into languages values (null, "sq", null, "Albanian", 1);
kitlo9b409252011-06-16 00:44:29 +0000485insert into languages values (null, "ku", null, "Kurdish", 1);
kitlo17d1b112011-08-21 05:21:21 +0000486insert into languages values (null, "sr", null, "Serbian", 1);
kitlo535c5d82011-10-24 20:58:50 +0000487insert into languages values (null, "sk", null, "Slovak", 1);
Kit Lo52fa0a32012-11-02 20:41:57 -0400488insert into languages values (null, "eu", null, "Basque", 1);
Kit Lo6615a9a2012-11-26 23:35:49 -0500489insert into languages values (null, "ml", null, "Malayalam", 1);
Kit Loc3fd7af2013-06-21 12:06:01 -0400490insert into languages values (null, "my", null, "Myanmar", 1);
kitlo2e780dc2010-01-12 17:58:32 +0000491insert into languages values (null, "tl", null, "Klingon", 1);
492
Kit Lo6d440cc2013-03-02 19:56:45 -0500493insert into release_trains values ("kepler", "4.3.0", 1);
droy2df74062008-07-03 12:45:46 +0000494
Kit Lo6d440cc2013-03-02 19:56:45 -0500495insert into projects values ("eclipse", 1);
496insert into projects values ("eclipse.orion", 1);
kitlo98f08072010-12-14 06:09:23 +0000497
Kit Lo6d440cc2013-03-02 19:56:45 -0500498insert into project_versions values ("eclipse", "4.3", 1);
Kit Lo1869b2d2013-06-20 09:52:07 -0400499insert into project_versions values ("eclipse.orion", "3.0", 1);
Kit Lo6d440cc2013-03-02 19:56:45 -0500500
501insert into release_train_projects values ("kepler", "eclipse", "4.3");
Kit Lo1869b2d2013-06-20 09:52:07 -0400502insert into release_train_projects values ("kepler", "eclipse.orion", "3.0");
kitlo2e780dc2010-01-12 17:58:32 +0000503
Kit Lo1869b2d2013-06-20 09:52:07 -0400504insert into project_source_locations values ("eclipse", "4.3", "http://git.eclipse.org/c/equinox/rt.equinox.framework.git/snapshot/I20130618-0800.zip");
505insert into project_source_locations values ("eclipse", "4.3", "http://git.eclipse.org/c/equinox/rt.equinox.p2.git/snapshot/I20130618-0800.zip");
506insert into project_source_locations values ("eclipse", "4.3", "http://git.eclipse.org/c/jdt/eclipse.jdt.git/snapshot/I20130618-0800.zip");
507insert into project_source_locations values ("eclipse", "4.3", "http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/snapshot/I20130618-0800.zip");
508insert into project_source_locations values ("eclipse", "4.3", "http://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/snapshot/I20130618-0800.zip");
509insert into project_source_locations values ("eclipse", "4.3", "http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/snapshot/I20130618-0800.zip");
510insert into project_source_locations values ("eclipse", "4.3", "http://git.eclipse.org/c/pde/eclipse.pde.git/snapshot/I20130618-0800.zip");
511insert into project_source_locations values ("eclipse", "4.3", "http://git.eclipse.org/c/pde/eclipse.pde.ui.git/snapshot/I20130618-0800.zip");
512insert into project_source_locations values ("eclipse", "4.3", "http://git.eclipse.org/c/platform/eclipse.platform.git/snapshot/I20130618-0800.zip");
513insert into project_source_locations values ("eclipse", "4.3", "http://git.eclipse.org/c/platform/eclipse.platform.debug.git/snapshot/I20130618-0800.zip");
514insert into project_source_locations values ("eclipse", "4.3", "http://git.eclipse.org/c/platform/eclipse.platform.team.git/snapshot/I20130618-0800.zip");
515insert into project_source_locations values ("eclipse", "4.3", "http://git.eclipse.org/c/platform/eclipse.platform.text.git/snapshot/I20130618-0800.zip");
516insert into project_source_locations values ("eclipse", "4.3", "http://git.eclipse.org/c/platform/eclipse.platform.ua.git/snapshot/I20130618-0800.zip");
517insert into project_source_locations values ("eclipse", "4.3", "http://git.eclipse.org/c/platform/eclipse.platform.ui.git/snapshot/I20130618-0800.zip");
518insert into project_source_locations values ("eclipse.orion", "3.0", "http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/snapshot/org.eclipse.orion.client-20130617-2124.zip");
kitlo98f08072010-12-14 06:09:23 +0000519
Kit Lo6d440cc2013-03-02 19:56:45 -0500520insert into plugin_exclude_patterns values ("eclipse", "4.3", "/^com\\.ibm\\.icu.*$/");
521insert into plugin_exclude_patterns values ("eclipse", "4.3", "/^com\\.jcraft\\..*$/");
522insert into plugin_exclude_patterns values ("eclipse", "4.3", "/^javax\\..*$/");
523insert into plugin_exclude_patterns values ("eclipse", "4.3", "/^org\\.apache\\..*$/");
524insert into plugin_exclude_patterns values ("eclipse", "4.3", "/^org\\.hamcrest\\..*$/");
525insert into plugin_exclude_patterns values ("eclipse", "4.3", "/^org\\.junit.*$/");
526insert into plugin_exclude_patterns values ("eclipse", "4.3", "/^org\\.mortbay\\..*$/");
527insert into plugin_exclude_patterns values ("eclipse", "4.3", "/^org\\.objectweb\\..*$/");
528insert into plugin_exclude_patterns values ("eclipse", "4.3", "/^org\\.sat4j\\..*$/");
529insert into plugin_exclude_patterns values ("eclipse", "4.3", "/^org\\.w3c\\..*$/");
530insert into plugin_exclude_patterns values ("eclipse", "4.3", "/^.*\\/jface\\/resource\\/.*$/");
Kit Lo1869b2d2013-06-20 09:52:07 -0400531insert into plugin_exclude_patterns values ("eclipse.orion", "3.0", "/^.*\\/bundle.properties$/");
kitlo9b409252011-06-16 00:44:29 +0000532
droybafb7c42008-02-29 18:24:38 +0000533/* populate file_progress table */
droydc294842008-05-21 17:38:57 +0000534/* See also: dbmaintenance_15min.php */
droybafb7c42008-02-29 18:24:38 +0000535truncate table file_progress;
536INSERT INTO file_progress
droyc2c26102008-05-21 16:01:40 +0000537select 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 +0000538FROM files AS f
539 INNER JOIN languages as l ON l.is_active = 1
droy45413ea2008-07-28 14:36:23 +0000540 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 +0000541 LEFT JOIN translations AS t ON (s.string_id = t.string_id
542 AND t.language_id = l.language_id AND t.is_active = 1)
543WHERE f.is_active = 1
544GROUP BY f.file_id, l.language_id;
droy5bb81172008-04-04 19:25:24 +0000545DELETE FROM file_progress WHERE pct_complete = 0;
546
droyd664f912008-05-14 15:45:10 +0000547/* populate project_progress table */
548truncate table project_progress;
549INSERT INTO project_progress
550SELECT
551 p.project_id,
552 v.version,
553 l.language_id,
droyb156beb2008-05-15 17:16:44 +0000554 IF(COUNT(s.string_id) > 0, ROUND(COUNT(t.string_id)/COUNT(s.string_id) * 100, 2), 0) AS pct_complete,
555 0
droyd664f912008-05-14 15:45:10 +0000556FROM projects as p
557 INNER JOIN project_versions AS v ON v.project_id = p.project_id
558 INNER JOIN files AS f
559 ON (f.project_id = p.project_id AND f.version = v.version AND f.is_active)
560 INNER JOIN strings AS s
561 ON (s.file_id = f.file_id AND s.is_active)
562 INNER JOIN languages AS l
563 LEFT JOIN translations AS t
564 ON (t.string_id = s.string_id AND t.language_id = l.language_id AND t.is_active)
565WHERE
566 s.value <> ""
droy45413ea2008-07-28 14:36:23 +0000567 AND s.non_translatable = 0
droyd664f912008-05-14 15:45:10 +0000568 AND p.is_active
569GROUP BY p.project_id, v.version, l.language_id;
570
droy5bb81172008-04-04 19:25:24 +0000571/* populate scoreboard */
572truncate table scoreboard;
573INSERT 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;
574INSERT 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 +0000575INSERT INTO scoreboard SELECT NULL, "LASGEN", "Scoreboard Last Generated", MAX(translation_id) FROM translations;
576
577/* create a holding record for the MOTD */
kitloe3fea252010-01-25 02:13:49 +0000578INSERT INTO sys_values VALUES ("MOTD", NULL);