hrms-api-backend/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231222101806_update table DisciplineDisciplinarys add IsSuspend3.cs
2023-12-23 13:48:56 +07:00

100 lines
4.4 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
{
/// <inheritdoc />
public partial class updatetableDisciplineDisciplinarysaddIsSuspend3 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_DisciplineReport_Profiles_DisciplineDisciplinary_ProfileComp~",
table: "DisciplineReport_Profiles");
migrationBuilder.DropIndex(
name: "IX_DisciplineReport_Profiles_DisciplineDisciplinary_ProfileComp~",
table: "DisciplineReport_Profiles");
migrationBuilder.DropColumn(
name: "DisciplineDisciplinary_ProfileComplaintInvestigateId",
table: "DisciplineReport_Profiles");
migrationBuilder.AddColumn<string>(
name: "DisciplinaryCaseFault",
table: "DisciplineReport_Profiles",
type: "longtext",
nullable: true,
comment: "กรณีความผิด")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "DisciplinaryFaultLevel",
table: "DisciplineReport_Profiles",
type: "longtext",
nullable: true,
comment: "ระดับโทษความผิด กรณีไม่ร้ายแรง: ภาคทัณฑ์, ตัดเงินเดือน, ลดขั้นเงินเดือน | กรณีร้ายแรง: ปลดออก, ไล่ออก")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "OffenseDetails",
table: "DisciplineReport_Profiles",
type: "longtext",
nullable: true,
comment: "ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "Title",
table: "DisciplineReport_Profiles",
type: "text",
nullable: true,
comment: "เรื่องที่ร้องเรียน")
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "DisciplinaryCaseFault",
table: "DisciplineReport_Profiles");
migrationBuilder.DropColumn(
name: "DisciplinaryFaultLevel",
table: "DisciplineReport_Profiles");
migrationBuilder.DropColumn(
name: "OffenseDetails",
table: "DisciplineReport_Profiles");
migrationBuilder.DropColumn(
name: "Title",
table: "DisciplineReport_Profiles");
migrationBuilder.AddColumn<Guid>(
name: "DisciplineDisciplinary_ProfileComplaintInvestigateId",
table: "DisciplineReport_Profiles",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci");
migrationBuilder.CreateIndex(
name: "IX_DisciplineReport_Profiles_DisciplineDisciplinary_ProfileComp~",
table: "DisciplineReport_Profiles",
column: "DisciplineDisciplinary_ProfileComplaintInvestigateId");
migrationBuilder.AddForeignKey(
name: "FK_DisciplineReport_Profiles_DisciplineDisciplinary_ProfileComp~",
table: "DisciplineReport_Profiles",
column: "DisciplineDisciplinary_ProfileComplaintInvestigateId",
principalTable: "DisciplineDisciplinary_ProfileComplaintInvestigates",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}