Files
StandManager/StandManager.Infrastructure/Migrations/20260107093044_CittaEProv.cs
2026-01-08 09:07:15 +01:00

80 lines
2.5 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace StandManager.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class CittaEProv : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Guid>(
name: "ComuneIstatId",
table: "Destinazione",
type: "uniqueidentifier",
nullable: true);
migrationBuilder.AddColumn<Guid>(
name: "ProvinciaIstatId",
table: "Destinazione",
type: "uniqueidentifier",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_Destinazione_ComuneIstatId",
table: "Destinazione",
column: "ComuneIstatId");
migrationBuilder.CreateIndex(
name: "IX_Destinazione_ProvinciaIstatId",
table: "Destinazione",
column: "ProvinciaIstatId");
migrationBuilder.AddForeignKey(
name: "FK_Destinazione_ComuneIstat_ComuneIstatId",
table: "Destinazione",
column: "ComuneIstatId",
principalTable: "ComuneIstat",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_Destinazione_Province_ProvinciaIstatId",
table: "Destinazione",
column: "ProvinciaIstatId",
principalTable: "Province",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Destinazione_ComuneIstat_ComuneIstatId",
table: "Destinazione");
migrationBuilder.DropForeignKey(
name: "FK_Destinazione_Province_ProvinciaIstatId",
table: "Destinazione");
migrationBuilder.DropIndex(
name: "IX_Destinazione_ComuneIstatId",
table: "Destinazione");
migrationBuilder.DropIndex(
name: "IX_Destinazione_ProvinciaIstatId",
table: "Destinazione");
migrationBuilder.DropColumn(
name: "ComuneIstatId",
table: "Destinazione");
migrationBuilder.DropColumn(
name: "ProvinciaIstatId",
table: "Destinazione");
}
}
}