Merge branch 'work' into develop

This commit is contained in:
Kittapath 2023-08-25 18:19:01 +07:00
commit dce5aaf778
27 changed files with 64049 additions and 118 deletions

View file

@ -0,0 +1,42 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class updatetableRetirementQuestionupdatetypeTimeThinkint : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<int>(
name: "TimeThink",
table: "RetirementQuestions",
type: "int",
nullable: true,
comment: "สำหรับการลาออกในครั้งนี้ ท่านได้คิดทบทวนอย่างจริงจังเป็นระยะเวลานานเท่าใด",
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true,
oldComment: "สำหรับการลาออกในครั้งนี้ ท่านได้คิดทบทวนอย่างจริงจังเป็นระยะเวลานานเท่าใด")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "TimeThink",
table: "RetirementQuestions",
type: "longtext",
nullable: true,
comment: "สำหรับการลาออกในครั้งนี้ ท่านได้คิดทบทวนอย่างจริงจังเป็นระยะเวลานานเท่าใด",
oldClrType: typeof(int),
oldType: "int",
oldNullable: true,
oldComment: "สำหรับการลาออกในครั้งนี้ ท่านได้คิดทบทวนอย่างจริงจังเป็นระยะเวลานานเท่าใด")
.Annotation("MySql:CharSet", "utf8mb4");
}
}
}

View file

@ -0,0 +1,30 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class updatetableRetirementQuestionaddAppointDate : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<DateTime>(
name: "AppointDate",
table: "RetirementQuestions",
type: "datetime(6)",
nullable: true,
comment: "กําหนดวันนัดหมายเพื่อทําการสัมภาษณ์การลาออก");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "AppointDate",
table: "RetirementQuestions");
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,81 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class ADDtableInsigniaManageOrganiations : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Type",
table: "InsigniaManages");
migrationBuilder.CreateTable(
name: "InsigniaManageOrganiations",
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"),
Total = table.Column<int>(type: "int", nullable: false, comment: "จำนวนทั้งหมด"),
OrganizationOrganizationId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
InsigniaManageId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_InsigniaManageOrganiations", x => x.Id);
table.ForeignKey(
name: "FK_InsigniaManageOrganiations_InsigniaManages_InsigniaManageId",
column: x => x.InsigniaManageId,
principalTable: "InsigniaManages",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_InsigniaManageOrganiations_OrganizationOrganizations_Organiz~",
column: x => x.OrganizationOrganizationId,
principalTable: "OrganizationOrganizations",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_InsigniaManageOrganiations_InsigniaManageId",
table: "InsigniaManageOrganiations",
column: "InsigniaManageId");
migrationBuilder.CreateIndex(
name: "IX_InsigniaManageOrganiations_OrganizationOrganizationId",
table: "InsigniaManageOrganiations",
column: "OrganizationOrganizationId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "InsigniaManageOrganiations");
migrationBuilder.AddColumn<string>(
name: "Type",
table: "InsigniaManages",
type: "longtext",
nullable: false,
comment: "ประเภทเครื่องราช")
.Annotation("MySql:CharSet", "utf8mb4");
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,95 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class ADDtableInsigniaManageProfiles : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "InsigniaManageProfiles",
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"),
Status = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "สถานะการคืน"),
BorrowDate = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "ยืมวันที่"),
BorrowOrganizationId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
ReturnDate = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "คืนวันที่"),
ReturnOrganizationId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
ReturnReason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลคืน")
.Annotation("MySql:CharSet", "utf8mb4"),
InsigniaNoteProfileId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
InsigniaManageOrganiationId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_InsigniaManageProfiles", x => x.Id);
table.ForeignKey(
name: "FK_InsigniaManageProfiles_InsigniaManageOrganiations_InsigniaMa~",
column: x => x.InsigniaManageOrganiationId,
principalTable: "InsigniaManageOrganiations",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_InsigniaManageProfiles_InsigniaNoteProfiles_InsigniaNoteProf~",
column: x => x.InsigniaNoteProfileId,
principalTable: "InsigniaNoteProfiles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_InsigniaManageProfiles_OrganizationOrganizations_BorrowOrgan~",
column: x => x.BorrowOrganizationId,
principalTable: "OrganizationOrganizations",
principalColumn: "Id");
table.ForeignKey(
name: "FK_InsigniaManageProfiles_OrganizationOrganizations_ReturnOrgan~",
column: x => x.ReturnOrganizationId,
principalTable: "OrganizationOrganizations",
principalColumn: "Id");
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_InsigniaManageProfiles_BorrowOrganizationId",
table: "InsigniaManageProfiles",
column: "BorrowOrganizationId");
migrationBuilder.CreateIndex(
name: "IX_InsigniaManageProfiles_InsigniaManageOrganiationId",
table: "InsigniaManageProfiles",
column: "InsigniaManageOrganiationId");
migrationBuilder.CreateIndex(
name: "IX_InsigniaManageProfiles_InsigniaNoteProfileId",
table: "InsigniaManageProfiles",
column: "InsigniaNoteProfileId");
migrationBuilder.CreateIndex(
name: "IX_InsigniaManageProfiles_ReturnOrganizationId",
table: "InsigniaManageProfiles",
column: "ReturnOrganizationId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "InsigniaManageProfiles");
}
}
}

View file

