using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace BMA.EHR.Infrastructure.Migrations { /// public partial class updatetableinsigniaaddOrgReceiveInsigniaId : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_InsigniaNoteProfiles_Organizations_OrgReceiveInsigniaId", table: "InsigniaNoteProfiles"); migrationBuilder.DropForeignKey( name: "FK_InsigniaNoteProfiles_Organizations_OrgReturnInsigniaId", table: "InsigniaNoteProfiles"); migrationBuilder.DropIndex( name: "IX_InsigniaNoteProfiles_OrgReceiveInsigniaId", table: "InsigniaNoteProfiles"); migrationBuilder.DropIndex( name: "IX_InsigniaNoteProfiles_OrgReturnInsigniaId", table: "InsigniaNoteProfiles"); migrationBuilder.AlterColumn( name: "OrgReturnInsigniaId", table: "InsigniaNoteProfiles", type: "char(36)", nullable: true, comment: "หน่วยงานคืนเครื่องราชฯ", collation: "ascii_general_ci", oldClrType: typeof(Guid), oldType: "char(36)", oldNullable: true) .OldAnnotation("Relational:Collation", "ascii_general_ci"); migrationBuilder.AlterColumn( name: "OrgReceiveInsigniaId", table: "InsigniaNoteProfiles", type: "char(36)", nullable: true, comment: "หน่วยงานรับเครื่องราชฯ", collation: "ascii_general_ci", oldClrType: typeof(Guid), oldType: "char(36)", oldNullable: true) .OldAnnotation("Relational:Collation", "ascii_general_ci"); migrationBuilder.AddColumn( name: "OrgReceiveInsignia", table: "InsigniaNoteProfiles", type: "longtext", nullable: true, comment: "หน่วยงานรับเครื่องราชฯ") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "OrgReturnInsignia", table: "InsigniaNoteProfiles", type: "longtext", nullable: true, comment: "หน่วยงานคืนเครื่องราชฯ") .Annotation("MySql:CharSet", "utf8mb4"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropColumn( name: "OrgReceiveInsignia", table: "InsigniaNoteProfiles"); migrationBuilder.DropColumn( name: "OrgReturnInsignia", table: "InsigniaNoteProfiles"); migrationBuilder.AlterColumn( name: "OrgReturnInsigniaId", table: "InsigniaNoteProfiles", type: "char(36)", nullable: true, collation: "ascii_general_ci", oldClrType: typeof(Guid), oldType: "char(36)", oldNullable: true, oldComment: "หน่วยงานคืนเครื่องราชฯ") .OldAnnotation("Relational:Collation", "ascii_general_ci"); migrationBuilder.AlterColumn( name: "OrgReceiveInsigniaId", table: "InsigniaNoteProfiles", type: "char(36)", nullable: true, collation: "ascii_general_ci", oldClrType: typeof(Guid), oldType: "char(36)", oldNullable: true, oldComment: "หน่วยงานรับเครื่องราชฯ") .OldAnnotation("Relational:Collation", "ascii_general_ci"); migrationBuilder.CreateIndex( name: "IX_InsigniaNoteProfiles_OrgReceiveInsigniaId", table: "InsigniaNoteProfiles", column: "OrgReceiveInsigniaId"); migrationBuilder.CreateIndex( name: "IX_InsigniaNoteProfiles_OrgReturnInsigniaId", table: "InsigniaNoteProfiles", column: "OrgReturnInsigniaId"); migrationBuilder.AddForeignKey( name: "FK_InsigniaNoteProfiles_Organizations_OrgReceiveInsigniaId", table: "InsigniaNoteProfiles", column: "OrgReceiveInsigniaId", principalTable: "Organizations", principalColumn: "Id"); migrationBuilder.AddForeignKey( name: "FK_InsigniaNoteProfiles_Organizations_OrgReturnInsigniaId", table: "InsigniaNoteProfiles", column: "OrgReturnInsigniaId", principalTable: "Organizations", principalColumn: "Id"); } } }