From 32ea464bdfe5f8a22f46bfac50dcdc26c36fc497 Mon Sep 17 00:00:00 2001
From: Nathan Kinkade <nkinkade@nkinka.de>
Date: Thu, 5 Mar 2009 20:48:46 +0000
Subject: Applied message threading patch from Chris January:
 http://www.atomice.com/blog/?p=33

---
 roundcubemail/SQL/mysql.initial.sql | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

(limited to 'roundcubemail/SQL/mysql.initial.sql')

diff --git a/roundcubemail/SQL/mysql.initial.sql b/roundcubemail/SQL/mysql.initial.sql
index 9815282f3..f06ecc842 100644
--- a/roundcubemail/SQL/mysql.initial.sql
+++ b/roundcubemail/SQL/mysql.initial.sql
@@ -65,6 +65,29 @@ CREATE TABLE `messages` (
 ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
 
 
+-- Table structure for table `threads`
+
+CREATE TABLE `threads` (
+ `thread_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
+ `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
+ `mailbox` varchar(128) /*!40101 CHARACTER SET ascii COLLATE ascii_general_ci */ NOT NULL, 
+ `idx` int(11) UNSIGNED NOT NULL DEFAULT '0',
+ `has_children` tinyint(1) NOT NULL DEFAULT '0',
+ `is_root` tinyint(1) NOT NULL DEFAULT '0',
+ `root` int(11) UNSIGNED NOT NULL DEFAULT '0',
+ `depth` int(4) UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY(`thread_id`),
+ UNIQUE `uniqueness` (`user_id`, `mailbox`, `idx`),
+ INDEX `is_root_index` (`is_root`),
+ INDEX `root_index` (`root`),
+ CONSTRAINT `user_id_fk_threads` FOREIGN KEY (`user_id`)
+   REFERENCES `users`(`user_id`)
+   /*!40008
+     ON DELETE CASCADE
+     ON UPDATE CASCADE */
+) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */; 
+
+
 -- Table structure for table `cache`
 
 CREATE TABLE `cache` (
-- 
cgit v1.2.3

