Fix MangaConnectorId Chapters Cascade

This commit is contained in:
2025-07-22 22:34:38 +02:00
parent 24299a955a
commit 7e70288662
5 changed files with 10 additions and 5 deletions

View File

@@ -11,7 +11,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace API.Migrations.Manga
{
[DbContext(typeof(MangaContext))]
[Migration("20250721093858_Initial")]
[Migration("20250722203315_Initial")]
partial class Initial
{
/// <inheritdoc />
@@ -444,7 +444,7 @@ namespace API.Migrations.Manga
b.HasOne("API.Schema.MangaContext.Chapter", "Obj")
.WithMany("MangaConnectorIds")
.HasForeignKey("ObjId")
.OnDelete(DeleteBehavior.NoAction)
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Obj");

View File

@@ -276,7 +276,8 @@ namespace API.Migrations.Manga
name: "FK_MangaConnectorToChapter_Chapters_ObjId",
column: x => x.ObjId,
principalTable: "Chapters",
principalColumn: "Key");
principalColumn: "Key",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(

View File

@@ -441,7 +441,7 @@ namespace API.Migrations.Manga
b.HasOne("API.Schema.MangaContext.Chapter", "Obj")
.WithMany("MangaConnectorIds")
.HasForeignKey("ObjId")
.OnDelete(DeleteBehavior.NoAction)
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Obj");