Added new parameter uploaded by in documents table
This commit is contained in:
parent
65da812a97
commit
ba1e644fd8
3426
Marco.Pms.DataAccess/Migrations/20250702042830_Added_UploadedBy_ForeginKey_In_Decuments_Table.Designer.cs
generated
Normal file
3426
Marco.Pms.DataAccess/Migrations/20250702042830_Added_UploadedBy_ForeginKey_In_Decuments_Table.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,50 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace Marco.Pms.DataAccess.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class Added_UploadedBy_ForeginKey_In_Decuments_Table : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "UploadedById",
|
||||||
|
table: "Documents",
|
||||||
|
type: "char(36)",
|
||||||
|
nullable: true,
|
||||||
|
collation: "ascii_general_ci");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Documents_UploadedById",
|
||||||
|
table: "Documents",
|
||||||
|
column: "UploadedById");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Documents_Employees_UploadedById",
|
||||||
|
table: "Documents",
|
||||||
|
column: "UploadedById",
|
||||||
|
principalTable: "Employees",
|
||||||
|
principalColumn: "Id");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_Documents_Employees_UploadedById",
|
||||||
|
table: "Documents");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_Documents_UploadedById",
|
||||||
|
table: "Documents");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "UploadedById",
|
||||||
|
table: "Documents");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -752,10 +752,15 @@ namespace Marco.Pms.DataAccess.Migrations
|
|||||||
b.Property<DateTime>("UploadedAt")
|
b.Property<DateTime>("UploadedAt")
|
||||||
.HasColumnType("datetime(6)");
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<Guid?>("UploadedById")
|
||||||
|
.HasColumnType("char(36)");
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.HasIndex("TenantId");
|
b.HasIndex("TenantId");
|
||||||
|
|
||||||
|
b.HasIndex("UploadedById");
|
||||||
|
|
||||||
b.ToTable("Documents");
|
b.ToTable("Documents");
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -2951,7 +2956,13 @@ namespace Marco.Pms.DataAccess.Migrations
|
|||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Marco.Pms.Model.Employees.Employee", "UploadedBy")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UploadedById");
|
||||||
|
|
||||||
b.Navigation("Tenant");
|
b.Navigation("Tenant");
|
||||||
|
|
||||||
|
b.Navigation("UploadedBy");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b =>
|
modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b =>
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
using Marco.Pms.Model.Utilities;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using Marco.Pms.Model.Employees;
|
||||||
|
using Marco.Pms.Model.Utilities;
|
||||||
|
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||||
|
|
||||||
namespace Marco.Pms.Model.DocumentManager
|
namespace Marco.Pms.Model.DocumentManager
|
||||||
{
|
{
|
||||||
@ -16,10 +19,15 @@ namespace Marco.Pms.Model.DocumentManager
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string? ThumbS3Key { get; set; }
|
public string? ThumbS3Key { get; set; }
|
||||||
|
|
||||||
public string? Base64Data { get; set; }
|
public string? Base64Data { get; set; } = null;
|
||||||
|
|
||||||
public long FileSize { get; set; }
|
public long FileSize { get; set; }
|
||||||
public string ContentType { get; set; } = string.Empty;
|
public string ContentType { get; set; } = string.Empty;
|
||||||
|
public Guid? UploadedById { get; set; }
|
||||||
|
|
||||||
|
[ValidateNever]
|
||||||
|
[ForeignKey("UploadedById")]
|
||||||
|
public Employee? UploadedBy { get; set; }
|
||||||
public DateTime UploadedAt { get; set; }
|
public DateTime UploadedAt { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user