| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- using Microsoft.EntityFrameworkCore.Migrations;
-
- #nullable disable
-
- namespace Diligent.WebAPI.Data.Migrations
- {
- public partial class SetFileEntityCategoryToBeNullable : Migration
- {
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropForeignKey(
- name: "FK_Files_Categories_CategoryId",
- table: "Files");
-
- migrationBuilder.AlterColumn<int>(
- name: "CategoryId",
- table: "Files",
- type: "int",
- nullable: true,
- oldClrType: typeof(int),
- oldType: "int");
-
- migrationBuilder.AddForeignKey(
- name: "FK_Files_Categories_CategoryId",
- table: "Files",
- column: "CategoryId",
- principalTable: "Categories",
- principalColumn: "Id");
- }
-
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropForeignKey(
- name: "FK_Files_Categories_CategoryId",
- table: "Files");
-
- migrationBuilder.AlterColumn<int>(
- name: "CategoryId",
- table: "Files",
- type: "int",
- nullable: false,
- defaultValue: 0,
- oldClrType: typeof(int),
- oldType: "int",
- oldNullable: true);
-
- migrationBuilder.AddForeignKey(
- name: "FK_Files_Categories_CategoryId",
- table: "Files",
- column: "CategoryId",
- principalTable: "Categories",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- }
- }
- }
|