using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace OpenArchival.DataAccess.Migrations
{
    /// <inheritdoc />
    public partial class FixedBlogPostFileCascade : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_ArtifactFilePaths_BlogPosts_ParentBlogPostId",
                table: "ArtifactFilePaths");

            migrationBuilder.AddForeignKey(
                name: "FK_ArtifactFilePaths_BlogPosts_ParentBlogPostId",
                table: "ArtifactFilePaths",
                column: "ParentBlogPostId",
                principalTable: "BlogPosts",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_ArtifactFilePaths_BlogPosts_ParentBlogPostId",
                table: "ArtifactFilePaths");

            migrationBuilder.AddForeignKey(
                name: "FK_ArtifactFilePaths_BlogPosts_ParentBlogPostId",
                table: "ArtifactFilePaths",
                column: "ParentBlogPostId",
                principalTable: "BlogPosts",
                principalColumn: "Id");
        }
    }
}
