0
|
1 -- Updates from version 0.5.x
|
|
2
|
|
3 CREATE TABLE contacts_tmp (
|
|
4 contact_id integer NOT NULL PRIMARY KEY,
|
|
5 user_id integer NOT NULL default '0',
|
|
6 changed datetime NOT NULL default '0000-00-00 00:00:00',
|
|
7 del tinyint NOT NULL default '0',
|
|
8 name varchar(128) NOT NULL default '',
|
|
9 email varchar(255) NOT NULL default '',
|
|
10 firstname varchar(128) NOT NULL default '',
|
|
11 surname varchar(128) NOT NULL default '',
|
|
12 vcard text NOT NULL default ''
|
|
13 );
|
|
14
|
|
15 INSERT INTO contacts_tmp (contact_id, user_id, changed, del, name, email, firstname, surname, vcard)
|
|
16 SELECT contact_id, user_id, changed, del, name, email, firstname, surname, vcard FROM contacts;
|
|
17
|
|
18 DROP TABLE contacts;
|
|
19 CREATE TABLE contacts (
|
|
20 contact_id integer NOT NULL PRIMARY KEY,
|
|
21 user_id integer NOT NULL default '0',
|
|
22 changed datetime NOT NULL default '0000-00-00 00:00:00',
|
|
23 del tinyint NOT NULL default '0',
|
|
24 name varchar(128) NOT NULL default '',
|
|
25 email varchar(255) NOT NULL default '',
|
|
26 firstname varchar(128) NOT NULL default '',
|
|
27 surname varchar(128) NOT NULL default '',
|
|
28 vcard text NOT NULL default '',
|
|
29 words text NOT NULL default ''
|
|
30 );
|
|
31
|
|
32 INSERT INTO contacts (contact_id, user_id, changed, del, name, email, firstname, surname, vcard)
|
|
33 SELECT contact_id, user_id, changed, del, name, email, firstname, surname, vcard FROM contacts_tmp;
|
|
34
|
|
35 CREATE INDEX ix_contacts_user_id ON contacts(user_id, email);
|
|
36 DROP TABLE contacts_tmp;
|
|
37
|
|
38
|
|
39 DELETE FROM messages;
|
|
40 DELETE FROM cache;
|
|
41 CREATE INDEX ix_contactgroupmembers_contact_id ON contactgroupmembers (contact_id);
|