summaryrefslogtreecommitdiff
path: root/SQL/mysql5.initial.sql
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2008-03-25 19:08:19 +0000
committerthomascube <thomas@roundcube.net>2008-03-25 19:08:19 +0000
commitac26b964663405521077c7710212a58c37a041c7 (patch)
tree9a6beed1f2e9c5ec73916900fe1bda47f6e68154 /SQL/mysql5.initial.sql
parent0ce1a6514975293e134e4a41e739a0d5f9025990 (diff)
Optimize database schema; get rid of unnecessary indexes
Diffstat (limited to 'SQL/mysql5.initial.sql')
-rw-r--r--SQL/mysql5.initial.sql19
1 files changed, 8 insertions, 11 deletions
diff --git a/SQL/mysql5.initial.sql b/SQL/mysql5.initial.sql
index 1a6ef1990..58e220f7d 100644
--- a/SQL/mysql5.initial.sql
+++ b/SQL/mysql5.initial.sql
@@ -1,5 +1,5 @@
-- RoundCube Webmail initial database structure
--- Version 0.1-rc1
+-- Version 0.1
-- --------------------------------------------------------
@@ -15,7 +15,7 @@ CREATE TABLE `session` (
`ip` varchar(40) NOT NULL,
`vars` text NOT NULL,
PRIMARY KEY(`sess_id`)
-) TYPE=MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;
+) TYPE=INNODB CHARACTER SET utf8 COLLATE utf8_general_ci;
-- Table structure for table `users`
@@ -30,7 +30,7 @@ CREATE TABLE `users` (
`language` varchar(5) NOT NULL DEFAULT 'en',
`preferences` text,
PRIMARY KEY(`user_id`)
-) TYPE=MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;
+) TYPE=INNODB CHARACTER SET utf8 COLLATE utf8_general_ci;
-- Table structure for table `messages`
@@ -52,14 +52,12 @@ CREATE TABLE `messages` (
`headers` text NOT NULL,
`structure` text,
PRIMARY KEY(`message_id`),
- INDEX `idx`(`idx`),
- INDEX `uid`(`uid`),
UNIQUE `uniqueness` (`user_id`, `cache_key`, `uid`),
CONSTRAINT `user_id_fk_messages` FOREIGN KEY (`user_id`)
REFERENCES `users`(`user_id`)
ON DELETE CASCADE
ON UPDATE CASCADE
-) TYPE=MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;
+) TYPE=INNODB CHARACTER SET utf8 COLLATE utf8_general_ci;
-- Table structure for table `cache`
@@ -72,13 +70,12 @@ CREATE TABLE `cache` (
`data` longtext NOT NULL,
`user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY(`cache_id`),
- INDEX `cache_key`(`cache_key`),
- INDEX `session_id`(`session_id`),
+ INDEX `user_cache_index` (`user_id`,`cache_key`),
CONSTRAINT `user_id_fk_cache` FOREIGN KEY (`user_id`)
REFERENCES `users`(`user_id`)
ON DELETE CASCADE
ON UPDATE CASCADE
-) TYPE=MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;
+) TYPE=INNODB CHARACTER SET utf8 COLLATE utf8_general_ci;
-- Table structure for table `contacts`
@@ -98,7 +95,7 @@ CREATE TABLE `contacts` (
REFERENCES `users`(`user_id`)
ON DELETE CASCADE
ON UPDATE CASCADE
-) TYPE=MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;
+) TYPE=INNODB CHARACTER SET utf8 COLLATE utf8_general_ci;
-- Table structure for table `identities`
@@ -120,7 +117,7 @@ CREATE TABLE `identities` (
REFERENCES `users`(`user_id`)
ON DELETE CASCADE
ON UPDATE CASCADE
-) TYPE=MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;
+) TYPE=INNODB CHARACTER SET utf8 COLLATE utf8_general_ci;
SET FOREIGN_KEY_CHECKS=1;