using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace BMA.EHR.Infrastructure.Migrations { /// public partial class updatetableinsignianoteprofileaddreturn : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "DateReceiveInsignia", table: "InsigniaNoteProfiles", type: "datetime(6)", nullable: true, comment: "วันที่รับเครื่องราชฯ"); migrationBuilder.AddColumn( name: "DateReturnInsignia", table: "InsigniaNoteProfiles", type: "datetime(6)", nullable: true, comment: "วันที่คืนเครื่องราชฯ"); migrationBuilder.AddColumn( name: "DocReceiveInsigniaId", table: "InsigniaNoteProfiles", type: "char(36)", nullable: true, collation: "ascii_general_ci"); migrationBuilder.AddColumn( name: "DocReturnInsigniaId", table: "InsigniaNoteProfiles", type: "char(36)", nullable: true, collation: "ascii_general_ci"); migrationBuilder.AddColumn( name: "OrgReceiveInsigniaId", table: "InsigniaNoteProfiles", type: "char(36)", nullable: true, collation: "ascii_general_ci"); migrationBuilder.AddColumn( name: "OrgReturnInsigniaId", table: "InsigniaNoteProfiles", type: "char(36)", nullable: true, collation: "ascii_general_ci"); migrationBuilder.CreateIndex( name: "IX_InsigniaNoteProfiles_DocReceiveInsigniaId", table: "InsigniaNoteProfiles", column: "DocReceiveInsigniaId"); migrationBuilder.CreateIndex( name: "IX_InsigniaNoteProfiles_DocReturnInsigniaId", table: "InsigniaNoteProfiles", column: "DocReturnInsigniaId"); 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_Documents_DocReceiveInsigniaId", table: "InsigniaNoteProfiles", column: "DocReceiveInsigniaId", principalTable: "Documents", principalColumn: "Id"); migrationBuilder.AddForeignKey( name: "FK_InsigniaNoteProfiles_Documents_DocReturnInsigniaId", table: "InsigniaNoteProfiles", column: "DocReturnInsigniaId", principalTable: "Documents", principalColumn: "Id"); migrationBuilder.AddForeignKey( name: "FK_InsigniaNoteProfiles_OrganizationOrganizations_OrgReceiveIns~", table: "InsigniaNoteProfiles", column: "OrgReceiveInsigniaId", principalTable: "OrganizationOrganizations", principalColumn: "Id"); migrationBuilder.AddForeignKey( name: "FK_InsigniaNoteProfiles_OrganizationOrganizations_OrgReturnInsi~", table: "InsigniaNoteProfiles", column: "OrgReturnInsigniaId", principalTable: "OrganizationOrganizations", principalColumn: "Id"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_InsigniaNoteProfiles_Documents_DocReceiveInsigniaId", table: "InsigniaNoteProfiles"); migrationBuilder.DropForeignKey( name: "FK_InsigniaNoteProfiles_Documents_DocReturnInsigniaId", table: "InsigniaNoteProfiles"); migrationBuilder.DropForeignKey( name: "FK_InsigniaNoteProfiles_OrganizationOrganizations_OrgReceiveIns~", table: "InsigniaNoteProfiles"); migrationBuilder.DropForeignKey( name: "FK_InsigniaNoteProfiles_OrganizationOrganizations_OrgReturnInsi~", table: "InsigniaNoteProfiles"); migrationBuilder.DropIndex( name: "IX_InsigniaNoteProfiles_DocReceiveInsigniaId", table: "InsigniaNoteProfiles"); migrationBuilder.DropIndex( name: "IX_InsigniaNoteProfiles_DocReturnInsigniaId", table: "InsigniaNoteProfiles"); migrationBuilder.DropIndex( name: "IX_InsigniaNoteProfiles_OrgReceiveInsigniaId", table: "InsigniaNoteProfiles"); migrationBuilder.DropIndex( name: "IX_InsigniaNoteProfiles_OrgReturnInsigniaId", table: "InsigniaNoteProfiles"); migrationBuilder.DropColumn( name: "DateReceiveInsignia", table: "InsigniaNoteProfiles"); migrationBuilder.DropColumn( name: "DateReturnInsignia", table: "InsigniaNoteProfiles"); migrationBuilder.DropColumn( name: "DocReceiveInsigniaId", table: "InsigniaNoteProfiles"); migrationBuilder.DropColumn( name: "DocReturnInsigniaId", table: "InsigniaNoteProfiles"); migrationBuilder.DropColumn( name: "OrgReceiveInsigniaId", table: "InsigniaNoteProfiles"); migrationBuilder.DropColumn( name: "OrgReturnInsigniaId", table: "InsigniaNoteProfiles"); } } }