using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb { /// public partial class addtableDisciplineInvestigate1 : Migration { /// 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( 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); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_DisciplineInvestigate_Directors_DisciplineInvestigates_Disci~", table: "DisciplineInvestigate_Directors"); migrationBuilder.AlterColumn( 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( 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"); } } }