null paiment id
This commit is contained in:
@ -1,13 +1,5 @@
|
||||
{
|
||||
"version": 1,
|
||||
"isRoot": true,
|
||||
"tools": {
|
||||
"dotnet-ef": {
|
||||
"version": "9.0.6",
|
||||
"commands": [
|
||||
"dotnet-ef"
|
||||
],
|
||||
"rollForward": false
|
||||
}
|
||||
}
|
||||
"tools": {}
|
||||
}
|
3504
src/Yavsc.Server/Migrations/20250715143821_nullPaimentIdOnQuery.Designer.cs
generated
Normal file
3504
src/Yavsc.Server/Migrations/20250715143821_nullPaimentIdOnQuery.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
@ -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()
|
||||
|
@ -39,16 +39,7 @@ namespace Yavsc.Models
|
||||
using System.Configuration;
|
||||
|
||||
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
|
||||
{
|
||||
private readonly ILogger<ApplicationDbContext> logger;
|
||||
|
||||
|
||||
public ApplicationDbContext(ILoggerFactory loggerFactory,
|
||||
DbContextOptions<ApplicationDbContext> options) : base(options)
|
||||
{
|
||||
logger = loggerFactory.CreateLogger<ApplicationDbContext>();
|
||||
}
|
||||
|
||||
{
|
||||
protected override void OnModelCreating(ModelBuilder builder)
|
||||
{
|
||||
base.OnModelCreating(builder);
|
||||
@ -89,7 +80,13 @@ namespace Yavsc.Models
|
||||
builder.Entity<Activity>().Property(a => a.ParentCode).IsRequired(false);
|
||||
// builder.Entity<IdentityUserLogin<String>>().HasKey(i=> new { i.LoginProvider, i.UserId, i.ProviderKey });
|
||||
}
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
string? envCxStr = Environment.GetEnvironmentVariable(Constants.YavscConnectionStringEnvName);
|
||||
if (envCxStr != null)
|
||||
optionsBuilder.UseNpgsql(envCxStr);
|
||||
base.OnConfiguring(optionsBuilder);
|
||||
}
|
||||
public DbSet<Client> Applications { get; set; }
|
||||
|
||||
public DbSet<RefreshToken> RefreshTokens { get; set; }
|
||||
|
@ -98,7 +98,7 @@ namespace Yavsc.Models.Billing
|
||||
|
||||
[ForeignKey("Regularisation")]
|
||||
|
||||
public string PaymentId { get; set; }
|
||||
public string? PaymentId { get; set; }
|
||||
|
||||
[Display(Name = "Acquittement de la facture")]
|
||||
public virtual PayPalPayment Regularisation { get; set; }
|
||||
|
Reference in New Issue
Block a user