using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace BMA.EHR.Infrastructure.Migrations { /// public partial class updatetableplacementAddposition : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_PlacementProfiles_PositionLevels_PositionLevelId", table: "PlacementProfiles"); migrationBuilder.DropForeignKey( name: "FK_PlacementProfiles_PositionTypes_PositionTypeId", table: "PlacementProfiles"); migrationBuilder.DropIndex( name: "IX_PlacementProfiles_PositionLevelId", table: "PlacementProfiles"); migrationBuilder.DropIndex( name: "IX_PlacementProfiles_PositionTypeId", table: "PlacementProfiles"); migrationBuilder.DropColumn( name: "PositionLevelId", table: "PlacementProfiles"); migrationBuilder.DropColumn( name: "PositionTypeId", table: "PlacementProfiles"); migrationBuilder.AddColumn( name: "PositionLevel", table: "PlacementProfiles", type: "longtext", nullable: true, comment: "ระดับ") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "PositionType", table: "PlacementProfiles", type: "longtext", nullable: true, comment: "ประเภทตำแหน่ง") .Annotation("MySql:CharSet", "utf8mb4"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropColumn( name: "PositionLevel", table: "PlacementProfiles"); migrationBuilder.DropColumn( name: "PositionType", table: "PlacementProfiles"); migrationBuilder.AddColumn( name: "PositionLevelId", table: "PlacementProfiles", type: "char(36)", nullable: true, collation: "ascii_general_ci"); migrationBuilder.AddColumn( name: "PositionTypeId", table: "PlacementProfiles", type: "char(36)", nullable: true, collation: "ascii_general_ci"); migrationBuilder.CreateIndex( name: "IX_PlacementProfiles_PositionLevelId", table: "PlacementProfiles", column: "PositionLevelId"); migrationBuilder.CreateIndex( name: "IX_PlacementProfiles_PositionTypeId", table: "PlacementProfiles", column: "PositionTypeId"); migrationBuilder.AddForeignKey( name: "FK_PlacementProfiles_PositionLevels_PositionLevelId", table: "PlacementProfiles", column: "PositionLevelId", principalTable: "PositionLevels", principalColumn: "Id"); migrationBuilder.AddForeignKey( name: "FK_PlacementProfiles_PositionTypes_PositionTypeId", table: "PlacementProfiles", column: "PositionTypeId", principalTable: "PositionTypes", principalColumn: "Id"); } } }