794 lines
42 KiB
C#
794 lines
42 KiB
C#
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");
|
|
}
|
|
}
|
|
}
|