From ace511a771656c983046919333cee501339c98a1 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Wed, 6 Oct 2010 13:00:12 +0000
Subject: - Add unique index on users.username+users.mail_host

---
 SQL/postgres.update.sql | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

(limited to 'SQL/postgres.update.sql')

diff --git a/SQL/postgres.update.sql b/SQL/postgres.update.sql
index 1ef93d8b6..99b9c0e29 100644
--- a/SQL/postgres.update.sql
+++ b/SQL/postgres.update.sql
@@ -56,7 +56,7 @@ CREATE SEQUENCE contactgroups_ids
     NO MAXVALUE
     NO MINVALUE
     CACHE 1;
-		
+
 CREATE TABLE contactgroups (
     contactgroup_id integer DEFAULT nextval('contactgroups_ids'::text) PRIMARY KEY,
     user_id 	integer		NOT NULL
@@ -81,3 +81,9 @@ CREATE TABLE contactgroupmembers (
 
 ALTER TABLE users ALTER last_login DROP NOT NULL;
 ALTER TABLE users ALTER last_login SET DEFAULT NULL;
+
+-- Updates from version 0.4.2
+
+DROP INDEX users_username_id_idx;
+ALTER TABLE users ADD UNIQUE (username, mail_host);
+
-- 
cgit v1.2.3

