using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace BMA.EHR.Infrastructure.Migrations { /// public partial class UpdatetableplacementEducationaddDegree : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropColumn( name: "DurationEnd", table: "PlacementEducations"); migrationBuilder.DropColumn( name: "DurationStart", table: "PlacementEducations"); migrationBuilder.DropColumn( name: "Major", table: "PlacementEducations"); migrationBuilder.DropColumn( name: "Name", table: "PlacementEducations"); migrationBuilder.DropColumn( name: "Scores", table: "PlacementEducations"); migrationBuilder.AddColumn( name: "Country", table: "PlacementEducations", type: "varchar(1000)", maxLength: 1000, nullable: true, comment: "ประเทศ") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "Degree", table: "PlacementEducations", type: "varchar(200)", maxLength: 200, nullable: true, comment: "วุฒิการศึกษา") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "Duration", table: "PlacementEducations", type: "varchar(1000)", maxLength: 1000, nullable: true, comment: "ระยะเวลา") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "DurationYear", table: "PlacementEducations", type: "int", nullable: false, defaultValue: 0, comment: "ระยะเวลาหลักสูตร"); migrationBuilder.AddColumn( name: "EndDate", table: "PlacementEducations", type: "datetime(6)", nullable: true, comment: "ถึง"); migrationBuilder.AddColumn( name: "Field", table: "PlacementEducations", type: "varchar(200)", maxLength: 200, nullable: true, comment: "สาขาวิชา/ทาง") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "FinishDate", table: "PlacementEducations", type: "datetime(6)", nullable: true, comment: "วันที่สำเร็จการศึกษา"); migrationBuilder.AddColumn( name: "FundName", table: "PlacementEducations", type: "varchar(1000)", maxLength: 1000, nullable: true, comment: "ทุน") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "Gpa", table: "PlacementEducations", type: "varchar(20)", maxLength: 20, nullable: true, comment: "เกรดเฉลี่ย") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "Institute", table: "PlacementEducations", type: "varchar(1000)", maxLength: 1000, nullable: true, comment: "สถานศึกษา") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "IsDate", table: "PlacementEducations", type: "tinyint(1)", nullable: true, comment: "ประเภทช่วงเวลาการศึกษา"); migrationBuilder.AddColumn( name: "IsEducation", table: "PlacementEducations", type: "tinyint(1)", nullable: true, comment: "เป็นวุฒิศึกษาในตำแหน่ง"); migrationBuilder.AddColumn( name: "Other", table: "PlacementEducations", type: "varchar(1000)", maxLength: 1000, nullable: true, comment: "ข้อมูลการติดต่อ") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "PositionPathId", table: "PlacementEducations", type: "char(36)", nullable: true, collation: "ascii_general_ci"); migrationBuilder.AddColumn( name: "StartDate", table: "PlacementEducations", type: "datetime(6)", nullable: true, comment: "ตั้งแต่"); migrationBuilder.CreateIndex( name: "IX_PlacementEducations_PositionPathId", table: "PlacementEducations", column: "PositionPathId"); migrationBuilder.AddForeignKey( name: "FK_PlacementEducations_PositionPaths_PositionPathId", table: "PlacementEducations", column: "PositionPathId", principalTable: "PositionPaths", principalColumn: "Id"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_PlacementEducations_PositionPaths_PositionPathId", table: "PlacementEducations"); migrationBuilder.DropIndex( name: "IX_PlacementEducations_PositionPathId", table: "PlacementEducations"); migrationBuilder.DropColumn( name: "Country", table: "PlacementEducations"); migrationBuilder.DropColumn( name: "Degree", table: "PlacementEducations"); migrationBuilder.DropColumn( name: "Duration", table: "PlacementEducations"); migrationBuilder.DropColumn( name: "DurationYear", table: "PlacementEducations"); migrationBuilder.DropColumn( name: "EndDate", table: "PlacementEducations"); migrationBuilder.DropColumn( name: "Field", table: "PlacementEducations"); migrationBuilder.DropColumn( name: "FinishDate", table: "PlacementEducations"); migrationBuilder.DropColumn( name: "FundName", table: "PlacementEducations"); migrationBuilder.DropColumn( name: "Gpa", table: "PlacementEducations"); migrationBuilder.DropColumn( name: "Institute", table: "PlacementEducations"); migrationBuilder.DropColumn( name: "IsDate", table: "PlacementEducations"); migrationBuilder.DropColumn( name: "IsEducation", table: "PlacementEducations"); migrationBuilder.DropColumn( name: "Other", table: "PlacementEducations"); migrationBuilder.DropColumn( name: "PositionPathId", table: "PlacementEducations"); migrationBuilder.DropColumn( name: "StartDate", table: "PlacementEducations"); migrationBuilder.AddColumn( name: "DurationEnd", table: "PlacementEducations", type: "datetime(6)", nullable: false, defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), comment: "ระยะเวลาสิ้นสุด"); migrationBuilder.AddColumn( name: "DurationStart", table: "PlacementEducations", type: "datetime(6)", nullable: false, defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), comment: "ระยะเวลาเริ่ม"); migrationBuilder.AddColumn( name: "Major", table: "PlacementEducations", type: "longtext", nullable: false, comment: "สาขาวิชา/วิชาเอก") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "Name", table: "PlacementEducations", type: "longtext", nullable: false, comment: "ชื่อสถานศึกษา") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "Scores", table: "PlacementEducations", type: "float", maxLength: 10, nullable: false, defaultValue: 0f, comment: "คะแนนเฉลี่ยตลอดหลักสูตร"); } } }