GuidComune

This commit is contained in:
2025-12-22 17:01:43 +01:00
parent 8e4daf5f2e
commit 4c6c44ce6f
7 changed files with 1278 additions and 12 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,59 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace StandManager.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class GuidComune : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Comune",
table: "IscrizioneEvento");
migrationBuilder.AddColumn<Guid>(
name: "ComuneId",
table: "IscrizioneEvento",
type: "uniqueidentifier",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_IscrizioneEvento_ComuneId",
table: "IscrizioneEvento",
column: "ComuneId");
migrationBuilder.AddForeignKey(
name: "FK_IscrizioneEvento_ComuneIstat_ComuneId",
table: "IscrizioneEvento",
column: "ComuneId",
principalTable: "ComuneIstat",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_IscrizioneEvento_ComuneIstat_ComuneId",
table: "IscrizioneEvento");
migrationBuilder.DropIndex(
name: "IX_IscrizioneEvento_ComuneId",
table: "IscrizioneEvento");
migrationBuilder.DropColumn(
name: "ComuneId",
table: "IscrizioneEvento");
migrationBuilder.AddColumn<string>(
name: "Comune",
table: "IscrizioneEvento",
type: "nvarchar(max)",
nullable: true);
}
}
}

View File

@ -398,8 +398,8 @@ namespace StandManager.Infrastructure.Migrations
b.Property<string>("Cognome")
.HasColumnType("nvarchar(max)");
b.Property<string>("Comune")
.HasColumnType("nvarchar(max)");
b.Property<Guid?>("ComuneId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("DataCreazione")
.HasColumnType("datetime2");
@ -471,6 +471,8 @@ namespace StandManager.Infrastructure.Migrations
b.HasIndex("ClienteId");
b.HasIndex("ComuneId");
b.HasIndex("DestinazioneId");
b.HasIndex("EventoId");
@ -941,6 +943,10 @@ namespace StandManager.Infrastructure.Migrations
.WithMany()
.HasForeignKey("ClienteId");
b.HasOne("StandManager.Domain.Entita.ComuneIstat", "Comune")
.WithMany()
.HasForeignKey("ComuneId");
b.HasOne("StandManager.Domain.Entita.Destinazione", "Destinazione")
.WithMany()
.HasForeignKey("DestinazioneId");
@ -971,6 +977,8 @@ namespace StandManager.Infrastructure.Migrations
b.Navigation("Cliente");
b.Navigation("Comune");
b.Navigation("Destinazione");
b.Navigation("Evento");