title: Multiple UniqueKeys in Fluent NHibernate
body: <p>I've got a scenario where I need to define two multicolumn unique constraints like so:</p>
  
  <pre><code>public class UserMap : IAutoMappingOverride&lt;User&gt;
  {
      public void Override(AutoMapping&lt;User&gt; mapping)
      {
          mapping.Map(x =&gt; x.UserName)
                 .UniqueKey("UQ_User_UserName_Client");
          mapping.Map(x =&gt; x.LoweredEmail)
                 .UniqueKey("UQ_User_Email_Client");
          mapping.References(x =&gt; x.Client)
                 .UniqueKey("UQ_User_UserName_Client")
                 .UniqueKey("UQ_User_Email_Client");
      }
  }
  </code></pre>
  
  <p>The reason for this is I need both the UserName and the Email to be unique for each client.  The resulting SQL looks like this:</p>
  
  <pre><code>create table Users (
     Id UNIQUEIDENTIFIER not null,
     UserName NVARCHAR(256) not null,
     LoweredEmail NVARCHAR(256) not null,
     Email NVARCHAR(256) not null,
     ClientId UNIQUEIDENTIFIER null,
     primary key (Id),
     unique (UserName),
     unique (LoweredEmail, ClientId)
  )
  </code></pre>
  
  <p>Which is not the desired effect.  How do I get the following SQL to be created?</p>
  
  <pre><code>create table Users (
     Id UNIQUEIDENTIFIER not null,
     UserName NVARCHAR(256) not null,
     LoweredEmail NVARCHAR(256) not null,
     Email NVARCHAR(256) not null,
     ClientId UNIQUEIDENTIFIER null,
     primary key (Id),
     unique (UserName, ClientId),
     unique (LoweredEmail, ClientId)
  )
  </code></pre>
  
  <p>I'm not sure if this is an issue/limitation with Fluent or NHibernate.  Any help would be appreciated.</p>