using Microsoft.EntityFrameworkCore.Migrations;

namespace YGNT.QuestionLibrary.Migrations
{
    public partial class _12 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_KnowledgePoints_CognitiveAbilities_CognitiveAbilityId",
                table: "KnowledgePoints");

            migrationBuilder.AlterColumn<int>(
                name: "CognitiveAbilityId",
                table: "KnowledgePoints",
                nullable: true,
                oldClrType: typeof(int),
                oldType: "int");

            migrationBuilder.AddForeignKey(
                name: "FK_KnowledgePoints_CognitiveAbilities_CognitiveAbilityId",
                table: "KnowledgePoints",
                column: "CognitiveAbilityId",
                principalTable: "CognitiveAbilities",
                principalColumn: "Id",
                onDelete: ReferentialAction.Restrict);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_KnowledgePoints_CognitiveAbilities_CognitiveAbilityId",
                table: "KnowledgePoints");

            migrationBuilder.AlterColumn<int>(
                name: "CognitiveAbilityId",
                table: "KnowledgePoints",
                type: "int",
                nullable: false,
                oldClrType: typeof(int),
                oldNullable: true);

            migrationBuilder.AddForeignKey(
                name: "FK_KnowledgePoints_CognitiveAbilities_CognitiveAbilityId",
                table: "KnowledgePoints",
                column: "CognitiveAbilityId",
                principalTable: "CognitiveAbilities",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }
    }
}
