using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Marco.Pms.DataAccess.Migrations { /// public partial class Made_ComentId_Nullable_In_TicketAttachment : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_TicketAttachments_TicketComments_CommentId", table: "TicketAttachments"); migrationBuilder.AlterColumn( name: "CommentId", table: "TicketAttachments", type: "char(36)", nullable: true, collation: "ascii_general_ci", oldClrType: typeof(Guid), oldType: "char(36)") .OldAnnotation("Relational:Collation", "ascii_general_ci"); migrationBuilder.AddForeignKey( name: "FK_TicketAttachments_TicketComments_CommentId", table: "TicketAttachments", column: "CommentId", principalTable: "TicketComments", principalColumn: "Id"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_TicketAttachments_TicketComments_CommentId", table: "TicketAttachments"); migrationBuilder.AlterColumn( name: "CommentId", table: "TicketAttachments", 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_TicketAttachments_TicketComments_CommentId", table: "TicketAttachments", column: "CommentId", principalTable: "TicketComments", principalColumn: "Id", onDelete: ReferentialAction.Cascade); } } }