49 lines
1.6 KiB
C#
49 lines
1.6 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace Elecciones.Database.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddCategoriaIdToProyeccionesBancas : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_ProyeccionesBancas_AmbitoGeograficoId",
|
|
table: "ProyeccionesBancas");
|
|
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "CategoriaId",
|
|
table: "ProyeccionesBancas",
|
|
type: "int",
|
|
nullable: false,
|
|
defaultValue: 0);
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_ProyeccionesBancas_AmbitoGeograficoId_CategoriaId_AgrupacionPoliticaId",
|
|
table: "ProyeccionesBancas",
|
|
columns: new[] { "AmbitoGeograficoId", "CategoriaId", "AgrupacionPoliticaId" },
|
|
unique: true);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_ProyeccionesBancas_AmbitoGeograficoId_CategoriaId_AgrupacionPoliticaId",
|
|
table: "ProyeccionesBancas");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "CategoriaId",
|
|
table: "ProyeccionesBancas");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_ProyeccionesBancas_AmbitoGeograficoId",
|
|
table: "ProyeccionesBancas",
|
|
column: "AmbitoGeograficoId");
|
|
}
|
|
}
|
|
}
|