using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace PARR.DAL.Migrations
{
    /// <inheritdoc />
    public partial class tblUnitFieldsAddIsMultipleValueClmn : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropPrimaryKey(
                name: "PK_UnitInValues",
                schema: "unit",
                table: "UnitInValues");

            migrationBuilder.AddColumn<bool>(
                name: "IsMultipleValue",
                schema: "unit",
                table: "Fields",
                type: "boolean",
                nullable: true);

            migrationBuilder.AddPrimaryKey(
                name: "PK_UnitInValues",
                schema: "unit",
                table: "UnitInValues",
                columns: new[] { "UnitId", "FieldId", "ValueId" });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropPrimaryKey(
                name: "PK_UnitInValues",
                schema: "unit",
                table: "UnitInValues");

            migrationBuilder.DropColumn(
                name: "IsMultipleValue",
                schema: "unit",
                table: "Fields");

            migrationBuilder.AddPrimaryKey(
                name: "PK_UnitInValues",
                schema: "unit",
                table: "UnitInValues",
                columns: new[] { "UnitId", "FieldId" });
        }
    }
}
