title: How can I change the table names when using ASP.NET Identity?
body: <p>I am using the release version (RTM, not RC) of Visual Studio 2013 (downloaded from MSDN 2013-10-18) and therefore the latest (RTM) version of AspNet.Identity. When I create a new web project, I select "Individual User Accounts" for authentication. This creates the following tables:</p>
  
  <ol>
  <li>AspNetRoles</li>
  <li>AspNetUserClaims</li>
  <li>AspNetUserLogins</li>
  <li>AspNetUserRoles</li>
  <li>AspNetUsers</li>
  </ol>
  
  <p>When I register a new user (using the default template), these tables (listed above) are created and the AspNetUsers table has a record inserted which contains:</p>
  
  <ol>
  <li>Id</li>
  <li>UserName</li>
  <li>PasswordHash</li>
  <li>SecurityStamp</li>
  <li>Discriminator</li>
  </ol>
  
  <p>Additionally, by adding public properties to the class "ApplicationUser" I have successfully added additional fields to the AspNetUsers table, such as "FirstName", "LastName", "PhoneNumber", etc.</p>
  
  <p>Here's my question. Is there a way to change the names of the above tables (when they are first created) or will they always be named with the <code>AspNet</code> prefix as I listed above? If the table names can be named differently, please explain how.</p>
  
  <p><strong>-- UPDATE --</strong></p>
  
  <p>I implemented @Hao Kung's solution. It does create a new table (for example I called it MyUsers), but it also still creates the AspNetUsers table. The goal is to replace the "AspNetUsers" table with the "MyUsers" table. See code below and database image of tables created.</p>
  
  <p>I would actually like to replace each <code>AspNet</code> table with my own name... For fxample, MyRoles, MyUserClaims, MyUserLogins, MyUserRoles, and MyUsers.</p>
  
  <p>How do I accomplish this and end up with only one set of tables?</p>
  
  <pre><code>public class ApplicationUser : IdentityUser
  {
      public string FirstName { get; set; }
      public string LastName { get; set; }
      public string Address1 { get; set; }
      public string Address2 { get; set; }
      public string City { get; set; }
      public string State { get; set; }
      public string PostalCode { get; set; }
      public string PhonePrimary { get; set; }
      public string PhoneSecondary { get; set; }
  }
  
  public class ApplicationDbContext : IdentityDbContext&lt;ApplicationUser&gt;
  {
      public ApplicationDbContext(): base("DefaultConnection")
      {
      }
  
      protected override void OnModelCreating(DbModelBuilder modelBuilder)
      {
          base.OnModelCreating(modelBuilder);
          modelBuilder.Entity&lt;IdentityUser&gt;().ToTable("MyUsers");
      }
  }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/P1p5S.png" alt="Database Tables"></p>
  
  <p><strong>-- UPDATE ANSWER --</strong></p>
  
  <p>Thanks to both Hao Kung and Peter Stulinski. This solved my problem...</p>
  
  <pre><code>    protected override void OnModelCreating(System.Data.Entity.DbModelBuilder modelBuilder)
      {
          base.OnModelCreating(modelBuilder);
  
          modelBuilder.Entity&lt;IdentityUser&gt;().ToTable("MyUsers").Property(p =&gt; p.Id).HasColumnName("UserId");
          modelBuilder.Entity&lt;ApplicationUser&gt;().ToTable("MyUsers").Property(p =&gt; p.Id).HasColumnName("UserId");
          modelBuilder.Entity&lt;IdentityUserRole&gt;().ToTable("MyUserRoles");
          modelBuilder.Entity&lt;IdentityUserLogin&gt;().ToTable("MyUserLogins");
          modelBuilder.Entity&lt;IdentityUserClaim&gt;().ToTable("MyUserClaims");
          modelBuilder.Entity&lt;IdentityRole&gt;().ToTable("MyRoles");
      }
  </code></pre>