Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

- Force names of unique constraints in PostgreSQL DDL (postgres 9.x u…

…ses different naming convention than older versions)
  • Loading branch information...
commit 8381ec1254f816bea2a5e85acb0a54722d327a60 1 parent 32c8ba6
Aleksander Machniak authored March 10, 2011
1  CHANGELOG
... ...
@@ -1,6 +1,7 @@
1 1
 CHANGELOG Roundcube Webmail
2 2
 ===========================
3 3
 
  4
+- Force names of unique constraints in PostgreSQL DDL
4 5
 - Add code for prevention from IMAP connection hangs when server closes socket unexpectedly
5 6
 - Remove redundant DELETE query (for old session deletion) on login
6 7
 - Get around unreliable rand() and mt_rand() in session ID generation (#1486281)
4  SQL/postgres.initial.sql
@@ -25,7 +25,7 @@ CREATE TABLE users (
25 25
     last_login timestamp with time zone DEFAULT NULL,
26 26
     "language" varchar(5),
27 27
     preferences text DEFAULT ''::text NOT NULL,
28  
-    UNIQUE (username, mail_host)
  28
+    CONSTRAINT users_username_key UNIQUE (username, mail_host)
29 29
 );
30 30
 
31 31
 CREATE INDEX users_alias_id_idx ON users (alias);
@@ -220,7 +220,7 @@ CREATE TABLE messages (
220 220
     size integer DEFAULT 0 NOT NULL,
221 221
     headers text NOT NULL,
222 222
     structure text,
223  
-    UNIQUE (user_id, cache_key, uid)
  223
+    CONSTRAINT messages_user_id_key UNIQUE (user_id, cache_key, uid)
224 224
 );
225 225
 
226 226
 CREATE INDEX messages_index_idx ON messages (user_id, cache_key, idx);
2  SQL/postgres.update.sql
@@ -85,7 +85,7 @@ ALTER TABLE users ALTER last_login SET DEFAULT NULL;
85 85
 -- Updates from version 0.4.2
86 86
 
87 87
 DROP INDEX users_username_id_idx;
88  
-ALTER TABLE users ADD UNIQUE (username, mail_host);
  88
+ALTER TABLE users ADD CONSTRAINT users_username_key UNIQUE (username, mail_host);
89 89
 ALTER TABLE contacts ALTER email TYPE varchar(255);
90 90
 
91 91
 TRUNCATE messages;

0 notes on commit 8381ec1

Please sign in to comment.
Something went wrong with that request. Please try again.