api สอบสวน

This commit is contained in:
Kittapath 2023-11-24 15:28:04 +07:00
parent ab171a7394
commit 4882995f47
34 changed files with 36995 additions and 69 deletions

View file

@ -0,0 +1,589 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
{
/// <inheritdoc />
public partial class addtableDisciplineDisciplinary : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "DisciplineInvestigate_Profiles");
migrationBuilder.AddColumn<Guid>(
name: "DisciplineDisciplinaryId",
table: "DisciplineInvestigateRelevant_Docs",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "DisciplineDisciplinaryId",
table: "DisciplineInvestigate_Docs",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "DisciplineDisciplinaryId",
table: "DisciplineInvestigate_DocComplaints",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "DisciplineDisciplinaryId",
table: "DisciplineInvestigate_Directors",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.CreateTable(
name: "DisciplineDisciplinary_DirectorInvestigates",
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"),
DisciplineDirectorId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
DisciplineInvestigateId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_DisciplineDisciplinary_DirectorInvestigates", x => x.Id);
table.ForeignKey(
name: "FK_DisciplineDisciplinary_DirectorInvestigates_DisciplineDirect~",
column: x => x.DisciplineDirectorId,
principalTable: "DisciplineDirectors",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DisciplineDisciplinary_DirectorInvestigates_DisciplineInvest~",
column: x => x.DisciplineInvestigateId,
principalTable: "DisciplineInvestigates",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "DisciplineDisciplinary_DocComplaintInvestigates",
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"),
DocumentId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
DisciplineInvestigateId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_DisciplineDisciplinary_DocComplaintInvestigates", x => x.Id);
table.ForeignKey(
name: "FK_DisciplineDisciplinary_DocComplaintInvestigates_DisciplineIn~",
column: x => x.DisciplineInvestigateId,
principalTable: "DisciplineInvestigates",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DisciplineDisciplinary_DocComplaintInvestigates_Documents_Do~",
column: x => x.DocumentId,
principalTable: "Documents",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "DisciplineDisciplinary_DocInvestigateRelevants",
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"),
DocumentId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
DisciplineInvestigateId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_DisciplineDisciplinary_DocInvestigateRelevants", x => x.Id);
table.ForeignKey(
name: "FK_DisciplineDisciplinary_DocInvestigateRelevants_DisciplineInv~",
column: x => x.DisciplineInvestigateId,
principalTable: "DisciplineInvestigates",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DisciplineDisciplinary_DocInvestigateRelevants_Documents_Doc~",
column: x => x.DocumentId,
principalTable: "Documents",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "DisciplineDisciplinary_DocInvestigates",
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"),
DocumentId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
DisciplineInvestigateId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_DisciplineDisciplinary_DocInvestigates", x => x.Id);
table.ForeignKey(
name: "FK_DisciplineDisciplinary_DocInvestigates_DisciplineInvestigate~",
column: x => x.DisciplineInvestigateId,
principalTable: "DisciplineInvestigates",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DisciplineDisciplinary_DocInvestigates_Documents_DocumentId",
column: x => x.DocumentId,
principalTable: "Documents",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "DisciplineDisciplinary_ProfileComplaintInvestigates",
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"),
PersonId = table.Column<Guid>(type: "char(36)", nullable: true, comment: "id อ้างอิง profile", collation: "ascii_general_ci"),
CitizenId = table.Column<string>(type: "varchar(13)", maxLength: 13, nullable: true, comment: "รหัสบัตรประชาชน")
.Annotation("MySql:CharSet", "utf8mb4"),
Prefix = table.Column<string>(type: "longtext", nullable: true, comment: "คำนำหน้า")
.Annotation("MySql:CharSet", "utf8mb4"),
FirstName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ชื่อ")
.Annotation("MySql:CharSet", "utf8mb4"),
LastName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false, comment: "นามสกุล")
.Annotation("MySql:CharSet", "utf8mb4"),
Organization = table.Column<string>(type: "longtext", nullable: true, comment: "สังกัด")
.Annotation("MySql:CharSet", "utf8mb4"),
Position = table.Column<string>(type: "longtext", nullable: true, comment: "ตำแหน่ง")
.Annotation("MySql:CharSet", "utf8mb4"),
PosNo = table.Column<string>(type: "longtext", nullable: true, comment: "เลขที่ตำแหน่ง")
.Annotation("MySql:CharSet", "utf8mb4"),
PositionLevel = table.Column<string>(type: "longtext", nullable: true, comment: "ระดับ")
.Annotation("MySql:CharSet", "utf8mb4"),
Salary = table.Column<double>(type: "double", nullable: true, comment: "เงินเดือน"),
DisciplineInvestigateId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_DisciplineDisciplinary_ProfileComplaintInvestigates", x => x.Id);
table.ForeignKey(
name: "FK_DisciplineDisciplinary_ProfileComplaintInvestigates_Discipli~",
column: x => x.DisciplineInvestigateId,
principalTable: "DisciplineInvestigates",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "DisciplineDisciplinarys",
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<string>(type: "longtext", nullable: false, comment: "สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)")
.Annotation("MySql:CharSet", "utf8mb4"),
RespondentType = table.Column<string>(type: "longtext", nullable: false, comment: "ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)")
.Annotation("MySql:CharSet", "utf8mb4"),
Title = table.Column<string>(type: "text", nullable: false, comment: "เรื่องที่ร้องเรียน")
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "text", nullable: false, comment: "รายละเอียดของเรื่องร้องเรียน")
.Annotation("MySql:CharSet", "utf8mb4"),
DateReceived = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ"),
LevelConsideration = table.Column<string>(type: "longtext", nullable: false, comment: "ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)")
.Annotation("MySql:CharSet", "utf8mb4"),
DateConsideration = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่กำหนดพิจารณา"),
OffenseDetails = table.Column<string>(type: "longtext", nullable: false, comment: "ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)")
.Annotation("MySql:CharSet", "utf8mb4"),
DateNotification = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "วันแจ้งเตือนล่วงหน้า"),
ComplaintFrom = table.Column<string>(type: "longtext", nullable: false, comment: "รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)")
.Annotation("MySql:CharSet", "utf8mb4"),
Appellant = table.Column<string>(type: "longtext", nullable: false, comment: "ผู้ร้องเรียน")
.Annotation("MySql:CharSet", "utf8mb4"),
ResultComplaint = table.Column<string>(type: "longtext", nullable: true, comment: "ผลการตรวจสอบเรื่องร้องเรียน")
.Annotation("MySql:CharSet", "utf8mb4"),
Result = table.Column<string>(type: "longtext", nullable: true, comment: "ผลการตรวจสอบ")
.Annotation("MySql:CharSet", "utf8mb4"),
Organization = table.Column<Guid>(type: "char(36)", nullable: true, comment: "กรณีหน่วยงานใส่ id ของหน่วยงาน", collation: "ascii_general_ci"),
ConsideredAgency = table.Column<Guid>(type: "char(36)", nullable: false, comment: "หน่วยงานที่พิจารณา จะเปลี่ยนไปตามผู้ถูกร้องดูรายละเอียดด้านล่าง", collation: "ascii_general_ci"),
InvestigationDetail = table.Column<string>(type: "longtext", nullable: true, comment: "ลักษณะการสืบสวน (appoint_directors คือ แต่งตั้งกรรมการสืบสวน, secret_investigation คือ สืบสวนทางลับ, other คือ อื่น ๆ)")
.Annotation("MySql:CharSet", "utf8mb4"),
InvestigationDetailOther = table.Column<string>(type: "longtext", nullable: true, comment: "ลักษณะการสืบสวนกรณีเลือกอื่นๆ")
.Annotation("MySql:CharSet", "utf8mb4"),
InvestigationDateStart = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่เริ่มการสอบสวน"),
InvestigationDateEnd = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่สิ้นสุดการสอบสวน"),
InvestigationDescription = table.Column<string>(type: "longtext", nullable: true, comment: "รายละเอียดเกี่ยวกับการสืบสวน")
.Annotation("MySql:CharSet", "utf8mb4"),
InvestigationStatusResult = table.Column<string>(type: "longtext", nullable: true, comment: "สถานะหรือผลการสืบสวน (not_specified คือ ยังไม่ระบุ, have_cause คือ มีมูล, no_cause คือ ไม่มีมูล")
.Annotation("MySql:CharSet", "utf8mb4"),
InvestigationCauseText = table.Column<string>(type: "longtext", nullable: true, comment: "กรณีมีมูลต้องเลือกว่า 'ร้ายแรง' หรือ 'ไม่ร้ายแรง'")
.Annotation("MySql:CharSet", "utf8mb4"),
DisciplineComplaintId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_DisciplineDisciplinarys", x => x.Id);
table.ForeignKey(
name: "FK_DisciplineDisciplinarys_DisciplineComplaints_DisciplineCompl~",
column: x => x.DisciplineComplaintId,
principalTable: "DisciplineComplaints",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "DisciplineInvestigate_ProfileComplaints",
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"),
PersonId = table.Column<Guid>(type: "char(36)", nullable: true, comment: "id อ้างอิง profile", collation: "ascii_general_ci"),
CitizenId = table.Column<string>(type: "varchar(13)", maxLength: 13, nullable: true, comment: "รหัสบัตรประชาชน")
.Annotation("MySql:CharSet", "utf8mb4"),
Prefix = table.Column<string>(type: "longtext", nullable: true, comment: "คำนำหน้า")
.Annotation("MySql:CharSet", "utf8mb4"),
FirstName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ชื่อ")
.Annotation("MySql:CharSet", "utf8mb4"),
LastName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false, comment: "นามสกุล")
.Annotation("MySql:CharSet", "utf8mb4"),
Organization = table.Column<string>(type: "longtext", nullable: true, comment: "สังกัด")
.Annotation("MySql:CharSet", "utf8mb4"),
Position = table.Column<string>(type: "longtext", nullable: true, comment: "ตำแหน่ง")
.Annotation("MySql:CharSet", "utf8mb4"),
PosNo = table.Column<string>(type: "longtext", nullable: true, comment: "เลขที่ตำแหน่ง")
.Annotation("MySql:CharSet", "utf8mb4"),
PositionLevel = table.Column<string>(type: "longtext", nullable: true, comment: "ระดับ")
.Annotation("MySql:CharSet", "utf8mb4"),
Salary = table.Column<double>(type: "double", nullable: true, comment: "เงินเดือน"),
DisciplineInvestigateId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
DisciplineDisciplinaryId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_DisciplineInvestigate_ProfileComplaints", x => x.Id);
table.ForeignKey(
name: "FK_DisciplineInvestigate_ProfileComplaints_DisciplineDisciplina~",
column: x => x.DisciplineDisciplinaryId,
principalTable: "DisciplineDisciplinarys",
principalColumn: "Id");
table.ForeignKey(
name: "FK_DisciplineInvestigate_ProfileComplaints_DisciplineInvestigat~",
column: x => x.DisciplineInvestigateId,
principalTable: "DisciplineInvestigates",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_DisciplineInvestigateRelevant_Docs_DisciplineDisciplinaryId",
table: "DisciplineInvestigateRelevant_Docs",
column: "DisciplineDisciplinaryId");
migrationBuilder.CreateIndex(
name: "IX_DisciplineInvestigate_Docs_DisciplineDisciplinaryId",
table: "DisciplineInvestigate_Docs",
column: "DisciplineDisciplinaryId");
migrationBuilder.CreateIndex(
name: "IX_DisciplineInvestigate_DocComplaints_DisciplineDisciplinaryId",
table: "DisciplineInvestigate_DocComplaints",
column: "DisciplineDisciplinaryId");
migrationBuilder.CreateIndex(
name: "IX_DisciplineInvestigate_Directors_DisciplineDisciplinaryId",
table: "DisciplineInvestigate_Directors",
column: "DisciplineDisciplinaryId");
migrationBuilder.CreateIndex(
name: "IX_DisciplineDisciplinary_DirectorInvestigates_DisciplineDirect~",
table: "DisciplineDisciplinary_DirectorInvestigates",
column: "DisciplineDirectorId");
migrationBuilder.CreateIndex(
name: "IX_DisciplineDisciplinary_DirectorInvestigates_DisciplineInvest~",
table: "DisciplineDisciplinary_DirectorInvestigates",
column: "DisciplineInvestigateId");
migrationBuilder.CreateIndex(
name: "IX_DisciplineDisciplinary_DocComplaintInvestigates_DisciplineIn~",
table: "DisciplineDisciplinary_DocComplaintInvestigates",
column: "DisciplineInvestigateId");
migrationBuilder.CreateIndex(
name: "IX_DisciplineDisciplinary_DocComplaintInvestigates_DocumentId",
table: "DisciplineDisciplinary_DocComplaintInvestigates",
column: "DocumentId");
migrationBuilder.CreateIndex(
name: "IX_DisciplineDisciplinary_DocInvestigateRelevants_DisciplineInv~",
table: "DisciplineDisciplinary_DocInvestigateRelevants",
column: "DisciplineInvestigateId");
migrationBuilder.CreateIndex(
name: "IX_DisciplineDisciplinary_DocInvestigateRelevants_DocumentId",
table: "DisciplineDisciplinary_DocInvestigateRelevants",
column: "DocumentId");
migrationBuilder.CreateIndex(
name: "IX_DisciplineDisciplinary_DocInvestigates_DisciplineInvestigate~",
table: "DisciplineDisciplinary_DocInvestigates",
column: "DisciplineInvestigateId");
migrationBuilder.CreateIndex(
name: "IX_DisciplineDisciplinary_DocInvestigates_DocumentId",
table: "DisciplineDisciplinary_DocInvestigates",
column: "DocumentId");
migrationBuilder.CreateIndex(
name: "IX_DisciplineDisciplinary_ProfileComplaintInvestigates_Discipli~",
table: "DisciplineDisciplinary_ProfileComplaintInvestigates",
column: "DisciplineInvestigateId");
migrationBuilder.CreateIndex(
name: "IX_DisciplineDisciplinarys_DisciplineComplaintId",
table: "DisciplineDisciplinarys",
column: "DisciplineComplaintId");
migrationBuilder.CreateIndex(
name: "IX_DisciplineInvestigate_ProfileComplaints_DisciplineDisciplina~",
table: "DisciplineInvestigate_ProfileComplaints",
column: "DisciplineDisciplinaryId");
migrationBuilder.CreateIndex(
name: "IX_DisciplineInvestigate_ProfileComplaints_DisciplineInvestigat~",
table: "DisciplineInvestigate_ProfileComplaints",
column: "DisciplineInvestigateId");
migrationBuilder.AddForeignKey(
name: "FK_DisciplineInvestigate_Directors_DisciplineDisciplinarys_Disc~",
table: "DisciplineInvestigate_Directors",
column: "DisciplineDisciplinaryId",
principalTable: "DisciplineDisciplinarys",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_DisciplineInvestigate_DocComplaints_DisciplineDisciplinarys_~",
table: "DisciplineInvestigate_DocComplaints",
column: "DisciplineDisciplinaryId",
principalTable: "DisciplineDisciplinarys",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_DisciplineInvestigate_Docs_DisciplineDisciplinarys_Disciplin~",
table: "DisciplineInvestigate_Docs",
column: "DisciplineDisciplinaryId",
principalTable: "DisciplineDisciplinarys",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_DisciplineInvestigateRelevant_Docs_DisciplineDisciplinarys_D~",
table: "DisciplineInvestigateRelevant_Docs",
column: "DisciplineDisciplinaryId",
principalTable: "DisciplineDisciplinarys",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_DisciplineInvestigate_Directors_DisciplineDisciplinarys_Disc~",
table: "DisciplineInvestigate_Directors");
migrationBuilder.DropForeignKey(
name: "FK_DisciplineInvestigate_DocComplaints_DisciplineDisciplinarys_~",
table: "DisciplineInvestigate_DocComplaints");
migrationBuilder.DropForeignKey(
name: "FK_DisciplineInvestigate_Docs_DisciplineDisciplinarys_Disciplin~",
table: "DisciplineInvestigate_Docs");
migrationBuilder.DropForeignKey(
name: "FK_DisciplineInvestigateRelevant_Docs_DisciplineDisciplinarys_D~",
table: "DisciplineInvestigateRelevant_Docs");
migrationBuilder.DropTable(
name: "DisciplineDisciplinary_DirectorInvestigates");
migrationBuilder.DropTable(
name: "DisciplineDisciplinary_DocComplaintInvestigates");
migrationBuilder.DropTable(
name: "DisciplineDisciplinary_DocInvestigateRelevants");
migrationBuilder.DropTable(
name: "DisciplineDisciplinary_DocInvestigates");
migrationBuilder.DropTable(
name: "DisciplineDisciplinary_ProfileComplaintInvestigates");
migrationBuilder.DropTable(
name: "DisciplineInvestigate_ProfileComplaints");
migrationBuilder.DropTable(
name: "DisciplineDisciplinarys");
migrationBuilder.DropIndex(
name: "IX_DisciplineInvestigateRelevant_Docs_DisciplineDisciplinaryId",
table: "DisciplineInvestigateRelevant_Docs");
migrationBuilder.DropIndex(
name: "IX_DisciplineInvestigate_Docs_DisciplineDisciplinaryId",
table: "DisciplineInvestigate_Docs");
migrationBuilder.DropIndex(
name: "IX_DisciplineInvestigate_DocComplaints_DisciplineDisciplinaryId",
table: "DisciplineInvestigate_DocComplaints");
migrationBuilder.DropIndex(
name: "IX_DisciplineInvestigate_Directors_DisciplineDisciplinaryId",
table: "DisciplineInvestigate_Directors");
migrationBuilder.DropColumn(
name: "DisciplineDisciplinaryId",
table: "DisciplineInvestigateRelevant_Docs");
migrationBuilder.DropColumn(
name: "DisciplineDisciplinaryId",
table: "DisciplineInvestigate_Docs");
migrationBuilder.DropColumn(
name: "DisciplineDisciplinaryId",
table: "DisciplineInvestigate_DocComplaints");
migrationBuilder.DropColumn(
name: "DisciplineDisciplinaryId",
table: "DisciplineInvestigate_Directors");
migrationBuilder.CreateTable(
name: "DisciplineInvestigate_Profiles",
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"),
DisciplineInvestigateId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
CitizenId = table.Column<string>(type: "varchar(13)", maxLength: 13, nullable: true, comment: "รหัสบัตรประชาชน")
.Annotation("MySql:CharSet", "utf8mb4"),
FirstName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ชื่อ")
.Annotation("MySql:CharSet", "utf8mb4"),
LastName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false, comment: "นามสกุล")
.Annotation("MySql:CharSet", "utf8mb4"),
Organization = table.Column<string>(type: "longtext", nullable: true, comment: "สังกัด")
.Annotation("MySql:CharSet", "utf8mb4"),
PersonId = table.Column<Guid>(type: "char(36)", nullable: true, comment: "id อ้างอิง profile", collation: "ascii_general_ci"),
PosNo = table.Column<string>(type: "longtext", nullable: true, comment: "เลขที่ตำแหน่ง")
.Annotation("MySql:CharSet", "utf8mb4"),
Position = table.Column<string>(type: "longtext", nullable: true, comment: "ตำแหน่ง")
.Annotation("MySql:CharSet", "utf8mb4"),
PositionLevel = table.Column<string>(type: "longtext", nullable: true, comment: "ระดับ")
.Annotation("MySql:CharSet", "utf8mb4"),
Prefix = table.Column<string>(type: "longtext", nullable: true, comment: "คำนำหน้า")
.Annotation("MySql:CharSet", "utf8mb4"),
Salary = table.Column<double>(type: "double", nullable: true, comment: "เงินเดือน")
},
constraints: table =>
{
table.PrimaryKey("PK_DisciplineInvestigate_Profiles", x => x.Id);
table.ForeignKey(
name: "FK_DisciplineInvestigate_Profiles_DisciplineInvestigates_Discip~",
column: x => x.DisciplineInvestigateId,
principalTable: "DisciplineInvestigates",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_DisciplineInvestigate_Profiles_DisciplineInvestigateId",
table: "DisciplineInvestigate_Profiles",
column: "DisciplineInvestigateId");
}
}
}

View file

@ -0,0 +1,794 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
{
/// <inheritdoc />
public partial class addtableDisciplineDisciplinary_DocOthers : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_DisciplineDisciplinary_DirectorInvestigates_DisciplineInvest~",
table: "DisciplineDisciplinary_DirectorInvestigates");
migrationBuilder.DropForeignKey(
name: "FK_DisciplineDisciplinary_DocComplaintInvestigates_DisciplineIn~",
table: "DisciplineDisciplinary_DocComplaintInvestigates");
migrationBuilder.DropForeignKey(
name: "FK_DisciplineDisciplinary_DocInvestigateRelevants_DisciplineInv~",
table: "DisciplineDisciplinary_DocInvestigateRelevants");
migrationBuilder.DropForeignKey(
name: "FK_DisciplineDisciplinary_DocInvestigates_DisciplineInvestigate~",
table: "DisciplineDisciplinary_DocInvestigates");
migrationBuilder.DropForeignKey(
name: "FK_DisciplineDisciplinary_ProfileComplaintInvestigates_Discipli~",
table: "DisciplineDisciplinary_ProfileComplaintInvestigates");
migrationBuilder.DropForeignKey(
name: "FK_DisciplineDisciplinarys_DisciplineComplaints_DisciplineCompl~",
table: "DisciplineDisciplinarys");
migrationBuilder.DropForeignKey(
name: "FK_DisciplineInvestigate_Directors_DisciplineDisciplinarys_Disc~",
table: "DisciplineInvestigate_Directors");
migrationBuilder.DropForeignKey(
name: "FK_DisciplineInvestigate_DocComplaints_DisciplineDisciplinarys_~",
table: "DisciplineInvestigate_DocComplaints");
migrationBuilder.DropForeignKey(
name: "FK_DisciplineInvestigate_Docs_DisciplineDisciplinarys_Disciplin~",
table: "DisciplineInvestigate_Docs");
migrationBuilder.DropForeignKey(
name: "FK_DisciplineInvestigate_ProfileComplaints_DisciplineDisciplina~",
table: "DisciplineInvestigate_ProfileComplaints");
migrationBuilder.DropForeignKey(
name: "FK_DisciplineInvestigateRelevant_Docs_DisciplineDisciplinarys_D~",
table: "DisciplineInvestigateRelevant_Docs");
migrationBuilder.DropIndex(
name: "IX_DisciplineInvestigateRelevant_Docs_DisciplineDisciplinaryId",
table: "DisciplineInvestigateRelevant_Docs");
migrationBuilder.DropIndex(
name: "IX_DisciplineInvestigate_ProfileComplaints_DisciplineDisciplina~",
table: "DisciplineInvestigate_ProfileComplaints");
migrationBuilder.DropIndex(
name: "IX_DisciplineInvestigate_Docs_DisciplineDisciplinaryId",
table: "DisciplineInvestigate_Docs");
migrationBuilder.DropIndex(
name: "IX_DisciplineInvestigate_DocComplaints_DisciplineDisciplinaryId",
table: "DisciplineInvestigate_DocComplaints");
migrationBuilder.DropIndex(
name: "IX_DisciplineInvestigate_Directors_DisciplineDisciplinaryId",
table: "DisciplineInvestigate_Directors");
migrationBuilder.DropColumn(
name: "DisciplineDisciplinaryId",
table: "DisciplineInvestigateRelevant_Docs");
migrationBuilder.DropColumn(
name: "DisciplineDisciplinaryId",
table: "DisciplineInvestigate_ProfileComplaints");
migrationBuilder.DropColumn(
name: "DisciplineDisciplinaryId",
table: "DisciplineInvestigate_Docs");
migrationBuilder.DropColumn(
name: "DisciplineDisciplinaryId",
table: "DisciplineInvestigate_DocComplaints");
migrationBuilder.DropColumn(
name: "DisciplineDisciplinaryId",
table: "DisciplineInvestigate_Directors");
migrationBuilder.RenameColumn(
name: "DisciplineComplaintId",
table: "DisciplineDisciplinarys",
newName: "DisciplineInvestigateId");
migrationBuilder.RenameIndex(
name: "IX_DisciplineDisciplinarys_DisciplineComplaintId",
table: "DisciplineDisciplinarys",
newName: "IX_DisciplineDisciplinarys_DisciplineInvestigateId");
migrationBuilder.RenameColumn(
name: "DisciplineInvestigateId",
table: "DisciplineDisciplinary_ProfileComplaintInvestigates",
newName: "DisciplineDisciplinaryId");
migrationBuilder.RenameColumn(
name: "DisciplineInvestigateId",
table: "DisciplineDisciplinary_DocInvestigates",
newName: "DisciplineDisciplinaryId");
migrationBuilder.RenameIndex(
name: "IX_DisciplineDisciplinary_DocInvestigates_DisciplineInvestigate~",
table: "DisciplineDisciplinary_DocInvestigates",
newName: "IX_DisciplineDisciplinary_DocInvestigates_DisciplineDisciplinar~");
migrationBuilder.RenameColumn(
name: "DisciplineInvestigateId",
table: "DisciplineDisciplinary_DocInvestigateRelevants",
newName: "DisciplineDisciplinaryId");
migrationBuilder.RenameIndex(
name: "IX_DisciplineDisciplinary_DocInvestigateRelevants_DisciplineInv~",
table: "DisciplineDisciplinary_DocInvestigateRelevants",
newName: "IX_DisciplineDisciplinary_DocInvestigateRelevants_DisciplineDis~");
migrationBuilder.RenameColumn(
name: "DisciplineInvestigateId",
table: "DisciplineDisciplinary_DocComplaintInvestigates",
newName: "DisciplineDisciplinaryId");
migrationBuilder.RenameIndex(
name: "IX_DisciplineDisciplinary_DocComplaintInvestigates_DisciplineIn~",
table: "DisciplineDisciplinary_DocComplaintInvestigates",
newName: "IX_DisciplineDisciplinary_DocComplaintInvestigates_DisciplineDi~");
migrationBuilder.RenameColumn(
name: "DisciplineInvestigateId",
table: "DisciplineDisciplinary_DirectorInvestigates",
newName: "DisciplineDisciplinaryId");
migrationBuilder.RenameIndex(
name: "IX_DisciplineDisciplinary_DirectorInvestigates_DisciplineInvest~",
table: "DisciplineDisciplinary_DirectorInvestigates",
newName: "IX_DisciplineDisciplinary_DirectorInvestigates_DisciplineDiscip~");
migrationBuilder.AlterColumn<string>(
name: "InvestigationStatusResult",
table: "DisciplineDisciplinarys",
type: "longtext",
nullable: true,
comment: "สถานะหรือผลการสืบสวน (NOT_SPECIFIED คือ ยังไม่ระบุ, HAVE_CAUSE คือ มีมูล, NO_CAUSE คือ ไม่มีมูล",
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true,
oldComment: "สถานะหรือผลการสืบสวน (not_specified คือ ยังไม่ระบุ, have_cause คือ มีมูล, no_cause คือ ไม่มีมูล")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "InvestigationDetail",
table: "DisciplineDisciplinarys",
type: "longtext",
nullable: true,
comment: "ลักษณะการสืบสวน (APPOINT_DIRECTORS คือ แต่งตั้งกรรมการสืบสวน, SECRET_INVESTIGATION คือ สืบสวนทางลับ, OTHER คือ อื่น ๆ)",
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true,
oldComment: "ลักษณะการสืบสวน (appoint_directors คือ แต่งตั้งกรรมการสืบสวน, secret_investigation คือ สืบสวนทางลับ, other คือ อื่น ๆ)")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "DisciplinaryCaseFault",
table: "DisciplineDisciplinarys",
type: "longtext",
nullable: true,
comment: "กรณีความผิด")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<DateTime>(
name: "DisciplinaryDateAllegation",
table: "DisciplineDisciplinarys",
type: "datetime(6)",
nullable: true,
comment: "วันที่รับทราบข้อกล่าวหา");
migrationBuilder.AddColumn<DateTime>(
name: "DisciplinaryDateEvident",
table: "DisciplineDisciplinarys",
type: "datetime(6)",
nullable: true,
comment: "วันที่สรุปพยานหลักฐาน");
migrationBuilder.AddColumn<string>(
name: "DisciplinaryFaultLevel",
table: "DisciplineDisciplinarys",
type: "longtext",
nullable: true,
comment: "ระดับโทษความผิด กรณีไม่ร้ายแรง: ภาคทัณฑ์, ตัดเงินเดือน, ลดขั้นเงินเดือน | กรณีร้ายแรง: ปลดออก, ไล่ออก")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "DisciplinaryInvestigateAt",
table: "DisciplineDisciplinarys",
type: "longtext",
nullable: true,
comment: "สอบสวนที่")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "DisciplinaryRecordAccuser",
table: "DisciplineDisciplinarys",
type: "longtext",
nullable: true,
comment: "บันทึกถ้อยคำของผู้กล่าวหา")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "DisciplinaryRefLaw",
table: "DisciplineDisciplinarys",
type: "longtext",
nullable: true,
comment: "อ้างอิงมาตราตามกฎหมาย")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "DisciplinarySummaryEvidence",
table: "DisciplineDisciplinarys",
type: "longtext",
nullable: true,
comment: "สรุปพยานหลักฐานสนับสนุนข้อกล่าวหา")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "DisciplinaryWitnesses",
table: "DisciplineDisciplinarys",
type: "longtext",
nullable: true,
comment: "พยานและบันทึกถ้อยคำพยาน")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "ResultInvestigate",
table: "DisciplineDisciplinarys",
type: "longtext",
nullable: true,
comment: "ผลการตรวจสอบเรื่องสืบสวน")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "DisciplineDisciplinary_DocOthers",
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"),
DocumentId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
DisciplineDisciplinaryId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_DisciplineDisciplinary_DocOthers", x => x.Id);
table.ForeignKey(
name: "FK_DisciplineDisciplinary_DocOthers_DisciplineDisciplinarys_Dis~",
column: x => x.DisciplineDisciplinaryId,
principalTable: "DisciplineDisciplinarys",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DisciplineDisciplinary_DocOthers_Documents_DocumentId",
column: x => x.DocumentId,
principalTable: "Documents",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "DisciplineDisciplinary_DocRecordAccusers",
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"),
DocumentId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
DisciplineDisciplinaryId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_DisciplineDisciplinary_DocRecordAccusers", x => x.Id);
table.ForeignKey(
name: "FK_DisciplineDisciplinary_DocRecordAccusers_DisciplineDisciplin~",
column: x => x.DisciplineDisciplinaryId,
principalTable: "DisciplineDisciplinarys",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DisciplineDisciplinary_DocRecordAccusers_Documents_DocumentId",
column: x => x.DocumentId,
principalTable: "Documents",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "DisciplineDisciplinary_DocSummaryEvidences",
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"),
DocumentId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
DisciplineDisciplinaryId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_DisciplineDisciplinary_DocSummaryEvidences", x => x.Id);
table.ForeignKey(
name: "FK_DisciplineDisciplinary_DocSummaryEvidences_DisciplineDiscipl~",
column: x => x.DisciplineDisciplinaryId,
principalTable: "DisciplineDisciplinarys",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DisciplineDisciplinary_DocSummaryEvidences_Documents_Documen~",
column: x => x.DocumentId,
principalTable: "Documents",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "DisciplineDisciplinary_DocWitnessess",
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"),
DocumentId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
DisciplineDisciplinaryId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_DisciplineDisciplinary_DocWitnessess", x => x.Id);
table.ForeignKey(
name: "FK_DisciplineDisciplinary_DocWitnessess_DisciplineDisciplinarys~",
column: x => x.DisciplineDisciplinaryId,
principalTable: "DisciplineDisciplinarys",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DisciplineDisciplinary_DocWitnessess_Documents_DocumentId",
column: x => x.DocumentId,
principalTable: "Documents",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_DisciplineDisciplinary_DocOthers_DisciplineDisciplinaryId",
table: "DisciplineDisciplinary_DocOthers",
column: "DisciplineDisciplinaryId");
migrationBuilder.CreateIndex(
name: "IX_DisciplineDisciplinary_DocOthers_DocumentId",
table: "DisciplineDisciplinary_DocOthers",
column: "DocumentId");
migrationBuilder.CreateIndex(
name: "IX_DisciplineDisciplinary_DocRecordAccusers_DisciplineDisciplin~",
table: "DisciplineDisciplinary_DocRecordAccusers",
column: "DisciplineDisciplinaryId");
migrationBuilder.CreateIndex(
name: "IX_DisciplineDisciplinary_DocRecordAccusers_DocumentId",
table: "DisciplineDisciplinary_DocRecordAccusers",
column: "DocumentId");
migrationBuilder.CreateIndex(
name: "IX_DisciplineDisciplinary_DocSummaryEvidences_DisciplineDiscipl~",
table: "DisciplineDisciplinary_DocSummaryEvidences",
column: "DisciplineDisciplinaryId");
migrationBuilder.CreateIndex(
name: "IX_DisciplineDisciplinary_DocSummaryEvidences_DocumentId",
table: "DisciplineDisciplinary_DocSummaryEvidences",
column: "DocumentId");
migrationBuilder.CreateIndex(
name: "IX_DisciplineDisciplinary_DocWitnessess_DisciplineDisciplinaryId",
table: "DisciplineDisciplinary_DocWitnessess",
column: "DisciplineDisciplinaryId");
migrationBuilder.CreateIndex(
name: "IX_DisciplineDisciplinary_DocWitnessess_DocumentId",
table: "DisciplineDisciplinary_DocWitnessess",
column: "DocumentId");
migrationBuilder.AddForeignKey(
name: "FK_DisciplineDisciplinary_DirectorInvestigates_DisciplineDiscip~",
table: "DisciplineDisciplinary_DirectorInvestigates",
column: "DisciplineDisciplinaryId",
principalTable: "DisciplineDisciplinarys",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_DisciplineDisciplinary_DocComplaintInvestigates_DisciplineDi~",
table: "DisciplineDisciplinary_DocComplaintInvestigates",
column: "DisciplineDisciplinaryId",
principalTable: "DisciplineDisciplinarys",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_DisciplineDisciplinary_DocInvestigateRelevants_DisciplineDis~",
table: "DisciplineDisciplinary_DocInvestigateRelevants",
column: "DisciplineDisciplinaryId",
principalTable: "DisciplineDisciplinarys",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_DisciplineDisciplinary_DocInvestigates_DisciplineDisciplinar~",
table: "DisciplineDisciplinary_DocInvestigates",
column: "DisciplineDisciplinaryId",
principalTable: "DisciplineDisciplinarys",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_DisciplineDisciplinary_ProfileComplaintInvestigates_Discipli~",
table: "DisciplineDisciplinary_ProfileComplaintInvestigates",
column: "DisciplineDisciplinaryId",
principalTable: "DisciplineDisciplinarys",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_DisciplineDisciplinarys_DisciplineInvestigates_DisciplineInv~",
table: "DisciplineDisciplinarys",
column: "DisciplineInvestigateId",
principalTable: "DisciplineInvestigates",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_DisciplineDisciplinary_DirectorInvestigates_DisciplineDiscip~",
table: "DisciplineDisciplinary_DirectorInvestigates");
migrationBuilder.DropForeignKey(
name: "FK_DisciplineDisciplinary_DocComplaintInvestigates_DisciplineDi~",
table: "DisciplineDisciplinary_DocComplaintInvestigates");
migrationBuilder.DropForeignKey(
name: "FK_DisciplineDisciplinary_DocInvestigateRelevants_DisciplineDis~",
table: "DisciplineDisciplinary_DocInvestigateRelevants");
migrationBuilder.DropForeignKey(
name: "FK_DisciplineDisciplinary_DocInvestigates_DisciplineDisciplinar~",
table: "DisciplineDisciplinary_DocInvestigates");
migrationBuilder.DropForeignKey(
name: "FK_DisciplineDisciplinary_ProfileComplaintInvestigates_Discipli~",
table: "DisciplineDisciplinary_ProfileComplaintInvestigates");
migrationBuilder.DropForeignKey(
name: "FK_DisciplineDisciplinarys_DisciplineInvestigates_DisciplineInv~",
table: "DisciplineDisciplinarys");
migrationBuilder.DropTable(
name: "DisciplineDisciplinary_DocOthers");
migrationBuilder.DropTable(
name: "DisciplineDisciplinary_DocRecordAccusers");
migrationBuilder.DropTable(
name: "DisciplineDisciplinary_DocSummaryEvidences");
migrationBuilder.DropTable(
name: "DisciplineDisciplinary_DocWitnessess");
migrationBuilder.DropColumn(
name: "DisciplinaryCaseFault",
table: "DisciplineDisciplinarys");
migrationBuilder.DropColumn(
name: "DisciplinaryDateAllegation",
table: "DisciplineDisciplinarys");
migrationBuilder.DropColumn(
name: "DisciplinaryDateEvident",
table: "DisciplineDisciplinarys");
migrationBuilder.DropColumn(
name: "DisciplinaryFaultLevel",
table: "DisciplineDisciplinarys");
migrationBuilder.DropColumn(
name: "DisciplinaryInvestigateAt",
table: "DisciplineDisciplinarys");
migrationBuilder.DropColumn(
name: "DisciplinaryRecordAccuser",
table: "DisciplineDisciplinarys");
migrationBuilder.DropColumn(
name: "DisciplinaryRefLaw",
table: "DisciplineDisciplinarys");
migrationBuilder.DropColumn(
name: "DisciplinarySummaryEvidence",
table: "DisciplineDisciplinarys");
migrationBuilder.DropColumn(
name: "DisciplinaryWitnesses",
table: "DisciplineDisciplinarys");
migrationBuilder.DropColumn(
name: "ResultInvestigate",
table: "DisciplineDisciplinarys");
migrationBuilder.RenameColumn(
name: "DisciplineInvestigateId",
table: "DisciplineDisciplinarys",
newName: "DisciplineComplaintId");
migrationBuilder.RenameIndex(
name: "IX_DisciplineDisciplinarys_DisciplineInvestigateId",
table: "DisciplineDisciplinarys",
newName: "IX_DisciplineDisciplinarys_DisciplineComplaintId");
migrationBuilder.RenameColumn(
name: "DisciplineDisciplinaryId",
table: "DisciplineDisciplinary_ProfileComplaintInvestigates",
newName: "DisciplineInvestigateId");
migrationBuilder.RenameColumn(
name: "DisciplineDisciplinaryId",
table: "DisciplineDisciplinary_DocInvestigates",
newName: "DisciplineInvestigateId");
migrationBuilder.RenameIndex(
name: "IX_DisciplineDisciplinary_DocInvestigates_DisciplineDisciplinar~",
table: "DisciplineDisciplinary_DocInvestigates",
newName: "IX_DisciplineDisciplinary_DocInvestigates_DisciplineInvestigate~");
migrationBuilder.RenameColumn(
name: "DisciplineDisciplinaryId",
table: "DisciplineDisciplinary_DocInvestigateRelevants",
newName: "DisciplineInvestigateId");
migrationBuilder.RenameIndex(
name: "IX_DisciplineDisciplinary_DocInvestigateRelevants_DisciplineDis~",
table: "DisciplineDisciplinary_DocInvestigateRelevants",
newName: "IX_DisciplineDisciplinary_DocInvestigateRelevants_DisciplineInv~");
migrationBuilder.RenameColumn(
name: "DisciplineDisciplinaryId",
table: "DisciplineDisciplinary_DocComplaintInvestigates",
newName: "DisciplineInvestigateId");
migrationBuilder.RenameIndex(
name: "IX_DisciplineDisciplinary_DocComplaintInvestigates_DisciplineDi~",
table: "DisciplineDisciplinary_DocComplaintInvestigates",
newName: "IX_DisciplineDisciplinary_DocComplaintInvestigates_DisciplineIn~");
migrationBuilder.RenameColumn(
name: "DisciplineDisciplinaryId",
table: "DisciplineDisciplinary_DirectorInvestigates",
newName: "DisciplineInvestigateId");
migrationBuilder.RenameIndex(
name: "IX_DisciplineDisciplinary_DirectorInvestigates_DisciplineDiscip~",
table: "DisciplineDisciplinary_DirectorInvestigates",
newName: "IX_DisciplineDisciplinary_DirectorInvestigates_DisciplineInvest~");
migrationBuilder.AddColumn<Guid>(
name: "DisciplineDisciplinaryId",
table: "DisciplineInvestigateRelevant_Docs",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "DisciplineDisciplinaryId",
table: "DisciplineInvestigate_ProfileComplaints",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "DisciplineDisciplinaryId",
table: "DisciplineInvestigate_Docs",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "DisciplineDisciplinaryId",
table: "DisciplineInvestigate_DocComplaints",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "DisciplineDisciplinaryId",
table: "DisciplineInvestigate_Directors",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AlterColumn<string>(
name: "InvestigationStatusResult",
table: "DisciplineDisciplinarys",
type: "longtext",
nullable: true,
comment: "สถานะหรือผลการสืบสวน (not_specified คือ ยังไม่ระบุ, have_cause คือ มีมูล, no_cause คือ ไม่มีมูล",
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true,
oldComment: "สถานะหรือผลการสืบสวน (NOT_SPECIFIED คือ ยังไม่ระบุ, HAVE_CAUSE คือ มีมูล, NO_CAUSE คือ ไม่มีมูล")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "InvestigationDetail",
table: "DisciplineDisciplinarys",
type: "longtext",
nullable: true,
comment: "ลักษณะการสืบสวน (appoint_directors คือ แต่งตั้งกรรมการสืบสวน, secret_investigation คือ สืบสวนทางลับ, other คือ อื่น ๆ)",
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true,
oldComment: "ลักษณะการสืบสวน (APPOINT_DIRECTORS คือ แต่งตั้งกรรมการสืบสวน, SECRET_INVESTIGATION คือ สืบสวนทางลับ, OTHER คือ อื่น ๆ)")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_DisciplineInvestigateRelevant_Docs_DisciplineDisciplinaryId",
table: "DisciplineInvestigateRelevant_Docs",
column: "DisciplineDisciplinaryId");
migrationBuilder.CreateIndex(
name: "IX_DisciplineInvestigate_ProfileComplaints_DisciplineDisciplina~",
table: "DisciplineInvestigate_ProfileComplaints",
column: "DisciplineDisciplinaryId");
migrationBuilder.CreateIndex(
name: "IX_DisciplineInvestigate_Docs_DisciplineDisciplinaryId",
table: "DisciplineInvestigate_Docs",
column: "DisciplineDisciplinaryId");
migrationBuilder.CreateIndex(
name: "IX_DisciplineInvestigate_DocComplaints_DisciplineDisciplinaryId",
table: "DisciplineInvestigate_DocComplaints",
column: "DisciplineDisciplinaryId");
migrationBuilder.CreateIndex(
name: "IX_DisciplineInvestigate_Directors_DisciplineDisciplinaryId",
table: "DisciplineInvestigate_Directors",
column: "DisciplineDisciplinaryId");
migrationBuilder.AddForeignKey(
name: "FK_DisciplineDisciplinary_DirectorInvestigates_DisciplineInvest~",
table: "DisciplineDisciplinary_DirectorInvestigates",
column: "DisciplineInvestigateId",
principalTable: "DisciplineInvestigates",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_DisciplineDisciplinary_DocComplaintInvestigates_DisciplineIn~",
table: "DisciplineDisciplinary_DocComplaintInvestigates",
column: "DisciplineInvestigateId",
principalTable: "DisciplineInvestigates",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_DisciplineDisciplinary_DocInvestigateRelevants_DisciplineInv~",
table: "DisciplineDisciplinary_DocInvestigateRelevants",
column: "DisciplineInvestigateId",
principalTable: "DisciplineInvestigates",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_DisciplineDisciplinary_DocInvestigates_DisciplineInvestigate~",
table: "DisciplineDisciplinary_DocInvestigates",
column: "DisciplineInvestigateId",
principalTable: "DisciplineInvestigates",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_DisciplineDisciplinary_ProfileComplaintInvestigates_Discipli~",
table: "DisciplineDisciplinary_ProfileComplaintInvestigates",
column: "DisciplineInvestigateId",
principalTable: "DisciplineInvestigates",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_DisciplineDisciplinarys_DisciplineComplaints_DisciplineCompl~",
table: "DisciplineDisciplinarys",
column: "DisciplineComplaintId",
principalTable: "DisciplineComplaints",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_DisciplineInvestigate_Directors_DisciplineDisciplinarys_Disc~",
table: "DisciplineInvestigate_Directors",
column: "DisciplineDisciplinaryId",
principalTable: "DisciplineDisciplinarys",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_DisciplineInvestigate_DocComplaints_DisciplineDisciplinarys_~",
table: "DisciplineInvestigate_DocComplaints",
column: "DisciplineDisciplinaryId",
principalTable: "DisciplineDisciplinarys",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_DisciplineInvestigate_Docs_DisciplineDisciplinarys_Disciplin~",
table: "DisciplineInvestigate_Docs",
column: "DisciplineDisciplinaryId",
principalTable: "DisciplineDisciplinarys",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_DisciplineInvestigate_ProfileComplaints_DisciplineDisciplina~",
table: "DisciplineInvestigate_ProfileComplaints",
column: "DisciplineDisciplinaryId",
principalTable: "DisciplineDisciplinarys",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_DisciplineInvestigateRelevant_Docs_DisciplineDisciplinarys_D~",
table: "DisciplineInvestigateRelevant_Docs",
column: "DisciplineDisciplinaryId",
principalTable: "DisciplineDisciplinarys",
principalColumn: "Id");
}
}
}

