hrms-api-backend/BMA.EHR.Infrastructure/Migrations/20240523093017_update table PlacementReceiveadd gender.cs

192 lines
6.6 KiB
C#
Raw Normal View History

2024-05-23 17:07:55 +07:00
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class updatetablePlacementReceiveaddgender : Migration
{
/// <inheritdoc />
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<string>(
name: "BloodGroup",
table: "PlacementReceives",
type: "longtext",
nullable: true,
comment: "Id กลุ่มเลือด")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "Gender",
table: "PlacementReceives",
type: "longtext",
nullable: true,
comment: "Id เพศ")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "Relationship",
table: "PlacementReceives",
type: "longtext",
nullable: true,
comment: "Id สถานะภาพ")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "Religion",
table: "PlacementReceives",
type: "longtext",
nullable: true,
comment: "Id ศาสนา")
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
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<Guid>(
name: "BloodGroupId",
table: "PlacementReceives",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "GenderId",
table: "PlacementReceives",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "RelationshipId",
table: "PlacementReceives",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
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");
}
}
}