From f973722de683aaa549c9114546281f597c4ee61d Mon Sep 17 00:00:00 2001
From: alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>
Date: Wed, 7 Sep 2011 11:07:03 +0000
Subject: - Rewritten messages caching (merged devel-mcache branch):   Indexes
 are stored in a separate table, so there's no need to store all messages in a
 folder   Added threads data caching   Flags are stored separately, so flag
 change doesn't cause DELETE+INSERT, just UPDATE - Partial QRESYNC support -
 Improved FETCH response handling - Improvements in response tokenization
 method

git-svn-id: https://svn.roundcube.net/trunk@5190 208e9e7b-5314-0410-a742-e7e81cd9613c
---
 roundcubemail/SQL/sqlite.update.sql | 41 ++++++++++++++++++++++++++++++++++++-
 1 file changed, 40 insertions(+), 1 deletion(-)

(limited to 'roundcubemail/SQL/sqlite.update.sql')

diff --git a/roundcubemail/SQL/sqlite.update.sql b/roundcubemail/SQL/sqlite.update.sql
index 41ab0200d..378072c03 100644
--- a/roundcubemail/SQL/sqlite.update.sql
+++ b/roundcubemail/SQL/sqlite.update.sql
@@ -223,11 +223,11 @@ INSERT INTO contacts (contact_id, user_id, changed, del, name, email, firstname,
 CREATE INDEX ix_contacts_user_id ON contacts(user_id, email);
 DROP TABLE contacts_tmp;
 
+
 DELETE FROM messages;
 DELETE FROM cache;
 CREATE INDEX ix_contactgroupmembers_contact_id ON contactgroupmembers (contact_id);
 
-
 -- Updates from version 0.6-stable
 
 CREATE TABLE dictionary (
@@ -247,3 +247,42 @@ CREATE TABLE searches (
 );
 
 CREATE UNIQUE INDEX ix_searches_user_type_name (user_id, type, name);
+
+DROP TABLE messages;
+
+CREATE TABLE cache_index (
+    user_id integer NOT NULL,
+    mailbox varchar(255) NOT NULL,
+    changed datetime NOT NULL default '0000-00-00 00:00:00',
+    data text NOT NULL,
+    PRIMARY KEY (user_id, mailbox)
+);
+
+CREATE INDEX ix_cache_index_changed ON cache_index (changed);
+
+CREATE TABLE cache_thread (
+    user_id integer NOT NULL,
+    mailbox varchar(255) NOT NULL,
+    changed datetime NOT NULL default '0000-00-00 00:00:00',
+    data text NOT NULL,
+    PRIMARY KEY (user_id, mailbox)
+);
+
+CREATE INDEX ix_cache_thread_changed ON cache_thread (changed);
+
+CREATE TABLE cache_messages (
+    user_id integer NOT NULL,
+    mailbox varchar(255) NOT NULL,
+    uid integer NOT NULL,
+    changed datetime NOT NULL default '0000-00-00 00:00:00',
+    data text NOT NULL,
+    seen smallint NOT NULL DEFAULT '0',
+    deleted smallint NOT NULL DEFAULT '0',
+    answered smallint NOT NULL DEFAULT '0',
+    forwarded smallint NOT NULL DEFAULT '0',
+    flagged smallint NOT NULL DEFAULT '0',
+    mdnsent smallint NOT NULL DEFAULT '0',
+    PRIMARY KEY (user_id, mailbox, uid)
+);
+
+CREATE INDEX ix_cache_messages_changed ON cache_messages (changed);
-- 
cgit v1.2.3

