null paiment id

This commit is contained in:
Paul Schneider 2025-07-15 15:42:30 +01:00
commit 72bae76c75
8 changed files with 3710 additions and 41 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,182 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Yavsc.Migrations
{
/// <inheritdoc />
public partial class nullPaimentIdOnQuery : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_HairCutQueries_PayPalPayment_PaymentId",
table: "HairCutQueries");
migrationBuilder.DropForeignKey(
name: "FK_HairMultiCutQueries_PayPalPayment_PaymentId",
table: "HairMultiCutQueries");
migrationBuilder.DropForeignKey(
name: "FK_Project_PayPalPayment_PaymentId",
table: "Project");
migrationBuilder.DropForeignKey(
name: "FK_RdvQueries_PayPalPayment_PaymentId",
table: "RdvQueries");
migrationBuilder.AlterColumn<string>(
name: "PaymentId",
table: "RdvQueries",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "PaymentId",
table: "Project",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "PaymentId",
table: "HairMultiCutQueries",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "PaymentId",
table: "HairCutQueries",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AddForeignKey(
name: "FK_HairCutQueries_PayPalPayment_PaymentId",
table: "HairCutQueries",
column: "PaymentId",
principalTable: "PayPalPayment",
principalColumn: "CreationToken");
migrationBuilder.AddForeignKey(
name: "FK_HairMultiCutQueries_PayPalPayment_PaymentId",
table: "HairMultiCutQueries",
column: "PaymentId",
principalTable: "PayPalPayment",
principalColumn: "CreationToken");
migrationBuilder.AddForeignKey(
name: "FK_Project_PayPalPayment_PaymentId",
table: "Project",
column: "PaymentId",
principalTable: "PayPalPayment",
principalColumn: "CreationToken");
migrationBuilder.AddForeignKey(
name: "FK_RdvQueries_PayPalPayment_PaymentId",
table: "RdvQueries",
column: "PaymentId",
principalTable: "PayPalPayment",
principalColumn: "CreationToken");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_HairCutQueries_PayPalPayment_PaymentId",
table: "HairCutQueries");
migrationBuilder.DropForeignKey(
name: "FK_HairMultiCutQueries_PayPalPayment_PaymentId",
table: "HairMultiCutQueries");
migrationBuilder.DropForeignKey(
name: "FK_Project_PayPalPayment_PaymentId",
table: "Project");
migrationBuilder.DropForeignKey(
name: "FK_RdvQueries_PayPalPayment_PaymentId",
table: "RdvQueries");
migrationBuilder.AlterColumn<string>(
name: "PaymentId",
table: "RdvQueries",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "PaymentId",
table: "Project",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "PaymentId",
table: "HairMultiCutQueries",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "PaymentId",
table: "HairCutQueries",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AddForeignKey(
name: "FK_HairCutQueries_PayPalPayment_PaymentId",
table: "HairCutQueries",
column: "PaymentId",
principalTable: "PayPalPayment",
principalColumn: "CreationToken",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_HairMultiCutQueries_PayPalPayment_PaymentId",
table: "HairMultiCutQueries",
column: "PaymentId",
principalTable: "PayPalPayment",
principalColumn: "CreationToken",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Project_PayPalPayment_PaymentId",
table: "Project",
column: "PaymentId",
principalTable: "PayPalPayment",
principalColumn: "CreationToken",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_RdvQueries_PayPalPayment_PaymentId",
table: "RdvQueries",
column: "PaymentId",
principalTable: "PayPalPayment",
principalColumn: "CreationToken",
onDelete: ReferentialAction.Cascade);
}
}
}

View file

@ -1226,7 +1226,6 @@ namespace Yavsc.Migrations
.HasColumnType("bigint");
b.Property<string>("PaymentId")
.IsRequired()
.HasColumnType("text");
b.Property<string>("PerformerId")
@ -1317,7 +1316,6 @@ namespace Yavsc.Migrations
.HasColumnType("bigint");
b.Property<string>("PaymentId")
.IsRequired()
.HasColumnType("text");
b.Property<string>("PerformerId")
@ -2283,7 +2281,6 @@ namespace Yavsc.Migrations
.HasColumnType("integer");
b.Property<string>("PaymentId")
.IsRequired()
.HasColumnType("text");
b.Property<string>("PerformerId")
@ -2444,7 +2441,6 @@ namespace Yavsc.Migrations
.HasColumnType("text");
b.Property<string>("PaymentId")
.IsRequired()
.HasColumnType("text");
b.Property<string>("PerformerId")
@ -2890,9 +2886,7 @@ namespace Yavsc.Migrations
b.HasOne("Yavsc.Models.Payment.PayPalPayment", "Regularisation")
.WithMany()
.HasForeignKey("PaymentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
.HasForeignKey("PaymentId");
b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "PerformerProfile")
.WithMany()
@ -2947,9 +2941,7 @@ namespace Yavsc.Migrations
b.HasOne("Yavsc.Models.Payment.PayPalPayment", "Regularisation")
.WithMany()
.HasForeignKey("PaymentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
.HasForeignKey("PaymentId");
b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "PerformerProfile")
.WithMany()
@ -3285,9 +3277,7 @@ namespace Yavsc.Migrations
b.HasOne("Yavsc.Models.Payment.PayPalPayment", "Regularisation")
.WithMany()
.HasForeignKey("PaymentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
.HasForeignKey("PaymentId");
b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "PerformerProfile")
.WithMany()
@ -3347,9 +3337,7 @@ namespace Yavsc.Migrations
b.HasOne("Yavsc.Models.Payment.PayPalPayment", "Regularisation")
.WithMany()
.HasForeignKey("PaymentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
.HasForeignKey("PaymentId");
b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "PerformerProfile")
.WithMany()