View file

@ -0,0 +1,107 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
{
/// <inheritdoc />
public partial class addtableDisciplineDisciplinary_DocWitnessess : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<DateTime>(
name: "InvestigationDateStart",
table: "DisciplineInvestigates",
type: "datetime(6)",
nullable: true,
comment: "วันที่เริ่มการสืบสวน",
oldClrType: typeof(DateTime),
oldType: "datetime(6)",
oldNullable: true,
oldComment: "วันที่เริ่มการสอบสวน");
migrationBuilder.AlterColumn<DateTime>(
name: "InvestigationDateEnd",
table: "DisciplineInvestigates",
type: "datetime(6)",
nullable: true,
comment: "วันที่สิ้นสุดการสืบสวน",
oldClrType: typeof(DateTime),
oldType: "datetime(6)",
oldNullable: true,
oldComment: "วันที่สิ้นสุดการสอบสวน");
migrationBuilder.AlterColumn<DateTime>(
name: "InvestigationDateStart",
table: "DisciplineDisciplinarys",
type: "datetime(6)",
nullable: true,
comment: "วันที่เริ่มการสืบสวน",
oldClrType: typeof(DateTime),
oldType: "datetime(6)",
oldNullable: true,
oldComment: "วันที่เริ่มการสอบสวน");
migrationBuilder.AlterColumn<DateTime>(
name: "InvestigationDateEnd",
table: "DisciplineDisciplinarys",
type: "datetime(6)",
nullable: true,
comment: "วันที่สิ้นสุดการสืบสวน",
oldClrType: typeof(DateTime),
oldType: "datetime(6)",
oldNullable: true,
oldComment: "วันที่สิ้นสุดการสอบสวน");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<DateTime>(
name: "InvestigationDateStart",
table: "DisciplineInvestigates",
type: "datetime(6)",
nullable: true,
comment: "วันที่เริ่มการสอบสวน",
oldClrType: typeof(DateTime),
oldType: "datetime(6)",
oldNullable: true,
oldComment: "วันที่เริ่มการสืบสวน");
migrationBuilder.AlterColumn<DateTime>(
name: "InvestigationDateEnd",
table: "DisciplineInvestigates",
type: "datetime(6)",
nullable: true,
comment: "วันที่สิ้นสุดการสอบสวน",
oldClrType: typeof(DateTime),
oldType: "datetime(6)",
oldNullable: true,
oldComment: "วันที่สิ้นสุดการสืบสวน");
migrationBuilder.AlterColumn<DateTime>(
name: "InvestigationDateStart",
table: "DisciplineDisciplinarys",
type: "datetime(6)",
nullable: true,
comment: "วันที่เริ่มการสอบสวน",
oldClrType: typeof(DateTime),
oldType: "datetime(6)",
oldNullable: true,
oldComment: "วันที่เริ่มการสืบสวน");
migrationBuilder.AlterColumn<DateTime>(
name: "InvestigationDateEnd",
table: "DisciplineDisciplinarys",
type: "datetime(6)",
nullable: true,
comment: "วันที่สิ้นสุดการสอบสวน",
oldClrType: typeof(DateTime),
oldType: "datetime(6)",
oldNullable: true,
oldComment: "วันที่สิ้นสุดการสืบสวน");
}
}
}

