From d9f109b56af2015eae7aadc5e87c06365854eda0 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak <alec@alec.pl> Date: Tue, 11 Dec 2012 02:30:49 -0500 Subject: [PATCH] Allow forwarding of multiple emails (#1486854) --- SQL/sqlite.update.sql | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 100 insertions(+), 8 deletions(-) diff --git a/SQL/sqlite.update.sql b/SQL/sqlite.update.sql index 378072c..72a29e9 100644 --- a/SQL/sqlite.update.sql +++ b/SQL/sqlite.update.sql @@ -228,7 +228,7 @@ DELETE FROM cache; CREATE INDEX ix_contactgroupmembers_contact_id ON contactgroupmembers (contact_id); --- Updates from version 0.6-stable +-- Updates from version 0.6 CREATE TABLE dictionary ( user_id integer DEFAULT NULL, @@ -246,7 +246,7 @@ data text NOT NULL ); -CREATE UNIQUE INDEX ix_searches_user_type_name (user_id, type, name); +CREATE UNIQUE INDEX ix_searches_user_type_name ON searches (user_id, type, name); DROP TABLE messages; @@ -254,6 +254,7 @@ user_id integer NOT NULL, mailbox varchar(255) NOT NULL, changed datetime NOT NULL default '0000-00-00 00:00:00', + valid smallint NOT NULL DEFAULT '0', data text NOT NULL, PRIMARY KEY (user_id, mailbox) ); @@ -276,13 +277,104 @@ 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', + flags integer NOT NULL DEFAULT '0', PRIMARY KEY (user_id, mailbox, uid) ); CREATE INDEX ix_cache_messages_changed ON cache_messages (changed); + +-- Updates from version 0.7-beta + +DROP TABLE session; +CREATE TABLE session ( + sess_id varchar(128) NOT NULL PRIMARY KEY, + created datetime NOT NULL default '0000-00-00 00:00:00', + changed datetime NOT NULL default '0000-00-00 00:00:00', + ip varchar(40) NOT NULL default '', + vars text NOT NULL +); +CREATE INDEX ix_session_changed ON session (changed); + +-- Updates from version 0.7 + +CREATE TABLE contacts_tmp ( + contact_id integer NOT NULL PRIMARY KEY, + user_id integer NOT NULL, + changed datetime NOT NULL default '0000-00-00 00:00:00', + del tinyint NOT NULL default '0', + name varchar(128) NOT NULL default '', + email text NOT NULL default '', + firstname varchar(128) NOT NULL default '', + surname varchar(128) NOT NULL default '', + vcard text NOT NULL default '', + words text NOT NULL default '' +); + +INSERT INTO contacts_tmp (contact_id, user_id, changed, del, name, email, firstname, surname, vcard, words) + SELECT contact_id, user_id, changed, del, name, email, firstname, surname, vcard, words FROM contacts; + +DROP TABLE contacts; + +CREATE TABLE contacts ( + contact_id integer NOT NULL PRIMARY KEY, + user_id integer NOT NULL, + changed datetime NOT NULL default '0000-00-00 00:00:00', + del tinyint NOT NULL default '0', + name varchar(128) NOT NULL default '', + email text NOT NULL default '', + firstname varchar(128) NOT NULL default '', + surname varchar(128) NOT NULL default '', + vcard text NOT NULL default '', + words text NOT NULL default '' +); + +INSERT INTO contacts (contact_id, user_id, changed, del, name, email, firstname, surname, vcard, words) + SELECT contact_id, user_id, changed, del, name, email, firstname, surname, vcard, words FROM contacts_tmp; + +CREATE INDEX ix_contacts_user_id ON contacts(user_id, del); +DROP TABLE contacts_tmp; + +-- Updates from version 0.8 + +DROP TABLE cache; +CREATE TABLE cache ( + user_id integer NOT NULL default 0, + cache_key varchar(128) NOT NULL default '', + created datetime NOT NULL default '0000-00-00 00:00:00', + data text NOT NULL +); + +CREATE INDEX ix_cache_user_cache_key ON cache(user_id, cache_key); +CREATE INDEX ix_cache_created ON cache(created); + +CREATE TABLE tmp_users ( + user_id integer NOT NULL PRIMARY KEY, + username varchar(128) NOT NULL default '', + mail_host varchar(128) NOT NULL default '', + created datetime NOT NULL default '0000-00-00 00:00:00', + last_login datetime DEFAULT NULL, + language varchar(5), + preferences text NOT NULL default '' +); + +INSERT INTO tmp_users (user_id, username, mail_host, created, last_login, language, preferences) + SELECT user_id, username, mail_host, created, last_login, language, preferences FROM users; + +DROP TABLE users; + +CREATE TABLE users ( + user_id integer NOT NULL PRIMARY KEY, + username varchar(128) NOT NULL default '', + mail_host varchar(128) NOT NULL default '', + created datetime NOT NULL default '0000-00-00 00:00:00', + last_login datetime DEFAULT NULL, + language varchar(5), + preferences text NOT NULL default '' +); + +INSERT INTO users (user_id, username, mail_host, created, last_login, language, preferences) + SELECT user_id, username, mail_host, created, last_login, language, preferences FROM tmp_users; + +CREATE UNIQUE INDEX ix_users_username ON users(username, mail_host); + +CREATE INDEX ix_identities_email ON identities(email, del); -- Gitblit v1.9.1