using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Data.Migrations
{
    /// <inheritdoc />
    public partial class EventDefinition_Update : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "MaxTeamCountState",
                table: "Events");

            migrationBuilder.DropColumn(
                name: "RegionalEvent",
                table: "Events");

            migrationBuilder.RenameColumn(
                name: "StatePretesting",
                table: "Events",
                newName: "Presubmission");

            migrationBuilder.RenameColumn(
                name: "StatePresubmission",
                table: "Events",
                newName: "OnSiteActivity");

            migrationBuilder.RenameColumn(
                name: "StatePreliminaryRound",
                table: "Events",
                newName: "ChapterEligibilityCountState");

            migrationBuilder.RenameColumn(
                name: "RegionalPresubmit",
                table: "Events",
                newName: "ChapterEligibilityCountRegionals");

            migrationBuilder.AlterColumn<string>(
                name: "ShortName",
                table: "Events",
                type: "TEXT",
                maxLength: 40,
                nullable: false,
                defaultValue: "",
                oldClrType: typeof(string),
                oldType: "TEXT",
                oldNullable: true);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.RenameColumn(
                name: "Presubmission",
                table: "Events",
                newName: "StatePretesting");

            migrationBuilder.RenameColumn(
                name: "OnSiteActivity",
                table: "Events",
                newName: "StatePresubmission");

            migrationBuilder.RenameColumn(
                name: "ChapterEligibilityCountState",
                table: "Events",
                newName: "StatePreliminaryRound");

            migrationBuilder.RenameColumn(
                name: "ChapterEligibilityCountRegionals",
                table: "Events",
                newName: "RegionalPresubmit");

            migrationBuilder.AlterColumn<string>(
                name: "ShortName",
                table: "Events",
                type: "TEXT",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "TEXT",
                oldMaxLength: 40);

            migrationBuilder.AddColumn<int>(
                name: "MaxTeamCountState",
                table: "Events",
                type: "INTEGER",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<bool>(
                name: "RegionalEvent",
                table: "Events",
                type: "INTEGER",
                nullable: false,
                defaultValue: false);
        }
    }
}
