using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace PARR.DAL.Migrations
{
    /// <inheritdoc />
    public partial class tbjJobAutoControl : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "AutoControls",
                schema: "job",
                columns: table => new
                {
                    JobId = table.Column<Guid>(type: "uuid", nullable: false),
                    IsEnable = table.Column<bool>(type: "boolean", nullable: false),
                    SyncIsActiveTemplate = table.Column<bool>(type: "boolean", nullable: false),
                    SyncIsActiveSchedule = table.Column<bool>(type: "boolean", nullable: false),
                    UpdateIsActiveTemplate = table.Column<bool>(type: "boolean", nullable: false),
                    UpdateIsActiveSchedule = table.Column<bool>(type: "boolean", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_AutoControls", x => x.JobId);
                    table.ForeignKey(
                        name: "FK_AutoControls_Jobs_JobId",
                        column: x => x.JobId,
                        principalSchema: "job",
                        principalTable: "Jobs",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                },
                comment: "Таблица управления автоконтролем для работ");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "AutoControls",
                schema: "job");
        }
    }
}
