hrms-api-backend/BMA.EHR.Infrastructure/Migrations/20240502135321_update table PlacementRecive add profileid1.cs

449 lines
16 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class updatetablePlacementReciveaddprofileid1 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "positionName",
table: "PlacementAppointments",
newName: "position");
migrationBuilder.AddColumn<string>(
name: "OrganizationOld",
table: "RetirementOuts",
type: "longtext",
nullable: true,
comment: "สังกัดเดิม")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "PositionOld",
table: "RetirementOuts",
type: "longtext",
nullable: true,
comment: "ตำแหน่งเดิม")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "OrganizationOld",
table: "RetirementOthers",
type: "longtext",
nullable: true,
comment: "สังกัดเดิม")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "PositionOld",
table: "RetirementOthers",
type: "longtext",
nullable: true,
comment: "ตำแหน่งเดิม")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "OrganizationOld",
table: "PlacementRepatriations",
type: "longtext",
nullable: true,
comment: "สังกัดเดิม")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "PositionOld",
table: "PlacementRepatriations",
type: "longtext",
nullable: true,
comment: "ตำแหน่งเดิม")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "OrganizationOld",
table: "PlacementReceives",
type: "longtext",
nullable: true,
comment: "สังกัดเดิม")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "PositionOld",
table: "PlacementReceives",
type: "longtext",
nullable: true,
comment: "ตำแหน่งเดิม")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child1Old",
table: "PlacementReceives",
type: "longtext",
nullable: true,
comment: "ชื่อหน่วยงาน child1 old")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child1OldId",
table: "PlacementReceives",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน child1 old")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child1ShortNameOld",
table: "PlacementReceives",
type: "longtext",
nullable: true,
comment: "ชื่อย่อหน่วยงาน child1 old")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child2Old",
table: "PlacementReceives",
type: "longtext",
nullable: true,
comment: "ชื่อหน่วยงาน child2 old")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child2OldId",
table: "PlacementReceives",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน child2 old")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child2ShortNameOld",
table: "PlacementReceives",
type: "longtext",
nullable: true,
comment: "ชื่อย่อหน่วยงาน child2 old")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child3Old",
table: "PlacementReceives",
type: "longtext",
nullable: true,
comment: "ชื่อหน่วยงาน child3 old")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child3OldId",
table: "PlacementReceives",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน child3 old")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child3ShortNameOld",
table: "PlacementReceives",
type: "longtext",
nullable: true,
comment: "ชื่อย่อหน่วยงาน child3 old")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child4Old",
table: "PlacementReceives",
type: "longtext",
nullable: true,
comment: "ชื่อหน่วยงาน child4 old")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child4OldId",
table: "PlacementReceives",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน child4 old")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child4ShortNameOld",
table: "PlacementReceives",
type: "longtext",
nullable: true,
comment: "ชื่อย่อหน่วยงาน child4 old")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "posLevelNameOld",
table: "PlacementReceives",
type: "longtext",
nullable: true,
comment: "ชื่อระดับตำแหน่ง old")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "posLevelOldId",
table: "PlacementReceives",
type: "longtext",
nullable: true,
comment: "id ระดับตำแหน่ง old")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<int>(
name: "posMasterNoOld",
table: "PlacementReceives",
type: "int",
nullable: true,
comment: "เลขที่ตำแหน่ง old");
migrationBuilder.AddColumn<string>(
name: "posTypeNameOld",
table: "PlacementReceives",
type: "longtext",
nullable: true,
comment: "ชื่อประเภทตำแหน่ง old")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "posTypeOldId",
table: "PlacementReceives",
type: "longtext",
nullable: true,
comment: "id ประเภทตำแหน่ง old")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "positionOld",
table: "PlacementReceives",
type: "longtext",
nullable: true,
comment: "ชื่อตำแหน่งในสายงาน old")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "rootOld",
table: "PlacementReceives",
type: "longtext",
nullable: true,
comment: "ชื่อหน่วยงาน root old")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "rootOldId",
table: "PlacementReceives",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน root old")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "rootShortNameOld",
table: "PlacementReceives",
type: "longtext",
nullable: true,
comment: "ชื่อย่อหน่วยงาน root old")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "OrganizationOld",
table: "PlacementOfficers",
type: "longtext",
nullable: true,
comment: "สังกัดเดิม")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "PositionOld",
table: "PlacementOfficers",
type: "longtext",
nullable: true,
comment: "ตำแหน่งเดิม")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "OrganizationPositionOld",
table: "PlacementAppointments",
type: "longtext",
nullable: true,
comment: "สังกัด/ตำแหน่งเเดิม",
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true,
oldComment: "สังกัดเดิม")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "OrganizationOld",
table: "PlacementAppointments",
type: "longtext",
nullable: true,
comment: "สังกัดเดิม")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "PositionOld",
table: "PlacementAppointments",
type: "longtext",
nullable: true,
comment: "ตำแหน่งเดิม")
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "OrganizationOld",
table: "RetirementOuts");
migrationBuilder.DropColumn(
name: "PositionOld",
table: "RetirementOuts");
migrationBuilder.DropColumn(
name: "OrganizationOld",
table: "RetirementOthers");
migrationBuilder.DropColumn(
name: "PositionOld",
table: "RetirementOthers");
migrationBuilder.DropColumn(
name: "OrganizationOld",
table: "PlacementRepatriations");
migrationBuilder.DropColumn(
name: "PositionOld",
table: "PlacementRepatriations");
migrationBuilder.DropColumn(
name: "OrganizationOld",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "PositionOld",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "child1Old",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "child1OldId",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "child1ShortNameOld",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "child2Old",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "child2OldId",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "child2ShortNameOld",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "child3Old",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "child3OldId",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "child3ShortNameOld",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "child4Old",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "child4OldId",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "child4ShortNameOld",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "posLevelNameOld",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "posLevelOldId",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "posMasterNoOld",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "posTypeNameOld",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "posTypeOldId",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "positionOld",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "rootOld",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "rootOldId",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "rootShortNameOld",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "OrganizationOld",
table: "PlacementOfficers");
migrationBuilder.DropColumn(
name: "PositionOld",
table: "PlacementOfficers");
migrationBuilder.DropColumn(
name: "OrganizationOld",
table: "PlacementAppointments");
migrationBuilder.DropColumn(
name: "PositionOld",
table: "PlacementAppointments");
migrationBuilder.RenameColumn(
name: "position",
table: "PlacementAppointments",
newName: "positionName");
migrationBuilder.AlterColumn<string>(
name: "OrganizationPositionOld",
table: "PlacementAppointments",
type: "longtext",
nullable: true,
comment: "สังกัดเดิม",
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true,
oldComment: "สังกัด/ตำแหน่งเเดิม")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
}
}