Changeset 80152b33 in github for SQL/sqlite.initial.sql


Ignore:
Timestamp:
Sep 7, 2011 7:07:03 AM (21 months ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.7, release-0.8
Children:
e730cd2
Parents:
b104e39
Message:
  • 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
File:
1 edited

Legend:

Unmodified
Added
Removed
  • SQL/sqlite.initial.sql

    rf8e48df r80152b33  
    22 
    33--  
    4 -- Table structure for table `cache` 
     4-- Table structure for table cache 
    55--  
    66 
     
    1010  cache_key varchar(128) NOT NULL default '', 
    1111  created datetime NOT NULL default '0000-00-00 00:00:00', 
    12   data longtext NOT NULL 
     12  data text NOT NULL 
    1313); 
    1414 
     
    122122-- -------------------------------------------------------- 
    123123 
    124 --  
    125 -- Table structure for table messages 
    126 --  
    127  
    128 CREATE TABLE messages ( 
    129   message_id integer NOT NULL PRIMARY KEY, 
    130   user_id integer NOT NULL default '0', 
    131   del tinyint NOT NULL default '0', 
    132   cache_key varchar(128) NOT NULL default '', 
    133   created datetime NOT NULL default '0000-00-00 00:00:00', 
    134   idx integer NOT NULL default '0', 
    135   uid integer NOT NULL default '0', 
    136   subject varchar(255) NOT NULL default '', 
    137   "from" varchar(255) NOT NULL default '', 
    138   "to" varchar(255) NOT NULL default '', 
    139   "cc" varchar(255) NOT NULL default '', 
    140   "date" datetime NOT NULL default '0000-00-00 00:00:00', 
    141   size integer NOT NULL default '0', 
    142   headers text NOT NULL, 
    143   structure text 
    144 ); 
    145  
    146 CREATE UNIQUE INDEX ix_messages_user_cache_uid ON messages (user_id,cache_key,uid); 
    147 CREATE INDEX ix_messages_index ON messages (user_id,cache_key,idx); 
    148 CREATE INDEX ix_messages_created ON messages (created); 
    149  
    150 -- -------------------------------------------------------- 
    151  
    152124-- 
    153125-- Table structure for table dictionary 
     
    177149 
    178150CREATE UNIQUE INDEX ix_searches_user_type_name (user_id, type, name); 
     151 
     152-- -------------------------------------------------------- 
     153 
     154-- 
     155-- Table structure for table cache_index 
     156-- 
     157 
     158CREATE TABLE cache_index ( 
     159    user_id integer NOT NULL, 
     160    mailbox varchar(255) NOT NULL, 
     161    changed datetime NOT NULL default '0000-00-00 00:00:00', 
     162    data text NOT NULL, 
     163    PRIMARY KEY (user_id, mailbox) 
     164); 
     165 
     166CREATE INDEX ix_cache_index_changed ON cache_index (changed); 
     167 
     168-- -------------------------------------------------------- 
     169 
     170-- 
     171-- Table structure for table cache_thread 
     172-- 
     173 
     174CREATE TABLE cache_thread ( 
     175    user_id integer NOT NULL, 
     176    mailbox varchar(255) NOT NULL, 
     177    changed datetime NOT NULL default '0000-00-00 00:00:00', 
     178    data text NOT NULL, 
     179    PRIMARY KEY (user_id, mailbox) 
     180); 
     181 
     182CREATE INDEX ix_cache_thread_changed ON cache_thread (changed); 
     183 
     184-- -------------------------------------------------------- 
     185 
     186-- 
     187-- Table structure for table cache_messages 
     188-- 
     189 
     190CREATE TABLE cache_messages ( 
     191    user_id integer NOT NULL, 
     192    mailbox varchar(255) NOT NULL, 
     193    uid integer NOT NULL, 
     194    changed datetime NOT NULL default '0000-00-00 00:00:00', 
     195    data text NOT NULL, 
     196    seen smallint NOT NULL DEFAULT '0', 
     197    deleted smallint NOT NULL DEFAULT '0', 
     198    answered smallint NOT NULL DEFAULT '0', 
     199    forwarded smallint NOT NULL DEFAULT '0', 
     200    flagged smallint NOT NULL DEFAULT '0', 
     201    mdnsent smallint NOT NULL DEFAULT '0', 
     202    PRIMARY KEY (user_id, mailbox, uid) 
     203); 
     204 
     205CREATE INDEX ix_cache_messages_changed ON cache_messages (changed); 
Note: See TracChangeset for help on using the changeset viewer.