Mercurial > hg > rc1
comparison SQL/sqlite/2011121400.sql @ 0:1e000243b222
vanilla 1.3.3 distro, I hope
author | Charlie Root |
---|---|
date | Thu, 04 Jan 2018 15:50:29 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:1e000243b222 |
---|---|
1 -- Updates from version 0.7 | |
2 | |
3 CREATE TABLE contacts_tmp ( | |
4 contact_id integer NOT NULL PRIMARY KEY, | |
5 user_id integer NOT NULL, | |
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 text NOT NULL default '', | |
10 firstname varchar(128) NOT NULL default '', | |
11 surname varchar(128) NOT NULL default '', | |
12 vcard text NOT NULL default '', | |
13 words text NOT NULL default '' | |
14 ); | |
15 | |
16 INSERT INTO contacts_tmp (contact_id, user_id, changed, del, name, email, firstname, surname, vcard, words) | |
17 SELECT contact_id, user_id, changed, del, name, email, firstname, surname, vcard, words FROM contacts; | |
18 | |
19 DROP TABLE contacts; | |
20 | |
21 CREATE TABLE contacts ( | |
22 contact_id integer NOT NULL PRIMARY KEY, | |
23 user_id integer NOT NULL, | |
24 changed datetime NOT NULL default '0000-00-00 00:00:00', | |
25 del tinyint NOT NULL default '0', | |
26 name varchar(128) NOT NULL default '', | |
27 email text NOT NULL default '', | |
28 firstname varchar(128) NOT NULL default '', | |
29 surname varchar(128) NOT NULL default '', | |
30 vcard text NOT NULL default '', | |
31 words text NOT NULL default '' | |
32 ); | |
33 | |
34 INSERT INTO contacts (contact_id, user_id, changed, del, name, email, firstname, surname, vcard, words) | |
35 SELECT contact_id, user_id, changed, del, name, email, firstname, surname, vcard, words FROM contacts_tmp; | |
36 | |
37 CREATE INDEX ix_contacts_user_id ON contacts(user_id, del); | |
38 DROP TABLE contacts_tmp; |