]> git.donarmstrong.com Git - roundcube.git/blobdiff - SQL/mysql5.initial.sql
Imported Upstream version 0.1~rc1~dfsg
[roundcube.git] / SQL / mysql5.initial.sql
index 0116468ee6316b7dc097dec7b7dab5998235f75c..0c0dcb199a2fcd990dc8636cd8f374717f3e66be 100644 (file)
@@ -1,6 +1,5 @@
 -- RoundCube Webmail initial database structure
--- Version 0.1beta2
--- 
+-- Version 0.1-rc1
 
 -- --------------------------------------------------------
 
@@ -16,7 +15,7 @@ CREATE TABLE `session` (
  `ip` varchar(15) NOT NULL,
  `vars` text NOT NULL,
  PRIMARY KEY(`sess_id`)
-) TYPE=MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;
+) TYPE=MYISAM CHARACTER SET ascii COLLATE ascii_general_ci;
 
 
 -- Table structure for table `users`
@@ -29,7 +28,7 @@ CREATE TABLE `users` (
  `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `last_login` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `language` varchar(5) NOT NULL DEFAULT 'en',
- `preferences` text NOT NULL,
+ `preferences` text NOT NULL DEFAULT '',
  PRIMARY KEY(`user_id`)
 ) TYPE=MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;
 
@@ -38,8 +37,9 @@ CREATE TABLE `users` (
 
 CREATE TABLE `messages` (
  `message_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
+ `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
  `del` tinyint(1) NOT NULL DEFAULT '0',
- `cache_key` varchar(128) NOT NULL,
+ `cache_key` varchar(128) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL,
  `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `idx` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `uid` int(11) UNSIGNED NOT NULL DEFAULT '0',
@@ -50,13 +50,12 @@ CREATE TABLE `messages` (
  `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `size` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `headers` text NOT NULL,
- `body` longtext,
- `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
+ `structure` text,
  PRIMARY KEY(`message_id`),
- INDEX `cache_key`(`cache_key`),
  INDEX `idx`(`idx`),
  INDEX `uid`(`uid`),
- CONSTRAINT `User_ID_FK_messages` FOREIGN KEY (`user_id`)
+ 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
@@ -67,15 +66,15 @@ CREATE TABLE `messages` (
 
 CREATE TABLE `cache` (
  `cache_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- `session_id` varchar(40),
- `cache_key` varchar(128) NOT NULL,
+ `session_id` varchar(40) CHARACTER SET ascii COLLATE ascii_general_ci,
+ `cache_key` varchar(128) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL,
  `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `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`),
- CONSTRAINT `User_ID_FK_cache` FOREIGN KEY (`user_id`)
+ CONSTRAINT `user_id_fk_cache` FOREIGN KEY (`user_id`)
    REFERENCES `users`(`user_id`)
      ON DELETE CASCADE
      ON UPDATE CASCADE
@@ -92,10 +91,10 @@ CREATE TABLE `contacts` (
  `email` varchar(128) NOT NULL,
  `firstname` varchar(128) NOT NULL,
  `surname` varchar(128) NOT NULL,
- `vcard` text NOT NULL,
+ `vcard` text NULL,
  `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
  PRIMARY KEY(`contact_id`),
- CONSTRAINT `User_ID_FK_contacts` FOREIGN KEY (`user_id`)
+ CONSTRAINT `user_id_fk_contacts` FOREIGN KEY (`user_id`)
    REFERENCES `users`(`user_id`)
      ON DELETE CASCADE
      ON UPDATE CASCADE
@@ -114,13 +113,14 @@ CREATE TABLE `identities` (
  `reply-to` varchar(128) NOT NULL,
  `bcc` varchar(128) NOT NULL,
  `signature` text NOT NULL,
+ `html_signature` tinyint(1) NOT NULL DEFAULT '0',
  `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
  PRIMARY KEY(`identity_id`),
- CONSTRAINT `User_ID_FK_identities` FOREIGN KEY (`user_id`)
+ CONSTRAINT `user_id_fk_identities` FOREIGN KEY (`user_id`)
    REFERENCES `users`(`user_id`)
      ON DELETE CASCADE
      ON UPDATE CASCADE
 ) TYPE=MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;
 
 
-SET FOREIGN_KEY_CHECKS=1;
\ No newline at end of file
+SET FOREIGN_KEY_CHECKS=1;