using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Jiaowu.Api.Infrastructure.Persistence.Migrations.MySql
{
    /// <inheritdoc />
    public partial class CourseAdjustmentOccurrences : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<Guid>(
                name: "SourceClassroomId",
                table: "CourseAdjustments",
                type: "char(36)",
                nullable: true);

            migrationBuilder.AddColumn<DateTime>(
                name: "SourceDate",
                table: "CourseAdjustments",
                type: "date",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "SourcePeriodCount",
                table: "CourseAdjustments",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<Guid>(
                name: "SourceScheduleEntryId",
                table: "CourseAdjustments",
                type: "char(36)",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "SourceStartPeriod",
                table: "CourseAdjustments",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "SourceWeek",
                table: "CourseAdjustments",
                type: "int",
                nullable: true);

            migrationBuilder.CreateIndex(
                name: "IX_CourseAdjustments_SourceScheduleEntryId_SourceWeek",
                table: "CourseAdjustments",
                columns: new[] { "SourceScheduleEntryId", "SourceWeek" });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropIndex(
                name: "IX_CourseAdjustments_SourceScheduleEntryId_SourceWeek",
                table: "CourseAdjustments");

            migrationBuilder.DropColumn(
                name: "SourceClassroomId",
                table: "CourseAdjustments");

            migrationBuilder.DropColumn(
                name: "SourceDate",
                table: "CourseAdjustments");

            migrationBuilder.DropColumn(
                name: "SourcePeriodCount",
                table: "CourseAdjustments");

            migrationBuilder.DropColumn(
                name: "SourceScheduleEntryId",
                table: "CourseAdjustments");

            migrationBuilder.DropColumn(
                name: "SourceStartPeriod",
                table: "CourseAdjustments");

            migrationBuilder.DropColumn(
                name: "SourceWeek",
                table: "CourseAdjustments");
        }
    }
}
