using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Elecciones.Database.Migrations
{
    /// <inheritdoc />
    public partial class AddCategoriaIdToResumenVoto : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<int>(
                name: "CategoriaId",
                table: "ResumenesVotos",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.CreateIndex(
                name: "IX_ResumenesVotos_AmbitoGeograficoId_CategoriaId_AgrupacionPoliticaId",
                table: "ResumenesVotos",
                columns: new[] { "AmbitoGeograficoId", "CategoriaId", "AgrupacionPoliticaId" },
                unique: true);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropIndex(
                name: "IX_ResumenesVotos_AmbitoGeograficoId_CategoriaId_AgrupacionPoliticaId",
                table: "ResumenesVotos");

            migrationBuilder.DropColumn(
                name: "CategoriaId",
                table: "ResumenesVotos");
        }
    }
}
