Mercurial > hg > rc2
comparison SQL/sqlite/2009103100.sql @ 0:4681f974d28b
vanilla 1.3.3 distro, I hope
author | Charlie Root |
---|---|
date | Thu, 04 Jan 2018 15:52:31 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4681f974d28b |
---|---|
1 -- Updates from version 0.3.1 | |
2 | |
3 -- ALTER TABLE identities ADD COLUMN changed datetime NOT NULL default '0000-00-00 00:00:00'; -- | |
4 | |
5 CREATE TABLE temp_identities ( | |
6 identity_id integer NOT NULL PRIMARY KEY, | |
7 user_id integer NOT NULL default '0', | |
8 standard tinyint NOT NULL default '0', | |
9 name varchar(128) NOT NULL default '', | |
10 organization varchar(128) default '', | |
11 email varchar(128) NOT NULL default '', | |
12 "reply-to" varchar(128) NOT NULL default '', | |
13 bcc varchar(128) NOT NULL default '', | |
14 signature text NOT NULL default '', | |
15 html_signature tinyint NOT NULL default '0' | |
16 ); | |
17 INSERT INTO temp_identities (identity_id, user_id, standard, name, organization, email, "reply-to", bcc, signature, html_signature) | |
18 SELECT identity_id, user_id, standard, name, organization, email, "reply-to", bcc, signature, html_signature | |
19 FROM identities WHERE del=0; | |
20 | |
21 DROP INDEX ix_identities_user_id; | |
22 DROP TABLE identities; | |
23 | |
24 CREATE TABLE identities ( | |
25 identity_id integer NOT NULL PRIMARY KEY, | |
26 user_id integer NOT NULL default '0', | |
27 changed datetime NOT NULL default '0000-00-00 00:00:00', | |
28 del tinyint NOT NULL default '0', | |
29 standard tinyint NOT NULL default '0', | |
30 name varchar(128) NOT NULL default '', | |
31 organization varchar(128) default '', | |
32 email varchar(128) NOT NULL default '', | |
33 "reply-to" varchar(128) NOT NULL default '', | |
34 bcc varchar(128) NOT NULL default '', | |
35 signature text NOT NULL default '', | |
36 html_signature tinyint NOT NULL default '0' | |
37 ); | |
38 CREATE INDEX ix_identities_user_id ON identities(user_id, del); | |
39 | |
40 INSERT INTO identities (identity_id, user_id, standard, name, organization, email, "reply-to", bcc, signature, html_signature) | |
41 SELECT identity_id, user_id, standard, name, organization, email, "reply-to", bcc, signature, html_signature | |
42 FROM temp_identities; | |
43 | |
44 DROP TABLE temp_identities; | |
45 | |
46 CREATE TABLE contactgroups ( | |
47 contactgroup_id integer NOT NULL PRIMARY KEY, | |
48 user_id integer NOT NULL default '0', | |
49 changed datetime NOT NULL default '0000-00-00 00:00:00', | |
50 del tinyint NOT NULL default '0', | |
51 name varchar(128) NOT NULL default '' | |
52 ); | |
53 | |
54 CREATE INDEX ix_contactgroups_user_id ON contactgroups(user_id, del); | |
55 | |
56 CREATE TABLE contactgroupmembers ( | |
57 contactgroup_id integer NOT NULL, | |
58 contact_id integer NOT NULL default '0', | |
59 created datetime NOT NULL default '0000-00-00 00:00:00', | |
60 PRIMARY KEY (contactgroup_id, contact_id) | |
61 ); |