@ -5294,11 +5294,6 @@ namespace BMA.EHR.Infrastructure.Migrations
.HasColumnType("int")
.HasComment("จำนวนทั้งหมด");
b.Property<string>("Type")
.IsRequired()
.HasColumnType("longtext")
.HasComment("ประเภทเครื่องราช");
b.Property<int>("Year")
.HasColumnType("int")
.HasComment("ปี");
@ -5310,6 +5305,160 @@ namespace BMA.EHR.Infrastructure.Migrations
b.ToTable("InsigniaManages");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Insignias.InsigniaManageOrganiation", 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<Guid>("InsigniaManageId")
.HasColumnType("char(36)");
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>("OrganizationOrganizationId")
.HasColumnType("char(36)");
b.Property<int>("Total")
.HasColumnType("int")
.HasComment("จำนวนทั้งหมด");
b.HasKey("Id");
b.HasIndex("InsigniaManageId");
b.HasIndex("OrganizationOrganizationId");
b.ToTable("InsigniaManageOrganiations");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Insignias.InsigniaManageProfile", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)")
.HasColumnOrder(0)
.HasComment("PrimaryKey")
.HasAnnotation("Relational:JsonPropertyName", "id");
b.Property<DateTime?>("BorrowDate")
.HasColumnType("datetime(6)")
.HasComment("ยืมวันที่");
b.Property<Guid?>("BorrowOrganizationId")
.HasColumnType("char(36)");
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<Guid>("InsigniaManageOrganiationId")
.HasColumnType("char(36)");
b.Property<Guid>("InsigniaNoteProfileId")
.HasColumnType("char(36)");
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<DateTime?>("ReturnDate")
.HasColumnType("datetime(6)")
.HasComment("คืนวันที่");
b.Property<Guid?>("ReturnOrganizationId")
.HasColumnType("char(36)");
b.Property<string>("ReturnReason")
.HasColumnType("longtext")
.HasComment("เหตุผลคืน");
b.Property<bool>("Status")
.HasColumnType("tinyint(1)")
.HasComment("สถานะการคืน");
b.HasKey("Id");
b.HasIndex("BorrowOrganizationId");
b.HasIndex("InsigniaManageOrganiationId");
b.HasIndex("InsigniaNoteProfileId");
b.HasIndex("ReturnOrganizationId");
b.ToTable("InsigniaManageProfiles");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Insignias.InsigniaNote", b =>
{
b.Property<Guid>("Id")
@ -13291,6 +13440,10 @@ namespace BMA.EHR.Infrastructure.Migrations
.HasColumnType("longtext")
.HasComment("อื่นๆ อะไรคือสิ่งที่ท่านเห็นว่าควรปรับปรุง");
b.Property<DateTime?>("AppointDate")
.HasColumnType("datetime(6)")
.HasComment("กําหนดวันนัดหมายเพื่อทําการสัมภาษณ์การลาออก");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)")
.HasColumnOrder(100)
@ -14157,6 +14310,56 @@ namespace BMA.EHR.Infrastructure.Migrations
b.Navigation("Insignia");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Insignias.InsigniaManageOrganiation", b =>
{
b.HasOne("BMA.EHR.Domain.Models.Insignias.InsigniaManage", "InsigniaManage")
.WithMany("InsigniaManageOrganiations")
.HasForeignKey("InsigniaManageId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationOrganization", "OrganizationOrganization")
.WithMany()
.HasForeignKey("OrganizationOrganizationId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("InsigniaManage");
b.Navigation("OrganizationOrganization");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Insignias.InsigniaManageProfile", b =>
{
b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationOrganization", "BorrowOrganization")
.WithMany()
.HasForeignKey("BorrowOrganizationId");
b.HasOne("BMA.EHR.Domain.Models.Insignias.InsigniaManageOrganiation", "InsigniaManageOrganiation")
.WithMany("InsigniaManageProfiles")
.HasForeignKey("InsigniaManageOrganiationId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BMA.EHR.Domain.Models.Insignias.InsigniaNoteProfile", "InsigniaNoteProfile")
.WithMany()
.HasForeignKey("InsigniaNoteProfileId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationOrganization", "ReturnOrganization")
.WithMany()
.HasForeignKey("ReturnOrganizationId");
b.Navigation("BorrowOrganization");
b.Navigation("InsigniaManageOrganiation");
b.Navigation("InsigniaNoteProfile");
b.Navigation("ReturnOrganization");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Insignias.InsigniaNoteDoc", b =>
{
b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "Document")
@ -15604,6 +15807,16 @@ namespace BMA.EHR.Infrastructure.Migrations
b.Navigation("LimitTypeLeaves");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Insignias.InsigniaManage", b =>
{
b.Navigation("InsigniaManageOrganiations");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Insignias.InsigniaManageOrganiation", b =>
{
b.Navigation("InsigniaManageProfiles");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Insignias.InsigniaNote", b =>
{
b.Navigation("InsigniaNoteDocs");

View file

@ -309,6 +309,8 @@ namespace BMA.EHR.Infrastructure.Persistence
public DbSet<InsigniaNoteProfile> InsigniaNoteProfiles { get; set; }
public DbSet<InsigniaNote> InsigniaNotes { get; set; }
public DbSet<InsigniaNoteDoc> InsigniaNoteDocs { get; set; }
public DbSet<InsigniaManageOrganiation> InsigniaManageOrganiations { get; set; }
public DbSet<InsigniaManageProfile> InsigniaManageProfiles { get; set; }
#endregion