using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
///
public partial class updatetablePlacementOfficeraddchild1 : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
// migrationBuilder.DropForeignKey(
// name: "FK_PlacementOfficers_Profiles_ProfileId",
// table: "PlacementOfficers");
// migrationBuilder.DropIndex(
// name: "IX_PlacementOfficers_ProfileId",
// table: "PlacementOfficers");
migrationBuilder.RenameColumn(
name: "ProfileId",
table: "PlacementOfficers",
newName: "profileId");
migrationBuilder.AlterColumn(
name: "profileId",
table: "PlacementOfficers",
type: "longtext",
nullable: true,
comment: "profile Id",
oldClrType: typeof(Guid),
oldType: "char(36)")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AddColumn(
name: "child1",
table: "PlacementOfficers",
type: "longtext",
nullable: true,
comment: "ชื่อหน่วยงาน child1")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn(
name: "child1Id",
table: "PlacementOfficers",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน child1")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn(
name: "child1ShortName",
table: "PlacementOfficers",
type: "longtext",
nullable: true,
comment: "ชื่อย่อหน่วยงาน child1")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn(
name: "child2",
table: "PlacementOfficers",
type: "longtext",
nullable: true,
comment: "ชื่อหน่วยงาน child2")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn(
name: "child2Id",
table: "PlacementOfficers",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน child2")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn(
name: "child2ShortName",
table: "PlacementOfficers",
type: "longtext",
nullable: true,
comment: "ชื่อย่อหน่วยงาน child2")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn(
name: "child3",
table: "PlacementOfficers",
type: "longtext",
nullable: true,
comment: "ชื่อหน่วยงาน child3")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn(
name: "child3Id",
table: "PlacementOfficers",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน child3")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn(
name: "child3ShortName",
table: "PlacementOfficers",
type: "longtext",
nullable: true,
comment: "ชื่อย่อหน่วยงาน child3")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn(
name: "child4",
table: "PlacementOfficers",
type: "longtext",
nullable: true,
comment: "ชื่อหน่วยงาน child4")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn(
name: "child4Id",
table: "PlacementOfficers",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน child4")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn(
name: "child4ShortName",
table: "PlacementOfficers",
type: "longtext",
nullable: true,
comment: "ชื่อย่อหน่วยงาน child4")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn(
name: "citizenId",
table: "PlacementOfficers",
type: "longtext",
nullable: true,
comment: "เลขบัตรประชาชน")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn(
name: "firstName",
table: "PlacementOfficers",
type: "longtext",
nullable: true,
comment: "ชื่อ")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn(
name: "lastName",
table: "PlacementOfficers",
type: "longtext",
nullable: true,
comment: "นามสกุล")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn(
name: "posLevelId",
table: "PlacementOfficers",
type: "longtext",
nullable: true,
comment: "id ระดับตำแหน่ง")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn(
name: "posLevelName",
table: "PlacementOfficers",
type: "longtext",
nullable: true,
comment: "ชื่อระดับตำแหน่ง")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn(
name: "posMasterNo",
table: "PlacementOfficers",
type: "int",
nullable: true,
comment: "เลขที่ตำแหน่ง");
migrationBuilder.AddColumn(
name: "posTypeId",
table: "PlacementOfficers",
type: "longtext",
nullable: true,
comment: "id ประเภทตำแหน่ง")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn(
name: "posTypeName",
table: "PlacementOfficers",
type: "longtext",
nullable: true,
comment: "ชื่อประเภทตำแหน่ง")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn(
name: "position",
table: "PlacementOfficers",
type: "longtext",
nullable: true,
comment: "ชื่อตำแหน่งในสายงาน")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn(
name: "prefix",
table: "PlacementOfficers",
type: "longtext",
nullable: true,
comment: "คำนำหน้า")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn(
name: "root",
table: "PlacementOfficers",
type: "longtext",
nullable: true,
comment: "ชื่อหน่วยงาน root")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn(
name: "rootId",
table: "PlacementOfficers",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน root")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn(
name: "rootShortName",
table: "PlacementOfficers",
type: "longtext",
nullable: true,
comment: "ชื่อย่อหน่วยงาน root")
.Annotation("MySql:CharSet", "utf8mb4");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "child1",
table: "PlacementOfficers");
migrationBuilder.DropColumn(
name: "child1Id",
table: "PlacementOfficers");
migrationBuilder.DropColumn(
name: "child1ShortName",
table: "PlacementOfficers");
migrationBuilder.DropColumn(
name: "child2",
table: "PlacementOfficers");
migrationBuilder.DropColumn(
name: "child2Id",
table: "PlacementOfficers");
migrationBuilder.DropColumn(
name: "child2ShortName",
table: "PlacementOfficers");
migrationBuilder.DropColumn(
name: "child3",
table: "PlacementOfficers");
migrationBuilder.DropColumn(
name: "child3Id",
table: "PlacementOfficers");
migrationBuilder.DropColumn(
name: "child3ShortName",
table: "PlacementOfficers");
migrationBuilder.DropColumn(
name: "child4",
table: "PlacementOfficers");
migrationBuilder.DropColumn(
name: "child4Id",
table: "PlacementOfficers");
migrationBuilder.DropColumn(
name: "child4ShortName",
table: "PlacementOfficers");
migrationBuilder.DropColumn(
name: "citizenId",
table: "PlacementOfficers");
migrationBuilder.DropColumn(
name: "firstName",
table: "PlacementOfficers");
migrationBuilder.DropColumn(
name: "lastName",
table: "PlacementOfficers");
migrationBuilder.DropColumn(
name: "posLevelId",
table: "PlacementOfficers");
migrationBuilder.DropColumn(
name: "posLevelName",
table: "PlacementOfficers");
migrationBuilder.DropColumn(
name: "posMasterNo",
table: "PlacementOfficers");
migrationBuilder.DropColumn(
name: "posTypeId",
table: "PlacementOfficers");
migrationBuilder.DropColumn(
name: "posTypeName",
table: "PlacementOfficers");
migrationBuilder.DropColumn(
name: "position",
table: "PlacementOfficers");
migrationBuilder.DropColumn(
name: "prefix",
table: "PlacementOfficers");
migrationBuilder.DropColumn(
name: "root",
table: "PlacementOfficers");
migrationBuilder.DropColumn(
name: "rootId",
table: "PlacementOfficers");
migrationBuilder.DropColumn(
name: "rootShortName",
table: "PlacementOfficers");
migrationBuilder.RenameColumn(
name: "profileId",
table: "PlacementOfficers",
newName: "ProfileId");
migrationBuilder.AlterColumn(
name: "ProfileId",
table: "PlacementOfficers",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci",
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true,
oldComment: "profile Id")
.OldAnnotation("MySql:CharSet", "utf8mb4");
// migrationBuilder.CreateIndex(
// name: "IX_PlacementOfficers_ProfileId",
// table: "PlacementOfficers",
// column: "ProfileId");
// migrationBuilder.AddForeignKey(
// name: "FK_PlacementOfficers_Profiles_ProfileId",
// table: "PlacementOfficers",
// column: "ProfileId",
// principalTable: "Profiles",
// principalColumn: "Id",
// onDelete: ReferentialAction.Cascade);
}
}
}