revert 7273f49b3ffd96f11fc8220e5d3e4ef663179541

revert Make the payment details nullable
This commit is contained in:
ashutosh.nehete 2025-10-28 05:23:06 +00:00
parent 08b2cfe844
commit bd839b12f9
4 changed files with 5 additions and 6850 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,64 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Make_PaymentDetails_In_TenantSubscription_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_TenantSubscriptions_PaymentDetails_PaymentDetailId",
table: "TenantSubscriptions");
migrationBuilder.AlterColumn<Guid>(
name: "PaymentDetailId",
table: "TenantSubscriptions",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)")
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AddForeignKey(
name: "FK_TenantSubscriptions_PaymentDetails_PaymentDetailId",
table: "TenantSubscriptions",
column: "PaymentDetailId",
principalTable: "PaymentDetails",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_TenantSubscriptions_PaymentDetails_PaymentDetailId",
table: "TenantSubscriptions");
migrationBuilder.AlterColumn<Guid>(
name: "PaymentDetailId",
table: "TenantSubscriptions",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)",
oldNullable: true)
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AddForeignKey(
name: "FK_TenantSubscriptions_PaymentDetails_PaymentDetailId",
table: "TenantSubscriptions",
column: "PaymentDetailId",
principalTable: "PaymentDetails",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

View File

@ -4706,7 +4706,7 @@ namespace Marco.Pms.DataAccess.Migrations
b.Property<DateTime>("NextBillingDate")
.HasColumnType("datetime(6)");
b.Property<Guid?>("PaymentDetailId")
b.Property<Guid>("PaymentDetailId")
.HasColumnType("char(36)");
b.Property<Guid>("PlanId")
@ -6664,7 +6664,9 @@ namespace Marco.Pms.DataAccess.Migrations
b.HasOne("Marco.Pms.Model.PaymentGetway.PaymentDetail", "PaymentDetail")
.WithMany()
.HasForeignKey("PaymentDetailId");
.HasForeignKey("PaymentDetailId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Marco.Pms.Model.TenantModels.SubscriptionPlanDetails", "Plan")
.WithMany()

View File

@ -33,7 +33,7 @@ namespace Marco.Pms.Model.TenantModels
public DateTime? CancellationDate { get; set; }
public bool AutoRenew { get; set; } = true;
public bool IsCancelled { get; set; } = false;
public Guid? PaymentDetailId { get; set; }
public Guid PaymentDetailId { get; set; }
[ForeignKey("PaymentDetailId")]
[ValidateNever]