From ad334a12579f21e4e04a47e257b9d0ac71d50b98 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Wed, 13 Oct 2010 14:44:41 -0400
Subject: [PATCH] - Improve displaying of UI messages (#1486977)

---
 SQL/sqlite.initial.sql |   44 +++++++++++++++++++++++++++++++-------------
 1 files changed, 31 insertions(+), 13 deletions(-)

diff --git a/SQL/sqlite.initial.sql b/SQL/sqlite.initial.sql
index d09539d..ea7650c 100644
--- a/SQL/sqlite.initial.sql
+++ b/SQL/sqlite.initial.sql
@@ -1,8 +1,4 @@
--- RoundCube Webmail initial database structure
--- Version 0.1
--- 
-
--- --------------------------------------------------------
+-- Roundcube Webmail initial database structure
 
 -- 
 -- Table structure for table `cache`
@@ -11,19 +7,19 @@
 CREATE TABLE cache (
   cache_id integer NOT NULL PRIMARY KEY,
   user_id integer NOT NULL default 0,
-  session_id varchar(40) default NULL,
   cache_key varchar(128) NOT NULL default '',
   created datetime NOT NULL default '0000-00-00 00:00:00',
   data longtext NOT NULL
 );
 
 CREATE INDEX ix_cache_user_cache_key ON cache(user_id, cache_key);
+CREATE INDEX ix_cache_created ON cache(created);
 
 
 -- --------------------------------------------------------
 
 -- 
--- Table structure for table contacts
+-- Table structure for table contacts and related
 -- 
 
 CREATE TABLE contacts (
@@ -38,7 +34,27 @@
   vcard text NOT NULL default ''
 );
 
-CREATE INDEX ix_contacts_user_id ON contacts(user_id);
+CREATE INDEX ix_contacts_user_id ON contacts(user_id, email);
+
+
+CREATE TABLE contactgroups (
+  contactgroup_id integer NOT NULL PRIMARY KEY,
+  user_id integer NOT NULL default '0',
+  changed datetime NOT NULL default '0000-00-00 00:00:00',
+  del tinyint NOT NULL default '0',
+  name varchar(128) NOT NULL default ''
+);
+
+CREATE INDEX ix_contactgroups_user_id ON contactgroups(user_id, del);
+
+
+CREATE TABLE contactgroupmembers (
+  contactgroup_id integer NOT NULL,
+  contact_id integer NOT NULL default '0',
+  created datetime NOT NULL default '0000-00-00 00:00:00',
+  PRIMARY KEY (contactgroup_id, contact_id)
+);
+
 
 -- --------------------------------------------------------
 
@@ -49,6 +65,7 @@
 CREATE TABLE identities (
   identity_id integer NOT NULL PRIMARY KEY,
   user_id integer NOT NULL default '0',
+  changed datetime NOT NULL default '0000-00-00 00:00:00',
   del tinyint NOT NULL default '0',
   standard tinyint NOT NULL default '0',
   name varchar(128) NOT NULL default '',
@@ -60,7 +77,7 @@
   html_signature tinyint NOT NULL default '0'
 );
 
-CREATE INDEX ix_identities_user_id ON identities(user_id);
+CREATE INDEX ix_identities_user_id ON identities(user_id, del);
 
 
 -- --------------------------------------------------------
@@ -75,12 +92,12 @@
   mail_host varchar(128) NOT NULL default '',
   alias varchar(128) NOT NULL default '',
   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',
+  last_login datetime DEFAULT NULL,
+  language varchar(5),
   preferences text NOT NULL default ''
 );
 
-CREATE INDEX ix_users_username ON users(username);
+CREATE UNIQUE INDEX ix_users_username ON users(username, mail_host);
 CREATE INDEX ix_users_alias ON users(alias);
 
 -- --------------------------------------------------------
@@ -123,5 +140,6 @@
   structure text
 );
 
-CREATE INDEX ix_messages_user_cache_uid ON messages(user_id,cache_key,uid);
+CREATE UNIQUE INDEX ix_messages_user_cache_uid ON messages (user_id,cache_key,uid);
+CREATE INDEX ix_messages_index ON messages (user_id,cache_key,idx);
 CREATE INDEX ix_messages_created ON messages (created);

--
Gitblit v1.9.1