using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace IRaCIS.Core.Infra.EFCore.Migrations
{
    /// <inheritdoc />
    public partial class ShowChartType : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<int>(
                name: "ShowChartTypeEnum",
                table: "ReadingTableQuestionTrial",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<int>(
                name: "ShowChartTypeEnum",
                table: "ReadingTableQuestionSystem",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<int>(
                name: "ShowChartTypeEnum",
                table: "ReadingQuestionTrial",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<int>(
                name: "ShowChartTypeEnum",
                table: "ReadingQuestionSystem",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.CreateIndex(
                name: "IX_TrialCriterionKeyFile_TrialCriterionId",
                table: "TrialCriterionKeyFile",
                column: "TrialCriterionId");

            migrationBuilder.AddForeignKey(
                name: "FK_TrialCriterionKeyFile_ReadingQuestionCriterionTrial_TrialCriterionId",
                table: "TrialCriterionKeyFile",
                column: "TrialCriterionId",
                principalTable: "ReadingQuestionCriterionTrial",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_TrialCriterionKeyFile_ReadingQuestionCriterionTrial_TrialCriterionId",
                table: "TrialCriterionKeyFile");

            migrationBuilder.DropIndex(
                name: "IX_TrialCriterionKeyFile_TrialCriterionId",
                table: "TrialCriterionKeyFile");

            migrationBuilder.DropColumn(
                name: "ShowChartTypeEnum",
                table: "ReadingTableQuestionTrial");

            migrationBuilder.DropColumn(
                name: "ShowChartTypeEnum",
                table: "ReadingTableQuestionSystem");

            migrationBuilder.DropColumn(
                name: "ShowChartTypeEnum",
                table: "ReadingQuestionTrial");

            migrationBuilder.DropColumn(
                name: "ShowChartTypeEnum",
                table: "ReadingQuestionSystem");
        }
    }
}
