droy | 27e97e0 | 2007-11-27 16:44:19 +0000 | [diff] [blame] | 1 | -- 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 | |
droy | d0a9b1a | 2008-01-29 19:51:46 +0000 | [diff] [blame] | 18 | DROP TABLE IF EXISTS event_log; |
droy | 3e7f3a8 | 2007-11-29 19:35:51 +0000 | [diff] [blame] | 19 | CREATE 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; |
droy | 27e97e0 | 2007-11-27 16:44:19 +0000 | [diff] [blame] | 29 | |
droy | 5d4b64c | 2008-02-29 15:22:10 +0000 | [diff] [blame] | 30 | DROP TABLE IF EXISTS `file_progress`; |
| 31 | CREATE 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 | |
droy | 27e97e0 | 2007-11-27 16:44:19 +0000 | [diff] [blame] | 40 | DROP TABLE IF EXISTS `files`; |
| 41 | CREATE TABLE `files` ( |
droy | e5c9981 | 2007-11-28 21:36:51 +0000 | [diff] [blame] | 42 | `file_id` int(10) unsigned NOT NULL auto_increment, |
droy | 27e97e0 | 2007-11-27 16:44:19 +0000 | [diff] [blame] | 43 | `project_id` varchar(100) NOT NULL, |
droy | b9c2cb1 | 2008-10-08 13:58:14 +0000 | [diff] [blame] | 44 | `plugin_id` varchar(100) NOT NULL, |
droy | 44cb1ba | 2007-12-18 15:19:34 +0000 | [diff] [blame] | 45 | `version` varchar(64) NOT NULL, |
droy | 27e97e0 | 2007-11-27 16:44:19 +0000 | [diff] [blame] | 46 | `name` text NOT NULL, |
| 47 | `is_active` tinyint(3) unsigned NOT NULL default '1', |
| 48 | PRIMARY KEY (`file_id`), |
| 49 | KEY `project_id` (`project_id`), |
droy | c081e86 | 2007-11-30 16:37:35 +0000 | [diff] [blame] | 50 | CONSTRAINT `files_ibfk_1` FOREIGN KEY (`project_id`,`version`) REFERENCES `project_versions` (`project_id`,`version`) ON UPDATE CASCADE |
droy | 27e97e0 | 2007-11-27 16:44:19 +0000 | [diff] [blame] | 51 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
droy | 0757c2c | 2009-03-31 19:37:36 +0000 | [diff] [blame] | 52 | |
| 53 | |
| 54 | SET @OLD_SQL_MODE=@@SQL_MODE; |
| 55 | DELIMITER ;; |
| 56 | /*!50003 SET SESSION SQL_MODE="" */;; |
| 57 | DROP TRIGGER IF EXISTS `upd_is_active`;; |
| 58 | |
| 59 | /* This trigger will recursively update the is_active status of the strings of a file */ |
| 60 | CREATE 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 */ |
droy | 2251ca9 | 2010-01-20 14:08:49 +0000 | [diff] [blame] | 65 | /* This portion of the trigger is similar to what is in the translations table */ |
| 66 | SET @PROJECT=(SELECT project_id FROM files WHERE file_id = NEW.file_id); |
| 67 | SET @VERSION=(SELECT version FROM files WHERE file_id = NEW.file_id); |
| 68 | |
droy | 0757c2c | 2009-03-31 19:37:36 +0000 | [diff] [blame] | 69 | UPDATE IGNORE project_progress SET is_stale = 1 where project_id = @PROJECT |
droy | 2251ca9 | 2010-01-20 14:08:49 +0000 | [diff] [blame] | 70 | AND version = @VERSION; |
droy | 0757c2c | 2009-03-31 19:37:36 +0000 | [diff] [blame] | 71 | END; |
| 72 | ;; |
| 73 | DELIMITER ; |
| 74 | /*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */; |
| 75 | |
| 76 | |
droy | 27e97e0 | 2007-11-27 16:44:19 +0000 | [diff] [blame] | 77 | -- |
| 78 | -- Table structure for table `languages` |
| 79 | -- |
| 80 | |
| 81 | DROP TABLE IF EXISTS `languages`; |
| 82 | CREATE TABLE `languages` ( |
| 83 | `language_id` smallint(5) unsigned NOT NULL auto_increment, |
droy | c94a452 | 2008-02-05 15:36:53 +0000 | [diff] [blame] | 84 | `iso_code` varchar(6) NOT NULL, |
droy | 27e97e0 | 2007-11-27 16:44:19 +0000 | [diff] [blame] | 85 | `locale` varchar(12) default NULL, |
| 86 | `name` varchar(50) NOT NULL, |
| 87 | `is_active` tinyint(3) unsigned NOT NULL default '1', |
| 88 | PRIMARY KEY (`language_id`), |
| 89 | KEY `iso_code` (`iso_code`), |
| 90 | KEY `locale` (`locale`) |
| 91 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
| 92 | |
droy | 3bb0c96 | 2008-01-17 20:45:01 +0000 | [diff] [blame] | 93 | -- |
| 94 | -- Table structure for table `map_files` |
| 95 | -- |
| 96 | |
| 97 | DROP TABLE IF EXISTS `map_files`; |
| 98 | CREATE 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', |
kitlo | d66aa99 | 2010-01-22 17:18:19 +0000 | [diff] [blame] | 104 | `is_map_file` tinyint(3) unsigned NOT NULL default '1', |
droy | 3bb0c96 | 2008-01-17 20:45:01 +0000 | [diff] [blame] | 105 | PRIMARY KEY (`project_id`, `version`, `filename`), |
| 106 | CONSTRAINT `map_files_ibfk_1` FOREIGN KEY (`project_id`) REFERENCES `projects` (`project_id`) ON UPDATE CASCADE ON DELETE CASCADE |
| 107 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
| 108 | |
droy | 27e97e0 | 2007-11-27 16:44:19 +0000 | [diff] [blame] | 109 | -- |
kitlo | d66aa99 | 2010-01-22 17:18:19 +0000 | [diff] [blame] | 110 | -- Table structure for table `plugin_exclude_patterns` |
| 111 | -- |
| 112 | |
| 113 | DROP TABLE IF EXISTS `plugin_exclude_patterns`; |
| 114 | CREATE 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 | -- |
droy | 27e97e0 | 2007-11-27 16:44:19 +0000 | [diff] [blame] | 123 | -- Table structure for table `profiles` |
| 124 | -- |
| 125 | |
| 126 | DROP TABLE IF EXISTS `profiles`; |
| 127 | CREATE 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 | |
| 144 | DROP TABLE IF EXISTS `projects`; |
| 145 | CREATE 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 | |
kitlo | e3fea25 | 2010-01-25 02:13:49 +0000 | [diff] [blame] | 151 | -- |
| 152 | -- Table structure for table `project_progress` |
| 153 | -- |
| 154 | |
droy | d664f91 | 2008-05-14 15:45:10 +0000 | [diff] [blame] | 155 | DROP TABLE IF EXISTS `project_progress`; |
| 156 | CREATE 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, |
droy | 6e6fb6d | 2008-05-15 17:11:29 +0000 | [diff] [blame] | 161 | `is_stale` tinyint unsigned not null default 0, |
droy | d664f91 | 2008-05-14 15:45:10 +0000 | [diff] [blame] | 162 | 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 | |
kitlo | e3fea25 | 2010-01-25 02:13:49 +0000 | [diff] [blame] | 167 | -- |
| 168 | -- Table structure for table `project_versions` |
| 169 | -- |
droy | d664f91 | 2008-05-14 15:45:10 +0000 | [diff] [blame] | 170 | |
droy | c081e86 | 2007-11-30 16:37:35 +0000 | [diff] [blame] | 171 | DROP TABLE IF EXISTS `project_versions`; |
| 172 | CREATE TABLE `project_versions` ( |
| 173 | `project_id` varchar(100) NOT NULL, |
droy | 44cb1ba | 2007-12-18 15:19:34 +0000 | [diff] [blame] | 174 | `version` varchar(64) NOT NULL, |
droy | c081e86 | 2007-11-30 16:37:35 +0000 | [diff] [blame] | 175 | `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 | |
droy | 27e97e0 | 2007-11-27 16:44:19 +0000 | [diff] [blame] | 180 | -- |
| 181 | -- Table structure for table `ratings` |
| 182 | -- |
| 183 | |
| 184 | DROP TABLE IF EXISTS `ratings`; |
| 185 | CREATE 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 | |
kitlo | e3fea25 | 2010-01-25 02:13:49 +0000 | [diff] [blame] | 194 | -- |
| 195 | -- Table structure for table `release_trains` |
| 196 | -- |
| 197 | |
| 198 | DROP TABLE IF EXISTS `release_trains`; |
| 199 | CREATE TABLE `release_trains` ( |
| 200 | `train_id` varchar(30) NOT NULL, |
| 201 | `train_version` varchar(64) NOT NULL, |
kitlo | 29f4a97 | 2010-08-08 00:14:04 +0000 | [diff] [blame^] | 202 | `is_active` tinyint(3) unsigned NOT NULL default '1', |
kitlo | e3fea25 | 2010-01-25 02:13:49 +0000 | [diff] [blame] | 203 | PRIMARY KEY (`train_id`, `train_version`) |
| 204 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
| 205 | |
| 206 | -- |
| 207 | -- Table structure for table `release_train_projects` |
| 208 | -- |
| 209 | |
droy | 684f2b6 | 2008-06-02 20:52:29 +0000 | [diff] [blame] | 210 | DROP TABLE IF EXISTS `release_train_projects`; |
| 211 | CREATE TABLE `release_train_projects` ( |
| 212 | `train_id` varchar(30) NOT NULL, |
| 213 | `project_id` varchar(100) NOT NULL, |
| 214 | `version` varchar(64) NOT NULL, |
| 215 | PRIMARY KEY (`train_id`, `project_id`, `version`), |
| 216 | CONSTRAINT `release_train_progress_ibfk_1` FOREIGN KEY (`project_id`, `version`) REFERENCES `project_versions` (`project_id`, `version`) ON UPDATE CASCADE ON DELETE CASCADE |
| 217 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
| 218 | |
droy | 27e97e0 | 2007-11-27 16:44:19 +0000 | [diff] [blame] | 219 | -- |
| 220 | -- Table structure for table `schema_info` |
| 221 | -- |
| 222 | |
| 223 | DROP TABLE IF EXISTS `schema_info`; |
| 224 | CREATE TABLE `schema_info` ( |
| 225 | `version` int(11) default NULL |
| 226 | ) ENGINE=MyISAM DEFAULT CHARSET=latin1; |
| 227 | |
| 228 | -- |
| 229 | -- Table structure for table `sessions` |
| 230 | -- |
| 231 | |
| 232 | DROP TABLE IF EXISTS `sessions`; |
| 233 | CREATE TABLE `sessions` ( |
| 234 | `id` int(11) unsigned NOT NULL auto_increment, |
| 235 | `userid` int(11) NOT NULL, |
| 236 | `gid` char(32) default NULL, |
| 237 | `subnet` char(15) default NULL, |
| 238 | `updated_at` datetime default NULL, |
| 239 | PRIMARY KEY (`id`), |
| 240 | KEY `gid` (`gid`), |
| 241 | KEY `userid` (`userid`) |
| 242 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; |
| 243 | |
| 244 | -- |
| 245 | -- Table structure for table `strings` |
| 246 | -- |
| 247 | |
droy | 27e97e0 | 2007-11-27 16:44:19 +0000 | [diff] [blame] | 248 | CREATE TABLE `strings` ( |
| 249 | `string_id` int(10) unsigned NOT NULL auto_increment, |
| 250 | `file_id` int(10) unsigned NOT NULL, |
| 251 | `name` text NOT NULL, |
| 252 | `value` text NOT NULL, |
| 253 | `userid` int(10) unsigned NOT NULL, |
| 254 | `created_on` datetime NOT NULL, |
| 255 | `is_active` tinyint(1) unsigned default NULL, |
droy | 0e2dff4 | 2008-09-24 15:35:34 +0000 | [diff] [blame] | 256 | `non_translatable` tinyint(4) default '0', |
droy | 27e97e0 | 2007-11-27 16:44:19 +0000 | [diff] [blame] | 257 | PRIMARY KEY (`string_id`), |
| 258 | KEY `file_id` (`file_id`), |
| 259 | KEY `userid` (`userid`), |
| 260 | CONSTRAINT `strings_ibfk_1` FOREIGN KEY (`file_id`) REFERENCES `files` (`file_id`) ON UPDATE CASCADE, |
| 261 | CONSTRAINT `strings_ibfk_2` FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON UPDATE CASCADE |
atoulme | abd65d5 | 2009-01-09 23:47:54 +0000 | [diff] [blame] | 262 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
droy | 27e97e0 | 2007-11-27 16:44:19 +0000 | [diff] [blame] | 263 | |
droy | 6886461 | 2009-04-14 15:44:05 +0000 | [diff] [blame] | 264 | CREATE INDEX idx_value ON strings(value(40)); |
droy | 44cb1ba | 2007-12-18 15:19:34 +0000 | [diff] [blame] | 265 | |
droy | 44cb1ba | 2007-12-18 15:19:34 +0000 | [diff] [blame] | 266 | DELIMITER ;; |
| 267 | CREATE TRIGGER `upd_string` AFTER UPDATE ON `strings` FOR EACH ROW |
| 268 | BEGIN |
| 269 | IF(NEW.value <> OLD.value) THEN |
| 270 | UPDATE translations SET possibly_incorrect = 1 WHERE string_id = NEW.string_id; |
| 271 | END IF; |
| 272 | END; |
| 273 | ;; |
| 274 | DELIMITER ; |
| 275 | |
droy | 0757c2c | 2009-03-31 19:37:36 +0000 | [diff] [blame] | 276 | -- |
| 277 | -- Table structure for table `sys_values` |
| 278 | -- |
| 279 | DROP TABLE IF EXISTS `sys_values`; |
| 280 | CREATE TABLE `sys_values` ( |
| 281 | `itemid` char(6) NOT NULL, |
| 282 | `value` text, |
| 283 | PRIMARY KEY (`itemid`) |
| 284 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
droy | 44cb1ba | 2007-12-18 15:19:34 +0000 | [diff] [blame] | 285 | |
droy | 27e97e0 | 2007-11-27 16:44:19 +0000 | [diff] [blame] | 286 | -- |
| 287 | -- Table structure for table `translation_archives` |
| 288 | -- |
| 289 | |
| 290 | DROP TABLE IF EXISTS `translation_archives`; |
| 291 | CREATE TABLE `translation_archives` ( |
| 292 | `translation_id` int(10) unsigned NOT NULL, |
| 293 | `string_id` int(10) unsigned NOT NULL, |
| 294 | `language_id` smallint(5) unsigned NOT NULL, |
| 295 | `version` int(10) unsigned NOT NULL default '1', |
| 296 | `value` text NOT NULL, |
| 297 | `is_active` tinyint(3) unsigned NOT NULL default '1', |
| 298 | `userid` int(10) unsigned NOT NULL, |
| 299 | `created_on` datetime NOT NULL, |
| 300 | PRIMARY KEY (`string_id`,`language_id`,`version`), |
| 301 | KEY `language_id` (`language_id`), |
| 302 | KEY `userid` (`userid`), |
| 303 | CONSTRAINT `translation_archives_ibfk_1` FOREIGN KEY (`string_id`) REFERENCES `strings` (`string_id`) ON UPDATE CASCADE, |
| 304 | CONSTRAINT `translation_archives_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`language_id`) ON UPDATE CASCADE, |
| 305 | CONSTRAINT `translation_archives_ibfk_3` FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON UPDATE CASCADE |
| 306 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
| 307 | |
| 308 | -- |
| 309 | -- Table structure for table `translations` |
| 310 | -- |
| 311 | |
| 312 | DROP TABLE IF EXISTS `translations`; |
| 313 | CREATE TABLE `translations` ( |
| 314 | `translation_id` int(10) unsigned NOT NULL auto_increment, |
| 315 | `string_id` int(10) unsigned NOT NULL, |
| 316 | `language_id` smallint(5) unsigned NOT NULL, |
| 317 | `version` int(10) unsigned NOT NULL default '1', |
| 318 | `value` text NOT NULL, |
droy | 44cb1ba | 2007-12-18 15:19:34 +0000 | [diff] [blame] | 319 | `possibly_incorrect` tinyint unsigned NOT NULL default '0', |
droy | 27e97e0 | 2007-11-27 16:44:19 +0000 | [diff] [blame] | 320 | `is_active` tinyint(3) unsigned NOT NULL default '1', |
| 321 | `userid` int(10) unsigned NOT NULL, |
| 322 | `created_on` datetime NOT NULL, |
| 323 | PRIMARY KEY (`string_id`,`language_id`,`version`), |
| 324 | KEY `translation_id` (`translation_id`), |
| 325 | KEY `language_id` (`language_id`), |
| 326 | KEY `userid` (`userid`), |
droy | d664f91 | 2008-05-14 15:45:10 +0000 | [diff] [blame] | 327 | KEY `created_on` (`created_on`), |
droy | 27e97e0 | 2007-11-27 16:44:19 +0000 | [diff] [blame] | 328 | CONSTRAINT `translations_ibfk_1` FOREIGN KEY (`string_id`) REFERENCES `strings` (`string_id`) ON UPDATE CASCADE, |
| 329 | CONSTRAINT `translations_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`language_id`) ON UPDATE CASCADE, |
| 330 | CONSTRAINT `translations_ibfk_3` FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON UPDATE CASCADE |
| 331 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
| 332 | |
droy | 5d4b64c | 2008-02-29 15:22:10 +0000 | [diff] [blame] | 333 | SET @OLD_SQL_MODE=@@SQL_MODE; |
droy | 27e97e0 | 2007-11-27 16:44:19 +0000 | [diff] [blame] | 334 | DELIMITER ;; |
| 335 | /*!50003 SET SESSION SQL_MODE="" */;; |
droy | 28b2879 | 2008-05-21 20:54:29 +0000 | [diff] [blame] | 336 | DROP TRIGGER IF EXISTS `ins_version`;; |
droy | 27e97e0 | 2007-11-27 16:44:19 +0000 | [diff] [blame] | 337 | |
droy | 5d4b64c | 2008-02-29 15:22:10 +0000 | [diff] [blame] | 338 | /* This trigger sets the version to max(version) + 1. It also updates the file_progress table */ |
droy | d664f91 | 2008-05-14 15:45:10 +0000 | [diff] [blame] | 339 | /* We check IF(NEW.version > 1) to determine if this is a NEW translation or one that replaces an existing one */ |
droy | 5d4b64c | 2008-02-29 15:22:10 +0000 | [diff] [blame] | 340 | /* (COUNT(t.string_id) + 1) because it's a BEFORE INSERT trigger, the translated str is not in the DB yet */ |
| 341 | /* and without the +1 the percent would always be "one behind" */ |
| 342 | CREATE TRIGGER `ins_version` BEFORE INSERT ON `translations` FOR EACH ROW BEGIN |
| 343 | SET NEW.version = |
| 344 | (SELECT IFNULL(MAX(version),0)+1 FROM translations |
| 345 | WHERE string_id = NEW.string_id and language_id = NEW.language_id); |
droy | d664f91 | 2008-05-14 15:45:10 +0000 | [diff] [blame] | 346 | |
| 347 | /* Define a few fields we need here */ |
| 348 | SET @FILE_ID=(SELECT file_id FROM strings WHERE string_id = NEW.string_id); |
| 349 | SET @PROJECT=(SELECT project_id FROM files WHERE file_id = @FILE_ID); |
| 350 | SET @VERSION=(SELECT version FROM files WHERE file_id = @FILE_ID); |
droy | 5d4b64c | 2008-02-29 15:22:10 +0000 | [diff] [blame] | 351 | |
droy | d664f91 | 2008-05-14 15:45:10 +0000 | [diff] [blame] | 352 | |
| 353 | /* update this file's progress */ |
| 354 | DELETE FROM file_progress where file_id = @FILE_ID |
droy | 5d4b64c | 2008-02-29 15:22:10 +0000 | [diff] [blame] | 355 | AND language_id = NEW.language_id; |
| 356 | |
droy | d664f91 | 2008-05-14 15:45:10 +0000 | [diff] [blame] | 357 | /* See notes above for the hairy select */ |
| 358 | INSERT INTO file_progress SET file_id = @FILE_ID, |
droy | 5d4b64c | 2008-02-29 15:22:10 +0000 | [diff] [blame] | 359 | language_id = NEW.language_id, |
| 360 | pct_complete = ( |
droy | d664f91 | 2008-05-14 15:45:10 +0000 | [diff] [blame] | 361 | SELECT IF(NEW.version > 1, |
| 362 | IF(COUNT(s.string_id) > 0, (COUNT(t.string_id))/COUNT(s.string_id)*100,0), |
| 363 | IF(COUNT(s.string_id) > 0, (COUNT(t.string_id) + 1)/COUNT(s.string_id)*100,0) |
| 364 | ) AS translate_percent |
droy | 5d4b64c | 2008-02-29 15:22:10 +0000 | [diff] [blame] | 365 | FROM files AS f |
droy | d664f91 | 2008-05-14 15:45:10 +0000 | [diff] [blame] | 366 | LEFT JOIN strings AS s ON (s.file_id = f.file_id AND s.value <> "" and s.is_active) |
droy | 5d4b64c | 2008-02-29 15:22:10 +0000 | [diff] [blame] | 367 | LEFT JOIN translations AS t ON (s.string_id = t.string_id |
| 368 | AND t.language_id = NEW.language_id AND t.is_active = 1) |
droy | d664f91 | 2008-05-14 15:45:10 +0000 | [diff] [blame] | 369 | WHERE f.file_id = @FILE_ID |
| 370 | ); |
droy | 6e6fb6d | 2008-05-15 17:11:29 +0000 | [diff] [blame] | 371 | |
| 372 | |
| 373 | /* update project_progress table to indicate this proj/lang/vers stats are stale */ |
| 374 | /* don't know if record is there or not, so do both an insert and an update */ |
droy | 0757c2c | 2009-03-31 19:37:36 +0000 | [diff] [blame] | 375 | /* This portion of the trigger is similar to what is in the files table */ |
droy | 6e6fb6d | 2008-05-15 17:11:29 +0000 | [diff] [blame] | 376 | UPDATE IGNORE project_progress SET is_stale = 1 where project_id = @PROJECT |
droy | d664f91 | 2008-05-14 15:45:10 +0000 | [diff] [blame] | 377 | AND version = @VERSION |
| 378 | AND language_id = NEW.language_id; |
droy | 6e6fb6d | 2008-05-15 17:11:29 +0000 | [diff] [blame] | 379 | |
| 380 | INSERT IGNORE INTO project_progress SET is_stale = 1, project_id = @PROJECT, |
| 381 | version = @VERSION, |
| 382 | language_id = NEW.language_id; |
droy | d664f91 | 2008-05-14 15:45:10 +0000 | [diff] [blame] | 383 | |
droy | 5d4b64c | 2008-02-29 15:22:10 +0000 | [diff] [blame] | 384 | END; |
| 385 | ;; |
droy | 27e97e0 | 2007-11-27 16:44:19 +0000 | [diff] [blame] | 386 | DELIMITER ; |
| 387 | /*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */; |
| 388 | |
| 389 | -- |
| 390 | -- Table structure for table `users` |
| 391 | -- |
| 392 | |
| 393 | DROP TABLE IF EXISTS `users`; |
| 394 | CREATE TABLE `users` ( |
| 395 | `userid` int(10) unsigned NOT NULL, |
| 396 | `username` varchar(256) NOT NULL default '', |
| 397 | `first_name` varchar(256) NOT NULL default '', |
| 398 | `last_name` varchar(256) NOT NULL default '', |
| 399 | `email` varchar(256) NOT NULL default '', |
| 400 | `primary_language_id` int(11) NOT NULL default '0', |
| 401 | `hours_per_week` int(11) NOT NULL default '0', |
| 402 | `password_hash` varchar(256) NOT NULL default '', |
droy | 8da30b3 | 2007-11-29 21:00:26 +0000 | [diff] [blame] | 403 | `is_committer` tinyint unsigned not null default 0, |
droy | 27e97e0 | 2007-11-27 16:44:19 +0000 | [diff] [blame] | 404 | `updated_on` date NOT NULL, |
| 405 | `updated_at` time NOT NULL, |
| 406 | `created_on` date NOT NULL, |
| 407 | `created_at` time NOT NULL, |
| 408 | PRIMARY KEY (`userid`), |
| 409 | KEY `primary_language_id` (`primary_language_id`) |
| 410 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
droy | 97c8619 | 2007-11-28 22:00:22 +0000 | [diff] [blame] | 411 | |
droy | 5bb8117 | 2008-04-04 19:25:24 +0000 | [diff] [blame] | 412 | DROP TABLE IF EXISTS `scoreboard`; |
| 413 | CREATE TABLE `scoreboard` ( |
| 414 | `id` int unsigned not null auto_increment, |
| 415 | `itemid` char(6) NOT NULL, |
| 416 | `value` varchar(256) NOT NULL default '', |
| 417 | `quantity` double NOT NULL default 0, |
| 418 | PRIMARY KEY (`id`), |
| 419 | KEY(`quantity`) |
| 420 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
| 421 | |
| 422 | |
droy | 97c8619 | 2007-11-28 22:00:22 +0000 | [diff] [blame] | 423 | |
| 424 | |
droy | 27e97e0 | 2007-11-27 16:44:19 +0000 | [diff] [blame] | 425 | /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; |
| 426 | |
| 427 | /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; |
| 428 | /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; |
| 429 | /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; |
| 430 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; |
| 431 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; |
| 432 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; |
| 433 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; |
| 434 | |
droy | 6426bc0 | 2008-02-01 19:35:19 +0000 | [diff] [blame] | 435 | |
| 436 | |
| 437 | |
| 438 | |
| 439 | |
| 440 | /* |
| 441 | Babel data |
| 442 | User: babel@eclipse.org |
| 443 | pass: password |
| 444 | */ |
| 445 | |
| 446 | insert into profiles set login_name = "test", cryptpassword = "", realname = "tester", disabledtext = false, mybugslink = 1, extern_id = 1, disable_mail = false; |
droy | eccd983 | 2008-07-22 18:04:11 +0000 | [diff] [blame] | 447 | insert 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=''; |
kitlo | 32cd744 | 2010-02-15 16:29:22 +0000 | [diff] [blame] | 448 | insert 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=''; |
| 449 | insert 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=''; |
kitlo | 2e780dc | 2010-01-12 17:58:32 +0000 | [diff] [blame] | 450 | |
| 451 | insert into languages values (1, "en", null, "English", 1); |
| 452 | insert into languages values (null, "fr", null, "French", 1); |
| 453 | insert into languages values (null, "de", null, "German", 1); |
| 454 | insert into languages values (null, "es", null, "Spanish", 1); |
| 455 | insert into languages values (null, "it", null, "Italian", 1); |
| 456 | insert into languages values (null, "ja", null, "Japanese", 1); |
| 457 | insert into languages values (null, "ko", null, "Korean", 1); |
| 458 | insert into languages values (null, "pt_BR", "Brazilian", "Portuguese", 1); |
| 459 | insert into languages values (null, "zh", "Simplified", "Chinese", 1); |
| 460 | insert into languages values (null, "zh_TW", "Traditional", "Chinese", 1); |
| 461 | insert into languages values (null, "cs", null, "Czech", 1); |
| 462 | insert into languages values (null, "hu", null, "Hungarian", 1); |
| 463 | insert into languages values (null, "pl", null, "Polish", 1); |
| 464 | insert into languages values (null, "ru", null, "Russian", 1); |
| 465 | insert into languages values (null, "da", null, "Danish", 1); |
| 466 | insert into languages values (null, "nl", null, "Dutch", 1); |
| 467 | insert into languages values (null, "fi", null, "Finnish", 1); |
| 468 | insert into languages values (null, "el", null, "Greek", 1); |
| 469 | insert into languages values (null, "no", null, "Norwegian", 1); |
| 470 | insert into languages values (null, "pt", null, "Portuguese", 1); |
| 471 | insert into languages values (null, "sv", null, "Swedish", 1); |
| 472 | insert into languages values (null, "tr", null, "Turkish", 1); |
| 473 | insert into languages values (null, "ar", null, "Arabic", 1); |
| 474 | insert into languages values (null, "iw", null, "Hebrew", 1); |
| 475 | insert into languages values (null, "hi", null, "Hindi", 1); |
| 476 | insert into languages values (null, "ro", null, "Romanian", 1); |
| 477 | insert into languages values (null, "uk", null, "Ukrainian", 1); |
| 478 | insert into languages values (null, "ca", null, "Catalan", 1); |
| 479 | insert into languages values (null, "et", null, "Estonian", 1); |
| 480 | insert into languages values (null, "en_CA", "Canadian", "English", 1); |
| 481 | insert into languages values (null, "en_AU", "Australian", "English", 1); |
| 482 | insert into languages values (null, "mn", null, "Mongolian", 1); |
| 483 | insert into languages values (null, "id", null, "Indonesian", 1); |
| 484 | insert into languages values (null, "bg", null, "Bulgarian", 1); |
kitlo | 396bcca | 2010-02-11 20:03:25 +0000 | [diff] [blame] | 485 | insert into languages values (null, "sl", null, "Slovenian", 1); |
kitlo | f7ec1e8 | 2010-07-31 18:42:23 +0000 | [diff] [blame] | 486 | insert into languages values (null, "fa", null, "Persian", 1); |
| 487 | |
kitlo | 2e780dc | 2010-01-12 17:58:32 +0000 | [diff] [blame] | 488 | insert into languages values (null, "tl", null, "Klingon", 1); |
| 489 | |
droy | 6426bc0 | 2008-02-01 19:35:19 +0000 | [diff] [blame] | 490 | insert into projects set project_id = 'eclipse', is_active = 1 ; |
droy | 2df7406 | 2008-07-03 12:45:46 +0000 | [diff] [blame] | 491 | insert into projects set project_id = 'birt', is_active = 1 ; |
| 492 | insert into projects set project_id = 'modeling.emf', is_active = 1 ; |
| 493 | insert into projects set project_id = 'modeling.emft', is_active = 1 ; |
| 494 | insert into projects set project_id = 'modeling.gmf', is_active = 1 ; |
| 495 | insert into projects set project_id = 'modeling.mdt', is_active = 1 ; |
| 496 | insert into projects set project_id = 'stp', is_active = 1 ; |
| 497 | insert into projects set project_id = 'tools.cdt', is_active = 1 ; |
| 498 | insert into projects set project_id = 'tools.gef', is_active = 1 ; |
| 499 | insert into projects set project_id = 'tools.pdt', is_active = 1 ; |
| 500 | insert into projects set project_id = 'webtools', is_active = 1 ; |
| 501 | |
kitlo | 2e780dc | 2010-01-12 17:58:32 +0000 | [diff] [blame] | 502 | insert into project_versions set project_id = "eclipse", version = "3.3.1", is_active = 1; |
| 503 | insert into project_versions set project_id = "birt", version = "2.2.0", is_active = 1; |
| 504 | insert into project_versions set project_id = "stp", version = "0.8", is_active = 1; |
droy | 2bbc1ff | 2008-10-30 20:30:25 +0000 | [diff] [blame] | 505 | |
droy | 6426bc0 | 2008-02-01 19:35:19 +0000 | [diff] [blame] | 506 | insert into project_versions set project_id = "eclipse", version = "3.4", is_active = 1; |
droy | 2df7406 | 2008-07-03 12:45:46 +0000 | [diff] [blame] | 507 | insert into project_versions set project_id = "birt", version = "2.3.0", is_active = 1; |
| 508 | insert into project_versions set project_id = "modeling.emf", version = "2.4.0", is_active = 1; |
| 509 | insert into project_versions set project_id = "modeling.emft", version = "0.8", is_active = 1; |
| 510 | insert into project_versions set project_id = "modeling.gmf", version = "2.1", is_active = 1; |
| 511 | insert into project_versions set project_id = "modeling.mdt", version = "2.4.0", is_active = 1; |
| 512 | insert into project_versions set project_id = "stp", version = "1.0", is_active = 1; |
| 513 | insert into project_versions set project_id = "tools.cdt", version = "5.0", is_active = 1; |
| 514 | insert into project_versions set project_id = "tools.gef", version = "3.4", is_active = 1; |
| 515 | insert into project_versions set project_id = "tools.pdt", version = "1.5.1", is_active = 1; |
| 516 | insert into project_versions set project_id = "webtools", version = "3.0", is_active = 1; |
droy | 6426bc0 | 2008-02-01 19:35:19 +0000 | [diff] [blame] | 517 | |
kitlo | 2e780dc | 2010-01-12 17:58:32 +0000 | [diff] [blame] | 518 | insert into project_versions set project_id = "eclipse", version = "3.5", is_active = 1; |
| 519 | insert into project_versions set project_id = "birt", version = "2.5.0", is_active = 1; |
| 520 | insert into project_versions set project_id = "webtools", version = "3.1", is_active = 1; |
| 521 | |
| 522 | insert into project_versions set project_id = "eclipse", version = "3.6", is_active = 1; |
kitlo | e3fea25 | 2010-01-25 02:13:49 +0000 | [diff] [blame] | 523 | |
kitlo | 29f4a97 | 2010-08-08 00:14:04 +0000 | [diff] [blame^] | 524 | insert into release_trains values ('europa', '3.3.1', 1); |
| 525 | insert into release_trains values ('ganymede', '3.4.0', 1); |
| 526 | insert into release_trains values ('galileo', '3.5.0', 1); |
| 527 | insert into release_trains values ('helios', '3.6.0', 1); |
kitlo | 2e780dc | 2010-01-12 17:58:32 +0000 | [diff] [blame] | 528 | |
| 529 | insert into release_train_projects values ('europa', 'eclipse', '3.3.1'); |
| 530 | insert into release_train_projects values ('europa', 'birt', '2.2.0'); |
| 531 | insert into release_train_projects values ('europa', 'stp', '0.8'); |
| 532 | |
| 533 | insert into release_train_projects values ('ganymede', 'eclipse', '3.4'); |
| 534 | insert into release_train_projects values ('ganymede', 'birt', '2.3.0'); |
| 535 | insert into release_train_projects values ('ganymede', 'modeling.emf', '2.4.0'); |
| 536 | insert into release_train_projects values ('ganymede', 'modeling.emft', '0.8'); |
| 537 | insert into release_train_projects values ('ganymede', 'modeling.gmf', '2.1'); |
| 538 | insert into release_train_projects values ('ganymede', 'modeling.mdt', '2.4.0'); |
| 539 | insert into release_train_projects values ('ganymede', 'stp', '1.0'); |
| 540 | insert into release_train_projects values ('ganymede', 'tools.cdt', '5.0'); |
| 541 | insert into release_train_projects values ('ganymede', 'tools.gef', '3.4'); |
| 542 | insert into release_train_projects values ('ganymede', 'tools.pdt', '1.5.1'); |
| 543 | insert into release_train_projects values ('ganymede', 'webtools', '3.0'); |
| 544 | |
| 545 | insert into release_train_projects values ('galileo', 'eclipse', '3.5'); |
| 546 | insert into release_train_projects values ('galileo', 'birt', '2.5.0'); |
| 547 | insert into release_train_projects values ('galileo', 'webtools', '3.1'); |
| 548 | |
| 549 | insert into release_train_projects values ('helios', 'eclipse', '3.6'); |
kitlo | 2e780dc | 2010-01-12 17:58:32 +0000 | [diff] [blame] | 550 | |
droy | 6426bc0 | 2008-02-01 19:35:19 +0000 | [diff] [blame] | 551 | /* MAP INPUTS */ |
kitlo | d66aa99 | 2010-01-22 17:18:19 +0000 | [diff] [blame] | 552 | insert 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); |
| 553 | insert 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); |
| 554 | insert 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); |
| 555 | insert 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); |
| 556 | insert 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); |
| 557 | insert 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); |
| 558 | insert 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); |
| 559 | insert 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); |
| 560 | insert 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); |
| 561 | insert 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); |
| 562 | insert 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); |
| 563 | insert 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); |
| 564 | insert 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); |
| 565 | insert 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); |
| 566 | insert 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); |
kitlo | 2cd57b6 | 2010-02-15 17:09:17 +0000 | [diff] [blame] | 567 | insert 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); |
kitlo | d66aa99 | 2010-01-22 17:18:19 +0000 | [diff] [blame] | 568 | insert 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); |
| 569 | insert 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); |
| 570 | insert 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); |
| 571 | insert 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); |
| 572 | insert 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); |
| 573 | insert 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); |
| 574 | insert 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); |
| 575 | insert 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); |
| 576 | insert 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); |
| 577 | insert 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); |
droy | bafb7c4 | 2008-02-29 18:24:38 +0000 | [diff] [blame] | 578 | |
kitlo | f7ec1e8 | 2010-07-31 18:42:23 +0000 | [diff] [blame] | 579 | insert into map_files values ("eclipse", "3.6", "eclipse-3.6-updateSite", "http://download.eclipse.org/eclipse/updates/3.6", 1, 0); |
kitlo | e3fea25 | 2010-01-25 02:13:49 +0000 | [diff] [blame] | 580 | |
kitlo | 82d198f | 2010-02-11 22:31:35 +0000 | [diff] [blame] | 581 | insert into plugin_exclude_patterns values ("eclipse", "3.6", "/^com\\.jcraft\\..*$/"); |
| 582 | insert into plugin_exclude_patterns values ("eclipse", "3.6", "/^javax\\..*$/"); |
| 583 | insert into plugin_exclude_patterns values ("eclipse", "3.6", "/^org\\.apache\\..*$/"); |
| 584 | insert into plugin_exclude_patterns values ("eclipse", "3.6", "/^org\\.hamcrest\\..*$/"); |
| 585 | insert into plugin_exclude_patterns values ("eclipse", "3.6", "/^org\\.junit.*$/"); |
| 586 | insert into plugin_exclude_patterns values ("eclipse", "3.6", "/^org\\.mortbay\\..*$/"); |
| 587 | insert into plugin_exclude_patterns values ("eclipse", "3.6", "/^org\\.objectweb\\..*$/"); |
| 588 | insert into plugin_exclude_patterns values ("eclipse", "3.6", "/^org\\.sat4j\\..*$/"); |
kitlo | e3fea25 | 2010-01-25 02:13:49 +0000 | [diff] [blame] | 589 | |
droy | bafb7c4 | 2008-02-29 18:24:38 +0000 | [diff] [blame] | 590 | /* populate file_progress table */ |
droy | dc29484 | 2008-05-21 17:38:57 +0000 | [diff] [blame] | 591 | /* See also: dbmaintenance_15min.php */ |
droy | bafb7c4 | 2008-02-29 18:24:38 +0000 | [diff] [blame] | 592 | truncate table file_progress; |
| 593 | INSERT INTO file_progress |
droy | c2c2610 | 2008-05-21 16:01:40 +0000 | [diff] [blame] | 594 | select 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 |
droy | bafb7c4 | 2008-02-29 18:24:38 +0000 | [diff] [blame] | 595 | FROM files AS f |
| 596 | INNER JOIN languages as l ON l.is_active = 1 |
droy | 45413ea | 2008-07-28 14:36:23 +0000 | [diff] [blame] | 597 | LEFT JOIN strings as s ON (s.file_id = f.file_id AND s.is_active AND s.value <> "" AND s.non_translatable = 0) |
droy | bafb7c4 | 2008-02-29 18:24:38 +0000 | [diff] [blame] | 598 | LEFT JOIN translations AS t ON (s.string_id = t.string_id |
| 599 | AND t.language_id = l.language_id AND t.is_active = 1) |
| 600 | WHERE f.is_active = 1 |
| 601 | GROUP BY f.file_id, l.language_id; |
droy | 5bb8117 | 2008-04-04 19:25:24 +0000 | [diff] [blame] | 602 | DELETE FROM file_progress WHERE pct_complete = 0; |
| 603 | |
droy | d664f91 | 2008-05-14 15:45:10 +0000 | [diff] [blame] | 604 | /* populate project_progress table */ |
| 605 | truncate table project_progress; |
| 606 | INSERT INTO project_progress |
| 607 | SELECT |
| 608 | p.project_id, |
| 609 | v.version, |
| 610 | l.language_id, |
droy | b156beb | 2008-05-15 17:16:44 +0000 | [diff] [blame] | 611 | IF(COUNT(s.string_id) > 0, ROUND(COUNT(t.string_id)/COUNT(s.string_id) * 100, 2), 0) AS pct_complete, |
| 612 | 0 |
droy | d664f91 | 2008-05-14 15:45:10 +0000 | [diff] [blame] | 613 | FROM projects as p |
| 614 | INNER JOIN project_versions AS v ON v.project_id = p.project_id |
| 615 | INNER JOIN files AS f |
| 616 | ON (f.project_id = p.project_id AND f.version = v.version AND f.is_active) |
| 617 | INNER JOIN strings AS s |
| 618 | ON (s.file_id = f.file_id AND s.is_active) |
| 619 | INNER JOIN languages AS l |
| 620 | LEFT JOIN translations AS t |
| 621 | ON (t.string_id = s.string_id AND t.language_id = l.language_id AND t.is_active) |
| 622 | WHERE |
| 623 | s.value <> "" |
droy | 45413ea | 2008-07-28 14:36:23 +0000 | [diff] [blame] | 624 | AND s.non_translatable = 0 |
droy | d664f91 | 2008-05-14 15:45:10 +0000 | [diff] [blame] | 625 | AND p.is_active |
| 626 | GROUP BY p.project_id, v.version, l.language_id; |
| 627 | |
droy | 5bb8117 | 2008-04-04 19:25:24 +0000 | [diff] [blame] | 628 | /* populate scoreboard */ |
| 629 | truncate table scoreboard; |
| 630 | INSERT 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; |
| 631 | INSERT 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; |
droy | 0757c2c | 2009-03-31 19:37:36 +0000 | [diff] [blame] | 632 | INSERT INTO scoreboard SELECT NULL, "LASGEN", "Scoreboard Last Generated", MAX(translation_id) FROM translations; |
| 633 | |
| 634 | /* create a holding record for the MOTD */ |
kitlo | e3fea25 | 2010-01-25 02:13:49 +0000 | [diff] [blame] | 635 | INSERT INTO sys_values VALUES ("MOTD", NULL); |