After extending the Application User and/or Application Role Models, the new migration includes a reference to creating the Foreign Key _FK_AspNetUserTokens_AspNetUsersUserId on the AspNetUserTokens table. The Foreign Key already exists and is created by the Add Security process. This issue occurs in both the Blazor Server and Web Assembly projects.
This is not a huge issue, just wanted to mention that the problem occurs. In the migration file: 00000000000000_CreateIdentitySchema.cs the following exists:
migrationBuilder.CreateTable(
name: "AspNetUserTokens",
columns: table => new
{
UserId = table.Column<string>(nullable: false),
LoginProvider = table.Column<string>(nullable: false),
Name = table.Column<string>(nullable: false),
Value = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name });
table.ForeignKey(
name: "FK_AspNetUserTokens_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
After extending the models, and creating a new migration, the following exists in the migration file:
After extending the Application User and/or Application Role Models, the new migration includes a reference to creating the Foreign Key _FK_AspNetUserTokens_AspNetUsersUserId on the AspNetUserTokens table. The Foreign Key already exists and is created by the Add Security process. This issue occurs in both the Blazor Server and Web Assembly projects.
This is not a huge issue, just wanted to mention that the problem occurs. In the migration file: 00000000000000_CreateIdentitySchema.cs the following exists:
After extending the models, and creating a new migration, the following exists in the migration file:
UP
DOWN