hrms-api-backend/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231123100343_add table DisciplineInvestigate1.cs
2023-11-23 19:59:24 +07:00

97 lines
4 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
{
/// <inheritdoc />
public partial class addtableDisciplineInvestigate1 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_DisciplineInvestigate_Directors_DisciplineComplaints_Discipl~",
table: "DisciplineInvestigate_Directors");
migrationBuilder.DropForeignKey(
name: "FK_DisciplineInvestigate_Directors_DisciplineInvestigates_Disci~",
table: "DisciplineInvestigate_Directors");
migrationBuilder.DropIndex(
name: "IX_DisciplineInvestigate_Directors_DisciplineComplaintId",
table: "DisciplineInvestigate_Directors");
migrationBuilder.DropColumn(
name: "DisciplineComplaintId",
table: "DisciplineInvestigate_Directors");
migrationBuilder.AlterColumn<Guid>(
name: "DisciplineInvestigateId",
table: "DisciplineInvestigate_Directors",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)",
oldNullable: true)
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AddForeignKey(
name: "FK_DisciplineInvestigate_Directors_DisciplineInvestigates_Disci~",
table: "DisciplineInvestigate_Directors",
column: "DisciplineInvestigateId",
principalTable: "DisciplineInvestigates",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_DisciplineInvestigate_Directors_DisciplineInvestigates_Disci~",
table: "DisciplineInvestigate_Directors");
migrationBuilder.AlterColumn<Guid>(
name: "DisciplineInvestigateId",
table: "DisciplineInvestigate_Directors",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)")
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "DisciplineComplaintId",
table: "DisciplineInvestigate_Directors",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci");
migrationBuilder.CreateIndex(
name: "IX_DisciplineInvestigate_Directors_DisciplineComplaintId",
table: "DisciplineInvestigate_Directors",
column: "DisciplineComplaintId");
migrationBuilder.AddForeignKey(
name: "FK_DisciplineInvestigate_Directors_DisciplineComplaints_Discipl~",
table: "DisciplineInvestigate_Directors",
column: "DisciplineComplaintId",
principalTable: "DisciplineComplaints",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_DisciplineInvestigate_Directors_DisciplineInvestigates_Disci~",
table: "DisciplineInvestigate_Directors",
column: "DisciplineInvestigateId",
principalTable: "DisciplineInvestigates",
principalColumn: "Id");
}
}
}