using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace StandManager.Infrastructure.Migrations
{
///
public partial class CittaEProv : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn(
name: "ComuneIstatId",
table: "Destinazione",
type: "uniqueidentifier",
nullable: true);
migrationBuilder.AddColumn(
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");
}
///
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");
}
}
}