using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace BMA.EHR.Infrastructure.Migrations { /// public partial class updatetablePlacementReceiveaddgender : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_PlacementReceives_BloodGroups_BloodGroupId", table: "PlacementReceives"); migrationBuilder.DropForeignKey( name: "FK_PlacementReceives_Genders_GenderId", table: "PlacementReceives"); migrationBuilder.DropForeignKey( name: "FK_PlacementReceives_Relationships_RelationshipId", table: "PlacementReceives"); migrationBuilder.DropForeignKey( name: "FK_PlacementReceives_Religions_ReligionId", table: "PlacementReceives"); migrationBuilder.DropIndex( name: "IX_PlacementReceives_BloodGroupId", table: "PlacementReceives"); migrationBuilder.DropIndex( name: "IX_PlacementReceives_GenderId", table: "PlacementReceives"); migrationBuilder.DropIndex( name: "IX_PlacementReceives_RelationshipId", table: "PlacementReceives"); migrationBuilder.DropIndex( name: "IX_PlacementReceives_ReligionId", table: "PlacementReceives"); migrationBuilder.DropColumn( name: "BloodGroupId", table: "PlacementReceives"); migrationBuilder.DropColumn( name: "GenderId", table: "PlacementReceives"); migrationBuilder.DropColumn( name: "RelationshipId", table: "PlacementReceives"); migrationBuilder.DropColumn( name: "ReligionId", table: "PlacementReceives"); migrationBuilder.AddColumn( name: "BloodGroup", table: "PlacementReceives", type: "longtext", nullable: true, comment: "Id กลุ่มเลือด") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "Gender", table: "PlacementReceives", type: "longtext", nullable: true, comment: "Id เพศ") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "Relationship", table: "PlacementReceives", type: "longtext", nullable: true, comment: "Id สถานะภาพ") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "Religion", table: "PlacementReceives", type: "longtext", nullable: true, comment: "Id ศาสนา") .Annotation("MySql:CharSet", "utf8mb4"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropColumn( name: "BloodGroup", table: "PlacementReceives"); migrationBuilder.DropColumn( name: "Gender", table: "PlacementReceives"); migrationBuilder.DropColumn( name: "Relationship", table: "PlacementReceives"); migrationBuilder.DropColumn( name: "Religion", table: "PlacementReceives"); migrationBuilder.AddColumn( name: "BloodGroupId", table: "PlacementReceives", type: "char(36)", nullable: true, collation: "ascii_general_ci"); migrationBuilder.AddColumn( name: "GenderId", table: "PlacementReceives", type: "char(36)", nullable: true, collation: "ascii_general_ci"); migrationBuilder.AddColumn( name: "RelationshipId", table: "PlacementReceives", type: "char(36)", nullable: true, collation: "ascii_general_ci"); migrationBuilder.AddColumn( name: "ReligionId", table: "PlacementReceives", type: "char(36)", nullable: true, collation: "ascii_general_ci"); migrationBuilder.CreateIndex( name: "IX_PlacementReceives_BloodGroupId", table: "PlacementReceives", column: "BloodGroupId"); migrationBuilder.CreateIndex( name: "IX_PlacementReceives_GenderId", table: "PlacementReceives", column: "GenderId"); migrationBuilder.CreateIndex( name: "IX_PlacementReceives_RelationshipId", table: "PlacementReceives", column: "RelationshipId"); migrationBuilder.CreateIndex( name: "IX_PlacementReceives_ReligionId", table: "PlacementReceives", column: "ReligionId"); migrationBuilder.AddForeignKey( name: "FK_PlacementReceives_BloodGroups_BloodGroupId", table: "PlacementReceives", column: "BloodGroupId", principalTable: "BloodGroups", principalColumn: "Id"); migrationBuilder.AddForeignKey( name: "FK_PlacementReceives_Genders_GenderId", table: "PlacementReceives", column: "GenderId", principalTable: "Genders", principalColumn: "Id"); migrationBuilder.AddForeignKey( name: "FK_PlacementReceives_Relationships_RelationshipId", table: "PlacementReceives", column: "RelationshipId", principalTable: "Relationships", principalColumn: "Id"); migrationBuilder.AddForeignKey( name: "FK_PlacementReceives_Religions_ReligionId", table: "PlacementReceives", column: "ReligionId", principalTable: "Religions", principalColumn: "Id"); } } }