summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2007-03-18 17:11:43 +0000
committerthomascube <thomas@roundcube.net>2007-03-18 17:11:43 +0000
commit43a42dcf405c1667f0f39150ffaa8bbda7d9d1a0 (patch)
tree0b9a855683c47e3b27da1e2634ea496a5ee7df20
parent87b280e94be4d4389ef660ab60d0484361599d35 (diff)
Use user_id for unique key in messages table (closes #1484074)
-rw-r--r--SQL/mysql.initial.sql2
-rw-r--r--SQL/mysql.update.sql2
-rw-r--r--SQL/mysql5.initial.sql2
-rwxr-xr-xSQL/postgres.initial.sql2
-rw-r--r--SQL/postgres.update.sql2
5 files changed, 5 insertions, 5 deletions
diff --git a/SQL/mysql.initial.sql b/SQL/mysql.initial.sql
index f49fd7084..c97b9d79e 100644
--- a/SQL/mysql.initial.sql
+++ b/SQL/mysql.initial.sql
@@ -122,7 +122,7 @@ CREATE TABLE `messages` (
KEY `user_id` (`user_id`),
KEY `idx` (`idx`),
KEY `uid` (`uid`),
- UNIQUE `uniqueness` (`cache_key`, `uid`)
+ UNIQUE `uniqueness` (`user_id`, `cache_key`, `uid`)
);
diff --git a/SQL/mysql.update.sql b/SQL/mysql.update.sql
index 308083279..ef5f07d83 100644
--- a/SQL/mysql.update.sql
+++ b/SQL/mysql.update.sql
@@ -5,7 +5,7 @@ ALTER TABLE `messages`
DROP `body`,
DROP INDEX `cache_key`,
ADD `structure` TEXT,
- ADD UNIQUE `uniqueness` (`cache_key`, `uid`);
+ ADD UNIQUE `uniqueness` (`user_id`, `cache_key`, `uid`);
ALTER TABLE `identities`
ADD `html_signature` tinyint(1) default 0 NOT NULL;
diff --git a/SQL/mysql5.initial.sql b/SQL/mysql5.initial.sql
index ee6fc3352..ae155e1d0 100644
--- a/SQL/mysql5.initial.sql
+++ b/SQL/mysql5.initial.sql
@@ -55,7 +55,7 @@ CREATE TABLE `messages` (
PRIMARY KEY(`message_id`),
INDEX `idx`(`idx`),
INDEX `uid`(`uid`),
- UNIQUE `uniqueness` (`cache_key`, `uid`),
+ UNIQUE `uniqueness` (`user_id`, `cache_key`, `uid`),
CONSTRAINT `User_ID_FK_messages` FOREIGN KEY (`user_id`)
REFERENCES `users`(`user_id`)
ON DELETE CASCADE
diff --git a/SQL/postgres.initial.sql b/SQL/postgres.initial.sql
index ebd504d0d..bf82b9b5d 100755
--- a/SQL/postgres.initial.sql
+++ b/SQL/postgres.initial.sql
@@ -167,4 +167,4 @@ CREATE TABLE "messages" (
structure text
);
-ALTER TABLE "messages" ADD UNIQUE (cache_key, uid);
+ALTER TABLE "messages" ADD UNIQUE (user_id, cache_key, uid);
diff --git a/SQL/postgres.update.sql b/SQL/postgres.update.sql
index 2ad60298f..8f7054820 100644
--- a/SQL/postgres.update.sql
+++ b/SQL/postgres.update.sql
@@ -3,7 +3,7 @@
ALTER TABLE "messages" DROP body;
ALTER TABLE "messages" ADD structure TEXT;
-ALTER TABLE "messages" ADD UNIQUE (cache_key, uid);
+ALTER TABLE "messages" ADD UNIQUE (user_id, cache_key, uid);
ALTER TABLE "identities" ADD html_signature integer DEFAULT 0 NOT NULL;