We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
asp.net 5/core 1 project, dnx 1.0.0-rc1-16609
"dependencies": { "EntityFramework.Commands": "7.0.0-rc1-final", "EntityFramework.MicrosoftSqlServer": "7.0.0-rc1-final", "Microsoft.AspNet.Identity.EntityFramework": "3.0.0-rc1-final" //etc.. },
Initial Migration:
migrationBuilder.CreateTable( name: "AspNetRoleClaims", columns: table => new { Id = table.Column<int>(nullable: false) .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), ClaimType = table.Column<string>(nullable: true), ClaimValue = table.Column<string>(nullable: true), RoleId = table.Column<string>(nullable: false) }, constraints: table => { table.PrimaryKey("PK_IdentityRoleClaim<string>", x => x.Id); table.ForeignKey( name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId", column: x => x.RoleId, principalTable: "AspNetRoles", principalColumn: "Id", onDelete: ReferentialAction.Cascade); });
Any migration I run after the initial is producing this sort of code:
protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey(name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId", table: "AspNetRoleClaims"); //etc.. migrationBuilder.AddForeignKey( name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId", table: "AspNetRoleClaims", column: "RoleId", principalTable: "AspNetRoles", principalColumn: "Id", onDelete: ReferentialAction.Cascade); // etc.
And the snapshot:
protected override void BuildModel(ModelBuilder modelBuilder) { modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityRoleClaim<string>", b => { b.HasOne("Microsoft.AspNet.Identity.EntityFramework.IdentityRole") .WithMany() .HasForeignKey("RoleId"); });
Why is EF deleting and re-added the same FK constraints every time I add a migration?
The text was updated successfully, but these errors were encountered:
Nevermind, after tearing my hair out for a while I finally found it's a known issue. #3751
Sorry, something went wrong.
actually dupe of #3751 & #4325, fixed in #3756 & #4349 will be available in RC2 release.
No branches or pull requests
asp.net 5/core 1 project, dnx 1.0.0-rc1-16609
Initial Migration:
Any migration I run after the initial is producing this sort of code:
And the snapshot:
Why is EF deleting and re-added the same FK constraints every time I add a migration?
The text was updated successfully, but these errors were encountered: