using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Aberwyn.Migrations
{
    public partial class AddMealNamesToWeeklyMenu : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropPrimaryKey(
                name: "PK_WeeklyMenus",
                table: "WeeklyMenus");

            migrationBuilder.RenameTable(
                name: "WeeklyMenus",
                newName: "WeeklyMenu");

            migrationBuilder.AlterColumn<string>(
                name: "LunchMealName",
                table: "WeeklyMenu",
                type: "longtext",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "longtext")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<string>(
                name: "DinnerMealName",
                table: "WeeklyMenu",
                type: "longtext",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "longtext")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<string>(
                name: "Cook",
                table: "WeeklyMenu",
                type: "longtext",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "longtext")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<string>(
                name: "BreakfastMealName",
                table: "WeeklyMenu",
                type: "longtext",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "longtext")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddPrimaryKey(
                name: "PK_WeeklyMenu",
                table: "WeeklyMenu",
                column: "Id");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropPrimaryKey(
                name: "PK_WeeklyMenu",
                table: "WeeklyMenu");

            migrationBuilder.RenameTable(
                name: "WeeklyMenu",
                newName: "WeeklyMenus");

            migrationBuilder.UpdateData(
                table: "WeeklyMenus",
                keyColumn: "LunchMealName",
                keyValue: null,
                column: "LunchMealName",
                value: "");

            migrationBuilder.AlterColumn<string>(
                name: "LunchMealName",
                table: "WeeklyMenus",
                type: "longtext",
                nullable: false,
                oldClrType: typeof(string),
                oldType: "longtext",
                oldNullable: true)
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.UpdateData(
                table: "WeeklyMenus",
                keyColumn: "DinnerMealName",
                keyValue: null,
                column: "DinnerMealName",
                value: "");

            migrationBuilder.AlterColumn<string>(
                name: "DinnerMealName",
                table: "WeeklyMenus",
                type: "longtext",
                nullable: false,
                oldClrType: typeof(string),
                oldType: "longtext",
                oldNullable: true)
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.UpdateData(
                table: "WeeklyMenus",
                keyColumn: "Cook",
                keyValue: null,
                column: "Cook",
                value: "");

            migrationBuilder.AlterColumn<string>(
                name: "Cook",
                table: "WeeklyMenus",
                type: "longtext",
                nullable: false,
                oldClrType: typeof(string),
                oldType: "longtext",
                oldNullable: true)
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.UpdateData(
                table: "WeeklyMenus",
                keyColumn: "BreakfastMealName",
                keyValue: null,
                column: "BreakfastMealName",
                value: "");

            migrationBuilder.AlterColumn<string>(
                name: "BreakfastMealName",
                table: "WeeklyMenus",
                type: "longtext",
                nullable: false,
                oldClrType: typeof(string),
                oldType: "longtext",
                oldNullable: true)
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddPrimaryKey(
                name: "PK_WeeklyMenus",
                table: "WeeklyMenus",
                column: "Id");
        }
    }
}