View file

@ -21,11 +21,22 @@ namespace BMA.EHR.Infrastructure.Persistence
public DbSet<DisciplineComplaint_Doc> DisciplineComplaint_Docs { get; set; }
public DbSet<DisciplineInvestigate> DisciplineInvestigates { get; set; }
public DbSet<DisciplineInvestigate_Profile> DisciplineInvestigate_Profiles { get; set; }
public DbSet<DisciplineInvestigate_ProfileComplaint> DisciplineInvestigate_ProfileComplaints { get; set; }
public DbSet<DisciplineInvestigate_DocComplaint> DisciplineInvestigate_DocComplaints { get; set; }
public DbSet<DisciplineInvestigate_Doc> DisciplineInvestigate_Docs { get; set; }
public DbSet<DisciplineInvestigate_Director> DisciplineInvestigate_Directors { get; set; }
public DbSet<DisciplineInvestigateRelevant_Doc> DisciplineInvestigateRelevant_Docs { get; set; }
public DbSet<DisciplineDisciplinary> DisciplineDisciplinarys { get; set; }
public DbSet<DisciplineDisciplinary_ProfileComplaintInvestigate> DisciplineDisciplinary_ProfileComplaintInvestigates { get; set; }
public DbSet<DisciplineDisciplinary_DocInvestigateRelevant> DisciplineDisciplinary_DocInvestigateRelevants { get; set; }
public DbSet<DisciplineDisciplinary_DocInvestigate> DisciplineDisciplinary_DocInvestigates { get; set; }
public DbSet<DisciplineDisciplinary_DocComplaintInvestigate> DisciplineDisciplinary_DocComplaintInvestigates { get; set; }
public DbSet<DisciplineDisciplinary_DirectorInvestigate> DisciplineDisciplinary_DirectorInvestigates { get; set; }
public DbSet<DisciplineDisciplinary_DocSummaryEvidence> DisciplineDisciplinary_DocSummaryEvidences { get; set; }
public DbSet<DisciplineDisciplinary_DocRecordAccuser> DisciplineDisciplinary_DocRecordAccusers { get; set; }
public DbSet<DisciplineDisciplinary_DocWitnesses> DisciplineDisciplinary_DocWitnessess { get; set; }
public DbSet<DisciplineDisciplinary_DocOther> DisciplineDisciplinary_DocOthers { get; set; }
public DbSet<Document> Documents { get; set; }
#endregion