Files
yavsc/src/Yavsc.Server/Migrations/20250715143821_nullPaimentIdOnQuery.cs
Paul Schneider d8b09cb42e
Some checks failed
Dotnet build and test / log-the-inputs (push) Failing after 4s
Dotnet build and test / build (push) Failing after 1s
null paiment id
2025-07-15 15:42:30 +01:00

183 lines
6.4 KiB
C#

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);
}
}
}