Prov/Citt
This commit is contained in:
@ -0,0 +1,79 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user