This commit is contained in:
Tizian.Breuch
2025-09-08 11:28:28 +02:00
parent 88a81aa795
commit 0af6501dcd
3 changed files with 9 additions and 6 deletions

View File

@@ -12,8 +12,8 @@ using Webshop.Infrastructure.Data;
namespace Webshop.Infrastructure.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20250908092457_review")]
partial class review
[Migration("20250908092824_review-beziehung")]
partial class reviewbeziehung
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@@ -1274,7 +1274,8 @@ namespace Webshop.Infrastructure.Migrations
{
b.HasOne("Webshop.Domain.Entities.Customer", "Customer")
.WithMany("Reviews")
.HasForeignKey("CustomerId");
.HasForeignKey("CustomerId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("Webshop.Domain.Entities.Product", "Product")
.WithMany("Reviews")

View File

@@ -7,7 +7,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace Webshop.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class review : Migration
public partial class reviewbeziehung : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
@@ -588,7 +588,8 @@ namespace Webshop.Infrastructure.Migrations
name: "FK_Reviews_Customers_CustomerId",
column: x => x.CustomerId,
principalTable: "Customers",
principalColumn: "Id");
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_Reviews_Products_ProductId",
column: x => x.ProductId,

View File

@@ -1271,7 +1271,8 @@ namespace Webshop.Infrastructure.Migrations
{
b.HasOne("Webshop.Domain.Entities.Customer", "Customer")
.WithMany("Reviews")
.HasForeignKey("CustomerId");
.HasForeignKey("CustomerId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("Webshop.Domain.Entities.Product", "Product")
.WithMany("Reviews")