From 502436dad02293899fb41a8bd9179f1449236136 Mon Sep 17 00:00:00 2001 From: thomascube <thomas@roundcube.net> Date: Thu, 29 Sep 2011 03:00:34 -0400 Subject: [PATCH] We're on the road towards 0.7 now --- SQL/postgres.update.sql | 41 ++++++++++++++++++++++++++++++++++++++++- 1 files changed, 40 insertions(+), 1 deletions(-) diff --git a/SQL/postgres.update.sql b/SQL/postgres.update.sql index e316ff5..2935cd4 100644 --- a/SQL/postgres.update.sql +++ b/SQL/postgres.update.sql @@ -101,7 +101,7 @@ TRUNCATE messages; TRUNCATE cache; --- Updates from version 0.6-stable +-- Updates from version 0.6 CREATE TABLE dictionary ( user_id integer DEFAULT NULL @@ -126,3 +126,42 @@ data text NOT NULL, CONSTRAINT searches_user_id_key UNIQUE (user_id, "type", name) ); + +DROP SEQUENCE messages_ids; +DROP TABLE messages; + +CREATE TABLE cache_index ( + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + mailbox varchar(255) NOT NULL, + changed timestamp with time zone DEFAULT now() NOT NULL, + valid smallint NOT NULL DEFAULT 0, + data text NOT NULL, + PRIMARY KEY (user_id, mailbox) +); + +CREATE INDEX cache_index_changed_idx ON cache_index (changed); + +CREATE TABLE cache_thread ( + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + mailbox varchar(255) NOT NULL, + changed timestamp with time zone DEFAULT now() NOT NULL, + data text NOT NULL, + PRIMARY KEY (user_id, mailbox) +); + +CREATE INDEX cache_thread_changed_idx ON cache_thread (changed); + +CREATE TABLE cache_messages ( + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + mailbox varchar(255) NOT NULL, + uid integer NOT NULL, + changed timestamp with time zone DEFAULT now() NOT NULL, + data text NOT NULL, + flags integer NOT NULL DEFAULT 0, + PRIMARY KEY (user_id, mailbox, uid) +); + +CREATE INDEX cache_messages_changed_idx ON cache_messages (changed); -- Gitblit v1.9.1