title: MVC Code-First Migration
body: <p>I need to <strong>create table Drivers with multiple unique index</strong>,
  why I'm see this message and, how I can solve this? plz help me.</p>
  
  <p>Problem is I cant do update-database on migrations</p>
  
  <p>Message Error is :</p>
  
  <blockquote>
    <p>Column 'Phone' in table 'dbo.Drivers' is of a type that is invalid for
    use as a key column in an index</p>
  </blockquote>
  
  <pre><code>public class Driver
      {
          public int DriverID { get; set; }
          [Required]
          public int Code { get; set; }
          [Required]
          public string Name { get; set; }
          [Required]
          [Index("PhoneAndIdentAndDLExpAndVRNo", Order =1)]
          public string Phone { get; set; }
          public string Email { get; set; }
  
          [Required]
          public DateTime DOB { get; set; }
          public int Gender { get; set; }
          [Required]
          public string Address { get; set; }
          [Required]
          [Index("PhoneAndIdentAndDLExpAndVRNo", Order = 2)]
          public string Ident { get; set; }
          [Index("PhoneAndIdentAndDLExpAndVRNo", Order = 3)]
          public string DLNo { get; set; }
          [Required]
          public DateTime DLExp { get; set; }
          [Index("PhoneAndIdentAndDLExpAndVRNo", Order = 4)]
          public string VRNo { get; set; }
          [Required]
          public DateTime VRExp { get; set; }
  
          public string CarType { get; set; }
          public string CarColor { get; set; }
          public string CarModel { get; set; }
  
          public bool IsActive { get; set; }
          public bool IsOnline { get; set; }
          public string TokenID { get; set; }
          [Required]
          public string Pwd { get; set; }
  
      }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/UeCYC.png" rel="nofollow noreferrer">Image Error</a></p>