From 565c472918e7f9707cd8d7909ad5dbcc5a921fdf Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Mon, 6 Aug 2012 11:08:58 +0200
Subject: Removed users.alias column, added option ('user_aliases') to use
 email address from identities as username (#1488581)

---
 SQL/mssql.initial.sql | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

(limited to 'SQL/mssql.initial.sql')

diff --git a/SQL/mssql.initial.sql b/SQL/mssql.initial.sql
index 9aa6e6321..85b8e4ef6 100644
--- a/SQL/mssql.initial.sql
+++ b/SQL/mssql.initial.sql
@@ -92,7 +92,6 @@ CREATE TABLE [dbo].[users] (
 	[user_id] [int] IDENTITY (1, 1) NOT NULL ,
 	[username] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
 	[mail_host] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
-	[alias] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
 	[created] [datetime] NOT NULL ,
 	[last_login] [datetime] NULL ,
 	[language] [varchar] (5) COLLATE Latin1_General_CI_AI NULL ,
@@ -274,6 +273,8 @@ GO
 
 CREATE  INDEX [IX_identities_user_id] ON [dbo].[identities]([user_id]) ON [PRIMARY]
 GO
+CREATE  INDEX [IX_identities_email] ON [dbo].[identities]([email],[del]) ON [PRIMARY]
+GO
 
 ALTER TABLE [dbo].[session] ADD 
 	CONSTRAINT [DF_session_sess_id] DEFAULT ('') FOR [sess_id],
@@ -287,16 +288,12 @@ GO
 ALTER TABLE [dbo].[users] ADD 
 	CONSTRAINT [DF_users_username] DEFAULT ('') FOR [username],
 	CONSTRAINT [DF_users_mail_host] DEFAULT ('') FOR [mail_host],
-	CONSTRAINT [DF_users_alias] DEFAULT ('') FOR [alias],
 	CONSTRAINT [DF_users_created] DEFAULT (getdate()) FOR [created]
 GO
 
 CREATE  UNIQUE INDEX [IX_users_username] ON [dbo].[users]([username],[mail_host]) ON [PRIMARY]
 GO
 
-CREATE  INDEX [IX_users_alias] ON [dbo].[users]([alias]) ON [PRIMARY]
-GO
-
 CREATE  UNIQUE INDEX [IX_dictionary_user_language] ON [dbo].[dictionary]([user_id],[language]) ON [PRIMARY]
 GO
 
-- 
cgit v1.2.3

