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