using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace PARR.DAL.Migrations
{
    /// <inheritdoc />
    public partial class TblTemplatesUpd2 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_Templates_RobotStatuses_RobotStatusCode",
                table: "Templates");

            migrationBuilder.DropForeignKey(
                name: "FK_Templates_TaskStatuses_TaskStatusCode",
                table: "Templates");

            migrationBuilder.DropIndex(
                name: "IX_Templates_RobotStatusCode",
                table: "Templates");

            migrationBuilder.DropIndex(
                name: "IX_Templates_TaskStatusCode",
                table: "Templates");

            migrationBuilder.DropColumn(
                name: "RobotStatusCode",
                table: "Templates");

            migrationBuilder.DropColumn(
                name: "TaskStatusCode",
                table: "Templates");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<int>(
                name: "RobotStatusCode",
                table: "Templates",
                type: "integer",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "TaskStatusCode",
                table: "Templates",
                type: "integer",
                nullable: true);

            migrationBuilder.CreateIndex(
                name: "IX_Templates_RobotStatusCode",
                table: "Templates",
                column: "RobotStatusCode");

            migrationBuilder.CreateIndex(
                name: "IX_Templates_TaskStatusCode",
                table: "Templates",
                column: "TaskStatusCode");

            migrationBuilder.AddForeignKey(
                name: "FK_Templates_RobotStatuses_RobotStatusCode",
                table: "Templates",
                column: "RobotStatusCode",
                principalTable: "RobotStatuses",
                principalColumn: "Code");

            migrationBuilder.AddForeignKey(
                name: "FK_Templates_TaskStatuses_TaskStatusCode",
                table: "Templates",
                column: "TaskStatusCode",
                principalTable: "TaskStatuses",
                principalColumn: "Code");
        }
    }
}
