Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 159 lines (132 sloc) 6.269 kb
e019f2d @alecpl - s/RoundCube/Roundcube/
alecpl authored
1 -- Roundcube Webmail initial database structure
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
2
3
2bedfab @thomascube Add conditional comments to mysql initial script (#1485517); remove o…
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 o…
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',
e2402ef @alecpl - Set DEFAULT NULL for users.last_login
alecpl authored
27 `last_login` datetime DEFAULT NULL,
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`),
ace511a @alecpl - Add unique index on users.username+users.mail_host
alecpl authored
31 UNIQUE `username` (`username`, `mail_host`),
6cb7786 @alecpl #1484854
alecpl authored
32 INDEX `alias_index` (`alias`)
2bedfab @thomascube Add conditional comments to mysql initial script (#1485517); remove o…
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 o…
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 ident…
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=4629…
alecpl authored
59 UNIQUE `uniqueness` (`user_id`, `cache_key`, `uid`)
2bedfab @thomascube Add conditional comments to mysql initial script (#1485517); remove o…
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 o…
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 ident…
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=4629…
alecpl authored
75 INDEX `user_cache_index` (`user_id`,`cache_key`)
2bedfab @thomascube Add conditional comments to mysql initial script (#1485517); remove o…
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 '',
6f09681 @alecpl - Support contact's email addresses up to 255 characters long (#1487095)
alecpl authored
86 `email` varchar(255) 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 '',
09b0e36 @thomascube Change vcard field to LONGTEXT to completely store vcards with embedd…
thomascube authored
89 `vcard` longtext NULL,
3e26373 @thomascube Fulltext search over contact fields. Attention: DATABASE SCHEMA CHANG…
thomascube authored
90 `words` text NULL,
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
91 `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
92 PRIMARY KEY(`contact_id`),
94fe9ca @alecpl - re-fix (#1486474) + require MySQL 4.0.8 + add index/update in ident…
alecpl authored
93 CONSTRAINT `user_id_fk_contacts` FOREIGN KEY (`user_id`)
94 REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
8248e4a @alecpl - Add workaround for MySQL bug [http://bugs.mysql.com/bug.php?id=4629…
alecpl authored
95 INDEX `user_contacts_index` (`user_id`,`email`)
2bedfab @thomascube Add conditional comments to mysql initial script (#1485517); remove o…
thomascube authored
96 ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
97
a61bbb2 @thomascube Added basic contact groups feature
thomascube authored
98 -- Table structure for table `contactgroups`
99
100 CREATE TABLE `contactgroups` (
101 `contactgroup_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
102 `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
1924136 @alecpl - fix default datetime
alecpl authored
103 `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
a61bbb2 @thomascube Added basic contact groups feature
thomascube authored
104 `del` tinyint(1) NOT NULL DEFAULT '0',
105 `name` varchar(128) NOT NULL DEFAULT '',
106 PRIMARY KEY(`contactgroup_id`),
107 CONSTRAINT `user_id_fk_contactgroups` FOREIGN KEY (`user_id`)
108 REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
109 INDEX `contactgroups_user_index` (`user_id`,`del`)
110 ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
111
112 CREATE TABLE `contactgroupmembers` (
113 `contactgroup_id` int(10) UNSIGNED NOT NULL,
114 `contact_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
1924136 @alecpl - fix default datetime
alecpl authored
115 `created` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
a61bbb2 @thomascube Added basic contact groups feature
thomascube authored
116 PRIMARY KEY (`contactgroup_id`, `contact_id`),
117 CONSTRAINT `contactgroup_id_fk_contactgroups` FOREIGN KEY (`contactgroup_id`)
118 REFERENCES `contactgroups`(`contactgroup_id`) ON DELETE CASCADE ON UPDATE CASCADE,
119 CONSTRAINT `contact_id_fk_contacts` FOREIGN KEY (`contact_id`)
3a5476d @alecpl - Add index on contactgroupmembers.contact_id column.
alecpl authored
120 REFERENCES `contacts`(`contact_id`) ON DELETE CASCADE ON UPDATE CASCADE,
121 INDEX `contactgroupmembers_contact_index` (`contact_id`)
a61bbb2 @thomascube Added basic contact groups feature
thomascube authored
122 ) /*!40000 ENGINE=INNODB */;
123
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
124
125 -- Table structure for table `identities`
126
127 CREATE TABLE `identities` (
128 `identity_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
a35062a @thomascube Always set changed date when marking a DB record as deleted + provide…
thomascube authored
129 `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
130 `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
131 `del` tinyint(1) NOT NULL DEFAULT '0',
132 `standard` tinyint(1) NOT NULL DEFAULT '0',
133 `name` varchar(128) NOT NULL,
d7f3d79 @alecpl -Fixed Mysql DDL for default identities creation (#1485070)
alecpl authored
134 `organization` varchar(128) NOT NULL DEFAULT '',
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
135 `email` varchar(128) NOT NULL,
d7f3d79 @alecpl -Fixed Mysql DDL for default identities creation (#1485070)
alecpl authored
136 `reply-to` varchar(128) NOT NULL DEFAULT '',
137 `bcc` varchar(128) NOT NULL DEFAULT '',
f18911a @alecpl - #1485120 (text column can't have a default value)
alecpl authored
138 `signature` text,
a0109c4 Initial TinyMCE editor support (still need to work on spellcheck and …
svncommit authored
139 `html_signature` tinyint(1) NOT NULL DEFAULT '0',
94fe9ca @alecpl - re-fix (#1486474) + require MySQL 4.0.8 + add index/update in ident…
alecpl authored
140 PRIMARY KEY(`identity_id`),
141 CONSTRAINT `user_id_fk_identities` FOREIGN KEY (`user_id`)
142 REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
143 INDEX `user_identities_index` (`user_id`, `del`)
2bedfab @thomascube Add conditional comments to mysql initial script (#1485517); remove o…
thomascube authored
144 ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
145
146
66df084 @alecpl - Merge devel-spellcheck branch:
alecpl authored
147 -- Table structure for table `dictionary`
148
149 CREATE TABLE `dictionary` (
150 `user_id` int(10) UNSIGNED DEFAULT NULL,
151 `language` varchar(5) NOT NULL,
152 `data` longtext NOT NULL,
153 CONSTRAINT `user_id_fk_dictionary` FOREIGN KEY (`user_id`)
154 REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
155 UNIQUE `uniqueness` (`user_id`, `language`)
156 ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
157
2bedfab @thomascube Add conditional comments to mysql initial script (#1485517); remove o…
thomascube authored
158 /*!40014 SET FOREIGN_KEY_CHECKS=1 */;
Something went wrong with that request. Please try again.