เพิ่ม user ใน บรรจุ

This commit is contained in:
Kittapath 2023-08-19 21:03:17 +07:00
parent d5ffd5cb08
commit 824c8267ef
24 changed files with 45466 additions and 16 deletions

View file

@ -0,0 +1,40 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class updatetableplacementofficeradddatestart : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "Date",
table: "PlacementOfficers",
newName: "DateStart");
migrationBuilder.AddColumn<DateTime>(
name: "DateEnd",
table: "PlacementOfficers",
type: "datetime(6)",
nullable: true,
comment: "ถึงวันที่");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "DateEnd",
table: "PlacementOfficers");
migrationBuilder.RenameColumn(
name: "DateStart",
table: "PlacementOfficers",
newName: "Date");
}
}
}

View file

@ -0,0 +1,151 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class updatetableplacementreceiveaddprofileid : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Guid>(
name: "ProfileId",
table: "RetirementOthers",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "ProfileId",
table: "PlacementRelocations",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "ProfileId",
table: "PlacementReceives",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "ProfileId",
table: "PlacementAppointments",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci");
migrationBuilder.CreateIndex(
name: "IX_RetirementOthers_ProfileId",
table: "RetirementOthers",
column: "ProfileId");
migrationBuilder.CreateIndex(
name: "IX_PlacementRelocations_ProfileId",
table: "PlacementRelocations",
column: "ProfileId");
migrationBuilder.CreateIndex(
name: "IX_PlacementReceives_ProfileId",
table: "PlacementReceives",
column: "ProfileId");
migrationBuilder.CreateIndex(
name: "IX_PlacementAppointments_ProfileId",
table: "PlacementAppointments",
column: "ProfileId");
migrationBuilder.AddForeignKey(
name: "FK_PlacementAppointments_Profiles_ProfileId",
table: "PlacementAppointments",
column: "ProfileId",
principalTable: "Profiles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_PlacementReceives_Profiles_ProfileId",
table: "PlacementReceives",
column: "ProfileId",
principalTable: "Profiles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_PlacementRelocations_Profiles_ProfileId",
table: "PlacementRelocations",
column: "ProfileId",
principalTable: "Profiles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_RetirementOthers_Profiles_ProfileId",
table: "RetirementOthers",
column: "ProfileId",
principalTable: "Profiles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_PlacementAppointments_Profiles_ProfileId",
table: "PlacementAppointments");
migrationBuilder.DropForeignKey(
name: "FK_PlacementReceives_Profiles_ProfileId",
table: "PlacementReceives");
migrationBuilder.DropForeignKey(
name: "FK_PlacementRelocations_Profiles_ProfileId",
table: "PlacementRelocations");
migrationBuilder.DropForeignKey(
name: "FK_RetirementOthers_Profiles_ProfileId",
table: "RetirementOthers");
migrationBuilder.DropIndex(
name: "IX_RetirementOthers_ProfileId",
table: "RetirementOthers");
migrationBuilder.DropIndex(
name: "IX_PlacementRelocations_ProfileId",
table: "PlacementRelocations");
migrationBuilder.DropIndex(
name: "IX_PlacementReceives_ProfileId",
table: "PlacementReceives");
migrationBuilder.DropIndex(
name: "IX_PlacementAppointments_ProfileId",
table: "PlacementAppointments");
migrationBuilder.DropColumn(
name: "ProfileId",
table: "RetirementOthers");
migrationBuilder.DropColumn(
name: "ProfileId",
table: "PlacementRelocations");
migrationBuilder.DropColumn(
name: "ProfileId",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "ProfileId",
table: "PlacementAppointments");
}
}
}

View file

