using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Yavsc.Migrations { /// public partial class EnforceBlogAuthorFKs : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_BlogSpot_AspNetUsers_AuthorId", table: "BlogSpot"); migrationBuilder.DropForeignKey( name: "FK_Comment_AspNetUsers_AuthorId", table: "Comment"); migrationBuilder.AddForeignKey( name: "FK_BlogSpot_AspNetUsers_AuthorId", table: "BlogSpot", column: "AuthorId", principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.Restrict); migrationBuilder.AddForeignKey( name: "FK_Comment_AspNetUsers_AuthorId", table: "Comment", column: "AuthorId", principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.Restrict); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_BlogSpot_AspNetUsers_AuthorId", table: "BlogSpot"); migrationBuilder.DropForeignKey( name: "FK_Comment_AspNetUsers_AuthorId", table: "Comment"); migrationBuilder.AddForeignKey( name: "FK_BlogSpot_AspNetUsers_AuthorId", table: "BlogSpot", column: "AuthorId", principalTable: "AspNetUsers", principalColumn: "Id"); migrationBuilder.AddForeignKey( name: "FK_Comment_AspNetUsers_AuthorId", table: "Comment", column: "AuthorId", principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); } } }