Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 120 lines (98 sloc) 4.476 kb
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
1 -- RoundCube Webmail initial database structure
2
3
2bedfab @thomascube Add conditional comments to mysql initial script (#1485517); remove old ...
thomascube authored
4 /*!40014 SET FOREIGN_KEY_CHECKS=0 */;
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
5
6 -- Table structure for table `session`
7
8 CREATE TABLE `session` (
9 `sess_id` varchar(40) NOT NULL,
37974e2 @alecpl - Fix datetime columns defaults in mysql's DDL (#1485641)
alecpl authored
10 `created` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
11 `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
84d06ed @thomascube IPv6 Compatability
thomascube authored
12 `ip` varchar(40) NOT NULL,
b2b8b19 @vbenincasa - Change MySQL data type to avoid problems with big session vars
vbenincasa authored
13 `vars` mediumtext NOT NULL,
3e48d2e @alecpl - Increase speed of session destroy and garbage clean up
alecpl authored
14 PRIMARY KEY(`sess_id`),
15 INDEX `changed_index` (`changed`)
2bedfab @thomascube Add conditional comments to mysql initial script (#1485517); remove old ...
thomascube authored
16 ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
17
18
19 -- Table structure for table `users`
20
21 CREATE TABLE `users` (
22 `user_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
23 `username` varchar(128) NOT NULL,
24 `mail_host` varchar(128) NOT NULL,
25 `alias` varchar(128) NOT NULL,
37974e2 @alecpl - Fix datetime columns defaults in mysql's DDL (#1485641)
alecpl authored
26 `created` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
27 `last_login` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
debdda0 @alecpl #1485420: remove default (and not null) for users.language column in DDL
alecpl authored
28 `language` varchar(5),
112bff6 @thomascube Set prefs field in user table to null (#1484386)
thomascube authored
29 `preferences` text,
6cb7786 @alecpl #1484854
alecpl authored
30 PRIMARY KEY(`user_id`),
31 INDEX `username_index` (`username`),
32 INDEX `alias_index` (`alias`)
2bedfab @thomascube Add conditional comments to mysql initial script (#1485517); remove old ...
thomascube authored
33 ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
34
35
36 -- Table structure for table `messages`
37
38 CREATE TABLE `messages` (
39 `message_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
f7bfec9 @thomascube Finalized new message parsing. Attention: changes in database schema
thomascube authored
40 `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
41 `del` tinyint(1) NOT NULL DEFAULT '0',
2bedfab @thomascube Add conditional comments to mysql initial script (#1485517); remove old ...
thomascube authored
42 `cache_key` varchar(128) /*!40101 CHARACTER SET ascii COLLATE ascii_general_ci */ NOT NULL,
37974e2 @alecpl - Fix datetime columns defaults in mysql's DDL (#1485641)
alecpl authored
43 `created` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
44 `idx` int(11) UNSIGNED NOT NULL DEFAULT '0',
45 `uid` int(11) UNSIGNED NOT NULL DEFAULT '0',
46 `subject` varchar(255) NOT NULL,
47 `from` varchar(255) NOT NULL,
48 `to` varchar(255) NOT NULL,
49 `cc` varchar(255) NOT NULL,
37974e2 @alecpl - Fix datetime columns defaults in mysql's DDL (#1485641)
alecpl authored
50 `date` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
51 `size` int(11) UNSIGNED NOT NULL DEFAULT '0',
52 `headers` text NOT NULL,
f7bfec9 @thomascube Finalized new message parsing. Attention: changes in database schema
thomascube authored
53 `structure` text,
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
54 PRIMARY KEY(`message_id`),
94fe9ca @alecpl - re-fix (#1486474) + require MySQL 4.0.8 + add index/update in identiti...
alecpl authored
55 CONSTRAINT `user_id_fk_messages` FOREIGN KEY (`user_id`)
56 REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
c98f3b5 @alecpl #1485125: added index on messages.created
alecpl authored
57 INDEX `created_index` (`created`),
3d601d2 @alecpl - added index in messages table
alecpl authored
58 INDEX `index_index` (`user_id`, `cache_key`, `idx`),
8248e4a @alecpl - Add workaround for MySQL bug [http://bugs.mysql.com/bug.php?id=46293] ...
alecpl authored
59 UNIQUE `uniqueness` (`user_id`, `cache_key`, `uid`)
2bedfab @thomascube Add conditional comments to mysql initial script (#1485517); remove old ...
thomascube authored
60 ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
61
62
63 -- Table structure for table `cache`
64
65 CREATE TABLE `cache` (
66 `cache_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
2bedfab @thomascube Add conditional comments to mysql initial script (#1485517); remove old ...
thomascube authored
67 `cache_key` varchar(128) /*!40101 CHARACTER SET ascii COLLATE ascii_general_ci */ NOT NULL ,
37974e2 @alecpl - Fix datetime columns defaults in mysql's DDL (#1485641)
alecpl authored
68 `created` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
69 `data` longtext NOT NULL,
70 `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
71 PRIMARY KEY(`cache_id`),
94fe9ca @alecpl - re-fix (#1486474) + require MySQL 4.0.8 + add index/update in identiti...
alecpl authored
72 CONSTRAINT `user_id_fk_cache` FOREIGN KEY (`user_id`)
73 REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
e4d9f05 @alecpl - Added index on cache.created + small fixes in mssql DDL script
alecpl authored
74 INDEX `created_index` (`created`),
8248e4a @alecpl - Add workaround for MySQL bug [http://bugs.mysql.com/bug.php?id=46293] ...
alecpl authored
75 INDEX `user_cache_index` (`user_id`,`cache_key`)
2bedfab @thomascube Add conditional comments to mysql initial script (#1485517); remove old ...
thomascube authored
76 ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
77
78
79 -- Table structure for table `contacts`
80
81 CREATE TABLE `contacts` (
82 `contact_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
37974e2 @alecpl - Fix datetime columns defaults in mysql's DDL (#1485641)
alecpl authored
83 `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
84 `del` tinyint(1) NOT NULL DEFAULT '0',
951c07b @alecpl - Fix adding contacts SQL error on mysql (#1486459)
alecpl authored
85 `name` varchar(128) NOT NULL DEFAULT '',
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
86 `email` varchar(128) NOT NULL,
951c07b @alecpl - Fix adding contacts SQL error on mysql (#1486459)
alecpl authored
87 `firstname` varchar(128) NOT NULL DEFAULT '',
88 `surname` varchar(128) NOT NULL DEFAULT '',
3c3b351 @thomascube Fix default value problem for MySQL (#1483940)
thomascube authored
89 `vcard` text NULL,
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
90 `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
91 PRIMARY KEY(`contact_id`),
94fe9ca @alecpl - re-fix (#1486474) + require MySQL 4.0.8 + add index/update in identiti...
alecpl authored
92 CONSTRAINT `user_id_fk_contacts` FOREIGN KEY (`user_id`)
93 REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
8248e4a @alecpl - Add workaround for MySQL bug [http://bugs.mysql.com/bug.php?id=46293] ...
alecpl authored
94 INDEX `user_contacts_index` (`user_id`,`email`)
2bedfab @thomascube Add conditional comments to mysql initial script (#1485517); remove old ...
thomascube authored
95 ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
96
97
98 -- Table structure for table `identities`
99
100 CREATE TABLE `identities` (
101 `identity_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
102 `del` tinyint(1) NOT NULL DEFAULT '0',
103 `standard` tinyint(1) NOT NULL DEFAULT '0',
104 `name` varchar(128) NOT NULL,
d7f3d79 @alecpl -Fixed Mysql DDL for default identities creation (#1485070)
alecpl authored
105 `organization` varchar(128) NOT NULL DEFAULT '',
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
106 `email` varchar(128) NOT NULL,
d7f3d79 @alecpl -Fixed Mysql DDL for default identities creation (#1485070)
alecpl authored
107 `reply-to` varchar(128) NOT NULL DEFAULT '',
108 `bcc` varchar(128) NOT NULL DEFAULT '',
f18911a @alecpl - #1485120 (text column can't have a default value)
alecpl authored
109 `signature` text,
a0109c4 Initial TinyMCE editor support (still need to work on spellcheck and ski...
svncommit authored
110 `html_signature` tinyint(1) NOT NULL DEFAULT '0',
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
111 `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
94fe9ca @alecpl - re-fix (#1486474) + require MySQL 4.0.8 + add index/update in identiti...
alecpl authored
112 PRIMARY KEY(`identity_id`),
113 CONSTRAINT `user_id_fk_identities` FOREIGN KEY (`user_id`)
114 REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
115 INDEX `user_identities_index` (`user_id`, `del`)
2bedfab @thomascube Add conditional comments to mysql initial script (#1485517); remove old ...
thomascube authored
116 ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
117
118
2bedfab @thomascube Add conditional comments to mysql initial script (#1485517); remove old ...
thomascube authored
119 /*!40014 SET FOREIGN_KEY_CHECKS=1 */;
Something went wrong with that request. Please try again.