using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace BMA.EHR.Infrastructure.Migrations { /// public partial class updatetableinsigniaperiodaddreason : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "DocumentId", table: "InsigniaRequests", type: "char(36)", nullable: true, collation: "ascii_general_ci"); migrationBuilder.AlterColumn( name: "Reason", table: "InsigniaRequestProfiles", type: "longtext", nullable: true, comment: "เหตุผลการได้รับเครื่องราชฯ", oldClrType: typeof(string), oldType: "longtext", oldNullable: true, oldComment: "เหตุผลไม่ยื่นขอ") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "ReasonReject", table: "InsigniaRequestProfiles", type: "longtext", nullable: true, comment: "เหตุผลไม่ยื่นขอ") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateIndex( name: "IX_InsigniaRequests_DocumentId", table: "InsigniaRequests", column: "DocumentId"); migrationBuilder.AddForeignKey( name: "FK_InsigniaRequests_Documents_DocumentId", table: "InsigniaRequests", column: "DocumentId", principalTable: "Documents", principalColumn: "Id"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_InsigniaRequests_Documents_DocumentId", table: "InsigniaRequests"); migrationBuilder.DropIndex( name: "IX_InsigniaRequests_DocumentId", table: "InsigniaRequests"); migrationBuilder.DropColumn( name: "DocumentId", table: "InsigniaRequests"); migrationBuilder.DropColumn( name: "ReasonReject", table: "InsigniaRequestProfiles"); migrationBuilder.AlterColumn( name: "Reason", table: "InsigniaRequestProfiles", type: "longtext", nullable: true, comment: "เหตุผลไม่ยื่นขอ", oldClrType: typeof(string), oldType: "longtext", oldNullable: true, oldComment: "เหตุผลการได้รับเครื่องราชฯ") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); } } }