title: EF Core Migration on IdentityServer DB applies for MULTIPLE tables instead of ONLY AspNetUsers table when adding the migration
body: <p>I want to add a new field on my AspNetUsers table. I want to do that with EF Migration.</p>
  <p><a href="https://i.stack.imgur.com/VZt3l.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VZt3l.png" alt="enter image description here" /></a></p>
  <p>In my InitialCreate migration I only added  FullName (last field in the table) - which built successfully.</p>
  <p>On my second migration I want to add another field. I updated my ApplicationUser which derives from IdentityUser</p>
  <pre><code>public class ApplicationUser : IdentityUser
  {
      [Column(TypeName = &quot;nvarchar(150)&quot;)]
      public string FullName { get; set; }
  
      public string RefreshTokensAuth { get; set; }
  }
  </code></pre>
  <p>The problem is that after I ran the command in PM:</p>
  <pre><code>PM&gt; Add-Migration -Context AuthenticationContext AddUsersSession
  </code></pre>
  <p>my migration contains modifications for other tables as well as seen below (AspNetUserTokens, AspNetUserLogins), not only to AspNetUsers:</p>
  <pre><code>public partial class AddUsersSession : Migration
  {
      protected override void Up(MigrationBuilder migrationBuilder)
      {
          migrationBuilder.AlterColumn&lt;string&gt;(
              name: &quot;Name&quot;,
              table: &quot;AspNetUserTokens&quot;,
              maxLength: 128,
              nullable: false,
              oldClrType: typeof(string),
              oldType: &quot;nvarchar(450)&quot;);
  
          migrationBuilder.AlterColumn&lt;string&gt;(
              name: &quot;LoginProvider&quot;,
              table: &quot;AspNetUserTokens&quot;,
              maxLength: 128,
              nullable: false,
              oldClrType: typeof(string),
              oldType: &quot;nvarchar(450)&quot;);
  
          migrationBuilder.AlterColumn&lt;string&gt;(
              name: &quot;FullName&quot;,
              table: &quot;AspNetUsers&quot;,
              type: &quot;nvarchar(150)&quot;,
              nullable: true,
              oldClrType: typeof(string),
              oldType: &quot;nvarchar(150&quot;,
              oldNullable: true);
  
          migrationBuilder.AddColumn&lt;string&gt;(
              name: &quot;RefreshTokensAuth&quot;,
              table: &quot;AspNetUsers&quot;,
              nullable: true);
  
          migrationBuilder.AlterColumn&lt;string&gt;(
              name: &quot;ProviderKey&quot;,
              table: &quot;AspNetUserLogins&quot;,
              maxLength: 128,
              nullable: false,
              oldClrType: typeof(string),
              oldType: &quot;nvarchar(450)&quot;);
  
          migrationBuilder.AlterColumn&lt;string&gt;(
              name: &quot;LoginProvider&quot;,
              table: &quot;AspNetUserLogins&quot;,
              maxLength: 128,
              nullable: false,
              oldClrType: typeof(string),
              oldType: &quot;nvarchar(450)&quot;);
      }
  
      protected override void Down(MigrationBuilder migrationBuilder)
      {
          migrationBuilder.DropColumn(
              name: &quot;RefreshTokensAuth&quot;,
              table: &quot;AspNetUsers&quot;);
  
          migrationBuilder.AlterColumn&lt;string&gt;(
              name: &quot;Name&quot;,
              table: &quot;AspNetUserTokens&quot;,
              type: &quot;nvarchar(450)&quot;,
              nullable: false,
              oldClrType: typeof(string),
              oldMaxLength: 128);
  
          migrationBuilder.AlterColumn&lt;string&gt;(
              name: &quot;LoginProvider&quot;,
              table: &quot;AspNetUserTokens&quot;,
              type: &quot;nvarchar(450)&quot;,
              nullable: false,
              oldClrType: typeof(string),
              oldMaxLength: 128);
  
          migrationBuilder.AlterColumn&lt;string&gt;(
              name: &quot;FullName&quot;,
              table: &quot;AspNetUsers&quot;,
              type: &quot;nvarchar(150&quot;,
              nullable: true,
              oldClrType: typeof(string),
              oldType: &quot;nvarchar(150)&quot;,
              oldNullable: true);
  
          migrationBuilder.AlterColumn&lt;string&gt;(
              name: &quot;ProviderKey&quot;,
              table: &quot;AspNetUserLogins&quot;,
              type: &quot;nvarchar(450)&quot;,
              nullable: false,
              oldClrType: typeof(string),
              oldMaxLength: 128);
  
          migrationBuilder.AlterColumn&lt;string&gt;(
              name: &quot;LoginProvider&quot;,
              table: &quot;AspNetUserLogins&quot;,
              type: &quot;nvarchar(450)&quot;,
              nullable: false,
              oldClrType: typeof(string),
              oldMaxLength: 128);
      }
  }
  </code></pre>
  <p>Of course, when I run</p>
  <pre><code>update-database -context AuthenticationContext
  </code></pre>
  <p>I ran into errors.</p>
  <p>Did someone experienced this? Any hint will be helpful. Thank you!</p>