Refactored Evidence to UpdateBy is optional When creating evidence

This commit is contained in:
2026-10-26 17:03:53 +02:00
parent 155a379ab4
commit 2690b3230e
4 changed files with 2558 additions and 2 deletions
@@ -33,8 +33,8 @@ public sealed class EvidenceConfiguration : IEntityTypeConfiguration<Evidence>
builder.Property(f => f.IndicatorId).IsRequired(); builder.Property(f => f.IndicatorId).IsRequired();
builder.Property(f => f.ActivityId).IsRequired(); builder.Property(f => f.ActivityId).IsRequired();
builder.Property(f => f.CreatedBy).IsRequired(); builder.Property(f => f.CreatedBy).IsRequired();
builder.Property(f => f.UpdatedBy).IsRequired();
builder.Property(f => f.CreatedAt).IsRequired().HasDefaultValueSql("now()"); builder.Property(f => f.CreatedAt).IsRequired().HasDefaultValueSql("now()");
builder.Property(f => f.UpdatedBy).IsRequired(false);
builder.Property(f => f.UpdatedAt).IsRequired(false); builder.Property(f => f.UpdatedAt).IsRequired(false);
builder.Property(f => f.Version).IsRequired().HasDefaultValue(1); builder.Property(f => f.Version).IsRequired().HasDefaultValue(1);
builder.Property(f => f.DocumentUrl).IsRequired(); builder.Property(f => f.DocumentUrl).IsRequired();
@@ -0,0 +1,37 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace PostFundManagement.Infrastructure.Database.Migrations
{
/// <inheritdoc />
public partial class UpdatedByIsOptionalOnEvidence : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<Guid>(
name: "UpdatedBy",
table: "Evidences",
type: "uuid",
nullable: true,
oldClrType: typeof(Guid),
oldType: "uuid");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<Guid>(
name: "UpdatedBy",
table: "Evidences",
type: "uuid",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
oldClrType: typeof(Guid),
oldType: "uuid",
oldNullable: true);
}
}
}
@@ -604,7 +604,7 @@ namespace PostFundManagement.Infrastructure.Database.Migrations
b.Property<DateTime?>("UpdatedAt") b.Property<DateTime?>("UpdatedAt")
.HasColumnType("timestamp with time zone"); .HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedBy") b.Property<Guid?>("UpdatedBy")
.HasColumnType("uuid"); .HasColumnType("uuid");
b.Property<int>("Version") b.Property<int>("Version")