@ -0,0 +1,80 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class addtableOrganizationEmployeeProfile : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsPublic",
table: "OrganizationEmployees",
type: "tinyint(1)",
nullable: true);
migrationBuilder.CreateTable(
name: "OrganizationEmployeeProfiles",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
CreatedUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล")
.Annotation("MySql:CharSet", "utf8mb4"),
LastUpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
LastUpdateUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด")
.Annotation("MySql:CharSet", "utf8mb4"),
CreatedFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล")
.Annotation("MySql:CharSet", "utf8mb4"),
LastUpdateFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด")
.Annotation("MySql:CharSet", "utf8mb4"),
ProfileId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
OrgEmployeeId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Status = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_OrganizationEmployeeProfiles", x => x.Id);
table.ForeignKey(
name: "FK_OrganizationEmployeeProfiles_OrganizationEmployees_OrgEmploy~",
column: x => x.OrgEmployeeId,
principalTable: "OrganizationEmployees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_OrganizationEmployeeProfiles_Profiles_ProfileId",
column: x => x.ProfileId,
principalTable: "Profiles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_OrganizationEmployeeProfiles_OrgEmployeeId",
table: "OrganizationEmployeeProfiles",
column: "OrgEmployeeId");
migrationBuilder.CreateIndex(
name: "IX_OrganizationEmployeeProfiles_ProfileId",
table: "OrganizationEmployeeProfiles",
column: "ProfileId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "OrganizationEmployeeProfiles");
migrationBuilder.DropColumn(
name: "IsPublic",
table: "OrganizationEmployees");
}
}
}

View file

