using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace DocuMed.Repository.Migrations { /// public partial class UpdateStudentSetSectionIdNull : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Students_Sections_SectionId", schema: "public", table: "Students"); migrationBuilder.AlterColumn( name: "SectionId", schema: "public", table: "Students", type: "uuid", nullable: true, oldClrType: typeof(Guid), oldType: "uuid"); migrationBuilder.AddForeignKey( name: "FK_Students_Sections_SectionId", schema: "public", table: "Students", column: "SectionId", principalSchema: "public", principalTable: "Sections", principalColumn: "Id"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Students_Sections_SectionId", schema: "public", table: "Students"); migrationBuilder.AlterColumn( name: "SectionId", schema: "public", table: "Students", type: "uuid", nullable: false, defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), oldClrType: typeof(Guid), oldType: "uuid", oldNullable: true); migrationBuilder.AddForeignKey( name: "FK_Students_Sections_SectionId", schema: "public", table: "Students", column: "SectionId", principalSchema: "public", principalTable: "Sections", principalColumn: "Id", onDelete: ReferentialAction.Restrict); } } }