USE EnVisage

BEGIN TRAN
	if exists (select 1 from sys.indexes where name='DF_AspNetUsers_Unique_Email')
	begin
		drop index DF_AspNetUsers_Unique_Email on AspNetUsers
	end

	CREATE UNIQUE NONCLUSTERED INDEX DF_AspNetUsers_Unique_Email
	ON AspNetUsers(Email)
	WHERE Email IS NOT NULL
COMMIT TRAN