using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace OmsorgCore.Infrastructure.Persistence.Migrations
{
    /// <inheritdoc />
    public partial class AddAssignmentValidationSettingsAndBlocksAssignmentFlag : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<bool>(
                name: "BlocksAssignment",
                table: "value_list_items",
                type: "boolean",
                nullable: false,
                defaultValue: false);

            migrationBuilder.CreateTable(
                name: "assignment_validation_settings",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uuid", nullable: false),
                    QualificationMode = table.Column<int>(type: "integer", nullable: false),
                    AbsenceMode = table.Column<int>(type: "integer", nullable: false),
                    WorkingHoursMode = table.Column<int>(type: "integer", nullable: false),
                    OverlapMode = table.Column<int>(type: "integer", nullable: false),
                    ContractMode = table.Column<int>(type: "integer", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_assignment_validation_settings", x => x.Id);
                });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "assignment_validation_settings");

            migrationBuilder.DropColumn(
                name: "BlocksAssignment",
                table: "value_list_items");
        }
    }
}
