X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=SQL%2Fsqlite.update.sql;h=9f410fb130d0ddd85a47a6b24d0f2e4106a9e460;hb=c200780b40207e371544dc2eaeca3f0022411ddf;hp=92f6da1423ac033cf97b4699af249ef6f7abc823;hpb=9d358bb749203c1c4cb278a01e51f79754aa643a;p=roundcube.git diff --git a/SQL/sqlite.update.sql b/SQL/sqlite.update.sql index 92f6da1..9f410fb 100644 --- a/SQL/sqlite.update.sql +++ b/SQL/sqlite.update.sql @@ -246,7 +246,7 @@ CREATE TABLE searches ( 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; @@ -293,5 +293,43 @@ CREATE TABLE session ( 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;