summaryrefslogtreecommitdiff
path: root/SQL/sqlite/2011121400.sql
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-01-17 08:39:39 +0100
committerAleksander Machniak <alec@alec.pl>2013-01-17 08:39:39 +0100
commitf5c7df4c324d3157ab47469f492ecdb2a4b82e93 (patch)
tree2137040407617eb0891aba2ac0908a2bb9e9e5fb /SQL/sqlite/2011121400.sql
parenta03c28a22f194c3cbaee46abd8def0d7b8fa7e60 (diff)
parentc101871d463963fe5426a2db3ba39cb524a96dbd (diff)
Merge branch 'schema_upgrades' into release-0.9
Diffstat (limited to 'SQL/sqlite/2011121400.sql')
-rw-r--r--SQL/sqlite/2011121400.sql38
1 files changed, 38 insertions, 0 deletions
diff --git a/SQL/sqlite/2011121400.sql b/SQL/sqlite/2011121400.sql
new file mode 100644
index 000000000..9d9227673
--- /dev/null
+++ b/SQL/sqlite/2011121400.sql
@@ -0,0 +1,38 @@
+-- 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;