@ -8587,6 +8587,9 @@ namespace BMA.EHR.Infrastructure.Migrations
b.Property<bool?>("IsDirector")
.HasColumnType("tinyint(1)");
b.Property<bool?>("IsPublic")
.HasColumnType("tinyint(1)");
b.Property<string>("LastUpdateFullName")
.IsRequired()
.HasMaxLength(200)
@ -8697,6 +8700,72 @@ namespace BMA.EHR.Infrastructure.Migrations
b.ToTable("OrganizationEmployees");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.OrganizationEmployee.OrganizationEmployeeProfile", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)")
.HasColumnOrder(0)
.HasComment("PrimaryKey")
.HasAnnotation("Relational:JsonPropertyName", "id");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)")
.HasColumnOrder(100)
.HasComment("สร้างข้อมูลเมื่อ");
b.Property<string>("CreatedFullName")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)")
.HasColumnOrder(104)
.HasComment("ชื่อ User ที่สร้างข้อมูล");
b.Property<string>("CreatedUserId")
.IsRequired()
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnOrder(101)
.HasComment("User Id ที่สร้างข้อมูล");
b.Property<string>("LastUpdateFullName")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)")
.HasColumnOrder(105)
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
b.Property<string>("LastUpdateUserId")
.IsRequired()
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnOrder(103)
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
b.Property<DateTime?>("LastUpdatedAt")
.HasColumnType("datetime(6)")
.HasColumnOrder(102)
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
b.Property<Guid>("OrgEmployeeId")
.HasColumnType("char(36)");
b.Property<Guid>("ProfileId")
.HasColumnType("char(36)");
b.Property<string>("Status")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.HasIndex("OrgEmployeeId");
b.HasIndex("ProfileId");
b.ToTable("OrganizationEmployeeProfiles");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.OrganizationEmployee.OrganizationPositionEmployeeLevel", b =>
{
b.Property<Guid>("Id")
@ -10185,6 +10254,9 @@ namespace BMA.EHR.Infrastructure.Migrations
b.Property<Guid>("PrefixId")
.HasColumnType("char(36)");
b.Property<Guid>("ProfileId")
.HasColumnType("char(36)");
b.Property<string>("Race")
.HasMaxLength(100)
.HasColumnType("varchar(100)")
@ -10238,6 +10310,8 @@ namespace BMA.EHR.Infrastructure.Migrations
b.HasIndex("PrefixId");
b.HasIndex("ProfileId");
b.HasIndex("RelationshipId");
b.HasIndex("ReligionId");
@ -10611,7 +10685,11 @@ namespace BMA.EHR.Infrastructure.Migrations
.HasColumnOrder(101)
.HasComment("User Id ที่สร้างข้อมูล");
b.Property<DateTime?>("Date")
b.Property<DateTime?>("DateEnd")
.HasColumnType("datetime(6)")
.HasComment("ถึงวันที่");
b.Property<DateTime?>("DateStart")
.HasColumnType("datetime(6)")
.HasComment("ตั้งแต่วันที่");
@ -11250,6 +11328,9 @@ namespace BMA.EHR.Infrastructure.Migrations
b.Property<Guid>("PrefixId")
.HasColumnType("char(36)");
b.Property<Guid>("ProfileId")
.HasColumnType("char(36)");
b.Property<string>("Race")
.HasMaxLength(100)
.HasColumnType("varchar(100)")
@ -11301,6 +11382,8 @@ namespace BMA.EHR.Infrastructure.Migrations
b.HasIndex("PrefixId");
b.HasIndex("ProfileId");
b.HasIndex("RelationshipId");
b.HasIndex("ReligionId");
@ -11505,6 +11588,9 @@ namespace BMA.EHR.Infrastructure.Migrations
b.Property<Guid>("PrefixId")
.HasColumnType("char(36)");
b.Property<Guid>("ProfileId")
.HasColumnType("char(36)");
b.Property<string>("Race")
.HasMaxLength(100)
.HasColumnType("varchar(100)")
@ -11556,6 +11642,8 @@ namespace BMA.EHR.Infrastructure.Migrations
b.HasIndex("PrefixId");
b.HasIndex("ProfileId");
b.HasIndex("RelationshipId");
b.HasIndex("ReligionId");
@ -12364,6 +12452,9 @@ namespace BMA.EHR.Infrastructure.Migrations
b.Property<Guid>("PrefixId")
.HasColumnType("char(36)");
b.Property<Guid>("ProfileId")
.HasColumnType("char(36)");
b.Property<string>("Race")
.HasMaxLength(100)
.HasColumnType("varchar(100)")
@ -12417,6 +12508,8 @@ namespace BMA.EHR.Infrastructure.Migrations
b.HasIndex("PrefixId");
b.HasIndex("ProfileId");
b.HasIndex("RelationshipId");
b.HasIndex("ReligionId");
@ -13702,6 +13795,25 @@ namespace BMA.EHR.Infrastructure.Migrations
b.Navigation("Profile");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.OrganizationEmployee.OrganizationEmployeeProfile", b =>
{
b.HasOne("BMA.EHR.Domain.Models.OrganizationEmployee.OrgEmployee", "OrgEmployee")
.WithMany()
.HasForeignKey("OrgEmployeeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile")
.WithMany()
.HasForeignKey("ProfileId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("OrgEmployee");
b.Navigation("Profile");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.OrganizationEmployee.OrganizationPositionEmployeeLevel", b =>
{
b.HasOne("BMA.EHR.Domain.Models.OrganizationEmployee.OrgEmployee", "OrganizationEmployee")
@ -13971,6 +14083,12 @@ namespace BMA.EHR.Infrastructure.Migrations
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile")
.WithMany()
.HasForeignKey("ProfileId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BMA.EHR.Domain.Models.MetaData.Relationship", "Relationship")
.WithMany()
.HasForeignKey("RelationshipId");
@ -14001,6 +14119,8 @@ namespace BMA.EHR.Infrastructure.Migrations
b.Navigation("Prefix");
b.Navigation("Profile");
b.Navigation("Relationship");
b.Navigation("Religion");
@ -14273,6 +14393,12 @@ namespace BMA.EHR.Infrastructure.Migrations
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile")
.WithMany()
.HasForeignKey("ProfileId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BMA.EHR.Domain.Models.MetaData.Relationship", "Relationship")
.WithMany()
.HasForeignKey("RelationshipId");
@ -14301,6 +14427,8 @@ namespace BMA.EHR.Infrastructure.Migrations
b.Navigation("Prefix");
b.Navigation("Profile");
b.Navigation("Relationship");
b.Navigation("Religion");
@ -14369,6 +14497,12 @@ namespace BMA.EHR.Infrastructure.Migrations
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile")
.WithMany()
.HasForeignKey("ProfileId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BMA.EHR.Domain.Models.MetaData.Relationship", "Relationship")
.WithMany()
.HasForeignKey("RelationshipId");
@ -14397,6 +14531,8 @@ namespace BMA.EHR.Infrastructure.Migrations
b.Navigation("Prefix");
b.Navigation("Profile");
b.Navigation("Relationship");
b.Navigation("Religion");
@ -14549,6 +14685,12 @@ namespace BMA.EHR.Infrastructure.Migrations
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile")
.WithMany()
.HasForeignKey("ProfileId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BMA.EHR.Domain.Models.MetaData.Relationship", "Relationship")
.WithMany()
.HasForeignKey("RelationshipId");
@ -14579,6 +14721,8 @@ namespace BMA.EHR.Infrastructure.Migrations
b.Navigation("Prefix");
b.Navigation("Profile");
b.Navigation("Relationship");
b.Navigation("Religion");