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