blob: a7e88ebe2af88a97627f98c5097d7ec566d5c3ff [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
droy3e7f3a82007-11-29 19:35:51 +000018CREATE TABLE `event_log` (
19 `event_id` int(10) unsigned NOT NULL auto_increment,
20 `table_name` varchar(100) NOT NULL,
21 `key_name` varchar(100) NOT NULL,
22 `key_value` varchar(100) default NULL,
23 `action` varchar(100) NOT NULL,
24 `userid` mediumint(9) NOT NULL,
25 `created_on` datetime NOT NULL,
26 PRIMARY KEY (`event_id`)
27) ENGINE=MyISAM DEFAULT CHARSET=utf8;
droy27e97e02007-11-27 16:44:19 +000028
29DROP TABLE IF EXISTS `files`;
30CREATE TABLE `files` (
droye5c99812007-11-28 21:36:51 +000031 `file_id` int(10) unsigned NOT NULL auto_increment,
droy27e97e02007-11-27 16:44:19 +000032 `project_id` varchar(100) NOT NULL,
droyc081e862007-11-30 16:37:35 +000033 `version` double NOT NULL,
droy27e97e02007-11-27 16:44:19 +000034 `name` text NOT NULL,
35 `is_active` tinyint(3) unsigned NOT NULL default '1',
36 PRIMARY KEY (`file_id`),
37 KEY `project_id` (`project_id`),
droyc081e862007-11-30 16:37:35 +000038 CONSTRAINT `files_ibfk_1` FOREIGN KEY (`project_id`,`version`) REFERENCES `project_versions` (`project_id`,`version`) ON UPDATE CASCADE
droy27e97e02007-11-27 16:44:19 +000039) ENGINE=InnoDB DEFAULT CHARSET=utf8;
40
41--
42-- Table structure for table `languages`
43--
44
45DROP TABLE IF EXISTS `languages`;
46CREATE TABLE `languages` (
47 `language_id` smallint(5) unsigned NOT NULL auto_increment,
48 `iso_code` char(2) NOT NULL,
49 `locale` varchar(12) default NULL,
50 `name` varchar(50) NOT NULL,
51 `is_active` tinyint(3) unsigned NOT NULL default '1',
52 PRIMARY KEY (`language_id`),
53 KEY `iso_code` (`iso_code`),
54 KEY `locale` (`locale`)
55) ENGINE=InnoDB DEFAULT CHARSET=utf8;
56
57--
58-- Table structure for table `profiles`
59--
60
61DROP TABLE IF EXISTS `profiles`;
62CREATE TABLE `profiles` (
63 `userid` mediumint(9) NOT NULL auto_increment,
64 `login_name` varchar(255) NOT NULL default '',
65 `cryptpassword` varchar(128) default NULL,
66 `realname` varchar(255) NOT NULL default '',
67 `disabledtext` mediumtext NOT NULL,
68 `mybugslink` tinyint(4) NOT NULL default '1',
69 `extern_id` varchar(64) default NULL,
70 `disable_mail` tinyint(4) NOT NULL default '0',
71 PRIMARY KEY (`userid`),
72 UNIQUE KEY `profiles_login_name_idx` (`login_name`)
73) ENGINE=MyISAM DEFAULT CHARSET=latin1;
74
75--
76-- Table structure for table `projects`
77--
78
79DROP TABLE IF EXISTS `projects`;
80CREATE TABLE `projects` (
81 `project_id` varchar(100) NOT NULL,
82 `is_active` tinyint(3) unsigned NOT NULL default '1',
83 PRIMARY KEY (`project_id`)
84) ENGINE=InnoDB DEFAULT CHARSET=utf8;
85
droyc081e862007-11-30 16:37:35 +000086DROP TABLE IF EXISTS `project_versions`;
87CREATE TABLE `project_versions` (
88 `project_id` varchar(100) NOT NULL,
89 `version` double NOT NULL,
90 `is_active` tinyint(3) unsigned NOT NULL default '1',
91 PRIMARY KEY (`project_id`, `version`),
92 CONSTRAINT `project_versions_ibfk_1` FOREIGN KEY (`project_id`) REFERENCES `projects` (`project_id`) ON UPDATE CASCADE ON DELETE CASCADE
93) ENGINE=InnoDB DEFAULT CHARSET=utf8;
94
droy27e97e02007-11-27 16:44:19 +000095--
96-- Table structure for table `ratings`
97--
98
99DROP TABLE IF EXISTS `ratings`;
100CREATE TABLE `ratings` (
101 `translation_id` int(10) unsigned NOT NULL,
102 `userid` int(10) unsigned NOT NULL,
103 `rating` tinyint(3) unsigned NOT NULL default '0',
104 `created_on` datetime NOT NULL,
105 PRIMARY KEY (`translation_id`,`userid`),
106 CONSTRAINT `ratings_ibfk_1` FOREIGN KEY (`translation_id`) REFERENCES `translations` (`translation_id`) ON UPDATE CASCADE
107) ENGINE=InnoDB DEFAULT CHARSET=utf8;
108
109--
110-- Table structure for table `schema_info`
111--
112
113DROP TABLE IF EXISTS `schema_info`;
114CREATE TABLE `schema_info` (
115 `version` int(11) default NULL
116) ENGINE=MyISAM DEFAULT CHARSET=latin1;
117
118--
119-- Table structure for table `sessions`
120--
121
122DROP TABLE IF EXISTS `sessions`;
123CREATE TABLE `sessions` (
124 `id` int(11) unsigned NOT NULL auto_increment,
125 `userid` int(11) NOT NULL,
126 `gid` char(32) default NULL,
127 `subnet` char(15) default NULL,
128 `updated_at` datetime default NULL,
129 PRIMARY KEY (`id`),
130 KEY `gid` (`gid`),
131 KEY `userid` (`userid`)
132) ENGINE=InnoDB DEFAULT CHARSET=latin1;
133
134--
135-- Table structure for table `strings`
136--
137
138DROP TABLE IF EXISTS `strings`;
139CREATE TABLE `strings` (
140 `string_id` int(10) unsigned NOT NULL auto_increment,
141 `file_id` int(10) unsigned NOT NULL,
142 `name` text NOT NULL,
143 `value` text NOT NULL,
144 `userid` int(10) unsigned NOT NULL,
145 `created_on` datetime NOT NULL,
146 `is_active` tinyint(1) unsigned default NULL,
147 PRIMARY KEY (`string_id`),
148 KEY `file_id` (`file_id`),
149 KEY `userid` (`userid`),
150 CONSTRAINT `strings_ibfk_1` FOREIGN KEY (`file_id`) REFERENCES `files` (`file_id`) ON UPDATE CASCADE,
151 CONSTRAINT `strings_ibfk_2` FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON UPDATE CASCADE
152) ENGINE=InnoDB DEFAULT CHARSET=utf8;
153
154--
155-- Table structure for table `translation_archives`
156--
157
158DROP TABLE IF EXISTS `translation_archives`;
159CREATE TABLE `translation_archives` (
160 `translation_id` int(10) unsigned NOT NULL,
161 `string_id` int(10) unsigned NOT NULL,
162 `language_id` smallint(5) unsigned NOT NULL,
163 `version` int(10) unsigned NOT NULL default '1',
164 `value` text NOT NULL,
165 `is_active` tinyint(3) unsigned NOT NULL default '1',
166 `userid` int(10) unsigned NOT NULL,
167 `created_on` datetime NOT NULL,
168 PRIMARY KEY (`string_id`,`language_id`,`version`),
169 KEY `language_id` (`language_id`),
170 KEY `userid` (`userid`),
171 CONSTRAINT `translation_archives_ibfk_1` FOREIGN KEY (`string_id`) REFERENCES `strings` (`string_id`) ON UPDATE CASCADE,
172 CONSTRAINT `translation_archives_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`language_id`) ON UPDATE CASCADE,
173 CONSTRAINT `translation_archives_ibfk_3` FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON UPDATE CASCADE
174) ENGINE=InnoDB DEFAULT CHARSET=utf8;
175
176--
177-- Table structure for table `translations`
178--
179
180DROP TABLE IF EXISTS `translations`;
181CREATE TABLE `translations` (
182 `translation_id` int(10) unsigned NOT NULL auto_increment,
183 `string_id` int(10) unsigned NOT NULL,
184 `language_id` smallint(5) unsigned NOT NULL,
185 `version` int(10) unsigned NOT NULL default '1',
186 `value` text NOT NULL,
187 `is_active` tinyint(3) unsigned NOT NULL default '1',
188 `userid` int(10) unsigned NOT NULL,
189 `created_on` datetime NOT NULL,
190 PRIMARY KEY (`string_id`,`language_id`,`version`),
191 KEY `translation_id` (`translation_id`),
192 KEY `language_id` (`language_id`),
193 KEY `userid` (`userid`),
194 CONSTRAINT `translations_ibfk_1` FOREIGN KEY (`string_id`) REFERENCES `strings` (`string_id`) ON UPDATE CASCADE,
195 CONSTRAINT `translations_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`language_id`) ON UPDATE CASCADE,
196 CONSTRAINT `translations_ibfk_3` FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON UPDATE CASCADE
197) ENGINE=InnoDB DEFAULT CHARSET=utf8;
198
199/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;
200DELIMITER ;;
201/*!50003 SET SESSION SQL_MODE="" */;;
202/*!50003 CREATE TRIGGER `ins_version` BEFORE INSERT ON `translations` FOR EACH ROW SET NEW.version =
droye4e2e332007-11-29 19:59:12 +0000203 (SELECT IFNULL(MAX(version),0)+1 FROM translations
droy8da30b32007-11-29 21:00:26 +0000204 WHERE string_id = NEW.string_id and language_id = NEW.language_id) */;;
droy27e97e02007-11-27 16:44:19 +0000205
206DELIMITER ;
207/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */;
208
209--
210-- Table structure for table `users`
211--
212
213DROP TABLE IF EXISTS `users`;
214CREATE TABLE `users` (
215 `userid` int(10) unsigned NOT NULL,
216 `username` varchar(256) NOT NULL default '',
217 `first_name` varchar(256) NOT NULL default '',
218 `last_name` varchar(256) NOT NULL default '',
219 `email` varchar(256) NOT NULL default '',
220 `primary_language_id` int(11) NOT NULL default '0',
221 `hours_per_week` int(11) NOT NULL default '0',
222 `password_hash` varchar(256) NOT NULL default '',
droy8da30b32007-11-29 21:00:26 +0000223 `is_committer` tinyint unsigned not null default 0,
droy27e97e02007-11-27 16:44:19 +0000224 `updated_on` date NOT NULL,
225 `updated_at` time NOT NULL,
226 `created_on` date NOT NULL,
227 `created_at` time NOT NULL,
228 PRIMARY KEY (`userid`),
229 KEY `primary_language_id` (`primary_language_id`)
230) ENGINE=InnoDB DEFAULT CHARSET=utf8;
droy97c86192007-11-28 22:00:22 +0000231
232insert into languages values(null, "en", null, "English", 1);
233
234
235insert into projects values("eclipse", 1);
236
237
238
droy27e97e02007-11-27 16:44:19 +0000239/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
240
241/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
242/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
243/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
244/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
245/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
246/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
247/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
248