Make the payment details nullable
This commit is contained in:
parent
1a360447cd
commit
7273f49b3f
6783
Marco.Pms.DataAccess/Migrations/20251028050942_Make_PaymentDetails_In_TenantSubscription_Table.Designer.cs
generated
Normal file
6783
Marco.Pms.DataAccess/Migrations/20251028050942_Make_PaymentDetails_In_TenantSubscription_Table.Designer.cs
generated
Normal file
File diff suppressed because one or more lines are too long
@ -0,0 +1,64 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -4706,7 +4706,7 @@ namespace Marco.Pms.DataAccess.Migrations
|
|||||||
b.Property<DateTime>("NextBillingDate")
|
b.Property<DateTime>("NextBillingDate")
|
||||||
.HasColumnType("datetime(6)");
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
b.Property<Guid>("PaymentDetailId")
|
b.Property<Guid?>("PaymentDetailId")
|
||||||
.HasColumnType("char(36)");
|
.HasColumnType("char(36)");
|
||||||
|
|
||||||
b.Property<Guid>("PlanId")
|
b.Property<Guid>("PlanId")
|
||||||
@ -6664,9 +6664,7 @@ namespace Marco.Pms.DataAccess.Migrations
|
|||||||
|
|
||||||
b.HasOne("Marco.Pms.Model.PaymentGetway.PaymentDetail", "PaymentDetail")
|
b.HasOne("Marco.Pms.Model.PaymentGetway.PaymentDetail", "PaymentDetail")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("PaymentDetailId")
|
.HasForeignKey("PaymentDetailId");
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("Marco.Pms.Model.TenantModels.SubscriptionPlanDetails", "Plan")
|
b.HasOne("Marco.Pms.Model.TenantModels.SubscriptionPlanDetails", "Plan")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
|
|||||||
@ -33,7 +33,7 @@ namespace Marco.Pms.Model.TenantModels
|
|||||||
public DateTime? CancellationDate { get; set; }
|
public DateTime? CancellationDate { get; set; }
|
||||||
public bool AutoRenew { get; set; } = true;
|
public bool AutoRenew { get; set; } = true;
|
||||||
public bool IsCancelled { get; set; } = false;
|
public bool IsCancelled { get; set; } = false;
|
||||||
public Guid PaymentDetailId { get; set; }
|
public Guid? PaymentDetailId { get; set; }
|
||||||
|
|
||||||
[ForeignKey("PaymentDetailId")]
|
[ForeignKey("PaymentDetailId")]
|
||||||
[ValidateNever]
|
[ValidateNever]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user