Fixed bug where deletes of artifact groupings would not cascade
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user