using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace OpenArchival.DataAccess.Migrations { /// public partial class NullableParentArtifactEntryId : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_ArtifactFilePaths_ArtifactEntries_ParentArtifactEntryId", table: "ArtifactFilePaths"); migrationBuilder.AlterColumn( name: "ParentArtifactEntryId", table: "ArtifactFilePaths", type: "integer", nullable: true, oldClrType: typeof(int), oldType: "integer"); migrationBuilder.AddForeignKey( name: "FK_ArtifactFilePaths_ArtifactEntries_ParentArtifactEntryId", table: "ArtifactFilePaths", column: "ParentArtifactEntryId", principalTable: "ArtifactEntries", principalColumn: "Id"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_ArtifactFilePaths_ArtifactEntries_ParentArtifactEntryId", table: "ArtifactFilePaths"); migrationBuilder.AlterColumn( name: "ParentArtifactEntryId", table: "ArtifactFilePaths", type: "integer", nullable: false, defaultValue: 0, oldClrType: typeof(int), oldType: "integer", oldNullable: true); migrationBuilder.AddForeignKey( name: "FK_ArtifactFilePaths_ArtifactEntries_ParentArtifactEntryId", table: "ArtifactFilePaths", column: "ParentArtifactEntryId", principalTable: "ArtifactEntries", principalColumn: "Id", onDelete: ReferentialAction.Cascade); } } }