summaryrefslogtreecommitdiff
path: root/SQL
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2009-12-11 07:18:19 +0000
committeralecpl <alec@alec.pl>2009-12-11 07:18:19 +0000
commitf47e2dc5ea51853ade73565261db43f36ceeee92 (patch)
tree236c23dfc6472aefd512315fda4b9384710979d5 /SQL
parent3f5cce66851ff1be5d5d14f30f929c6511dcd9e3 (diff)
- move TRUNCATE before CREATE INDEX (#1486362)
Diffstat (limited to 'SQL')
-rw-r--r--SQL/mysql.update.sql4
-rw-r--r--SQL/postgres.update.sql2
-rw-r--r--SQL/sqlite.update.sql2
3 files changed, 4 insertions, 4 deletions
diff --git a/SQL/mysql.update.sql b/SQL/mysql.update.sql
index 77bf317e9..17301ab05 100644
--- a/SQL/mysql.update.sql
+++ b/SQL/mysql.update.sql
@@ -47,11 +47,11 @@ ALTER TABLE `users`
-- Updates from version 0.3-stable
+TRUNCATE `messages`;
+
ALTER TABLE `messages`
ADD INDEX `index_index` (`user_id`, `cache_key`, `idx`);
-TRUNCATE `messages`;
-
ALTER TABLE `session`
CHANGE `vars` `vars` MEDIUMTEXT NOT NULL;
diff --git a/SQL/postgres.update.sql b/SQL/postgres.update.sql
index e343dd440..cb83f511b 100644
--- a/SQL/postgres.update.sql
+++ b/SQL/postgres.update.sql
@@ -39,7 +39,7 @@ ALTER TABLE messages ALTER del TYPE smallint;
-- Updates from version 0.3-stable
-CREATE INDEX messages_index_idx ON messages (user_id, cache_key, idx);
TRUNCATE messages;
+CREATE INDEX messages_index_idx ON messages (user_id, cache_key, idx);
DROP INDEX contacts_user_id_idx;
CREATE INDEX contacts_user_id_idx ON contacts (user_id, email);
diff --git a/SQL/sqlite.update.sql b/SQL/sqlite.update.sql
index 09af76fae..a3d587326 100644
--- a/SQL/sqlite.update.sql
+++ b/SQL/sqlite.update.sql
@@ -37,9 +37,9 @@ CREATE INDEX ix_cache_created ON cache (created);
-- Updates from version 0.3-stable
+TRUNCATE messages;
DROP INDEX ix_messages_user_cache_uid;
CREATE UNIQUE INDEX ix_messages_user_cache_uid ON messages (user_id,cache_key,uid);
CREATE INDEX ix_messages_index ON messages (user_id,cache_key,idx);
-TRUNCATE messages;
DROP INDEX ix_contacts_user_id;
CREATE INDEX ix_contacts_user_id ON contacts(user_id, email);