using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace PARR.DAL.Migrations
{
    /// <inheritdoc />
    public partial class tblTaskItemAddProgressPercent : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<int>(
                name: "ProgressPercent",
                schema: "task",
                table: "Tasks",
                type: "integer",
                nullable: true,
                comment: "Процент выполнения задачи");

            migrationBuilder.InsertData(
                table: "ParrComponents",
                columns: new[] { "Id", "Description", "Name" },
                values: new object[] { 14, "Генератор кэша отчетов workload", "WorkloadBuilder" });

            migrationBuilder.UpdateData(
                schema: "task",
                table: "Types",
                keyColumn: "Code",
                keyValue: 0,
                column: "MaxExecutionTimeMinutes",
                value: 90);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DeleteData(
                table: "ParrComponents",
                keyColumn: "Id",
                keyValue: 14);

            migrationBuilder.DropColumn(
                name: "ProgressPercent",
                schema: "task",
                table: "Tasks");

            migrationBuilder.UpdateData(
                schema: "task",
                table: "Types",
                keyColumn: "Code",
                keyValue: 0,
                column: "MaxExecutionTimeMinutes",
                value: 60);
        }
    }
}
