Prov/Citt

This commit is contained in:
2026-01-08 09:07:15 +01:00
parent 0b08a943a5
commit 941e24551c
20 changed files with 2699 additions and 28 deletions

View File

@ -0,0 +1,9 @@
BEGIN TRANSACTION;
ALTER TABLE [Destinazione] ADD [Provincia] nvarchar(max) NULL;
INSERT INTO [__EFMigrationsHistory] ([MigrationId], [ProductVersion])
VALUES (N'20251223132320_ProvinciaInDest', N'9.0.11');
COMMIT;
GO

File diff suppressed because it is too large Load Diff

View File

@ -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");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,49 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace StandManager.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class ProvSuComune : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Guid>(
name: "ProvinciaIstatId",
table: "ComuneIstat",
type: "uniqueidentifier",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_ComuneIstat_ProvinciaIstatId",
table: "ComuneIstat",
column: "ProvinciaIstatId");
migrationBuilder.AddForeignKey(
name: "FK_ComuneIstat_Province_ProvinciaIstatId",
table: "ComuneIstat",
column: "ProvinciaIstatId",
principalTable: "Province",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_ComuneIstat_Province_ProvinciaIstatId",
table: "ComuneIstat");
migrationBuilder.DropIndex(
name: "IX_ComuneIstat_ProvinciaIstatId",
table: "ComuneIstat");
migrationBuilder.DropColumn(
name: "ProvinciaIstatId",
table: "ComuneIstat");
}
}
}

View File

@ -143,6 +143,9 @@ namespace StandManager.Infrastructure.Migrations
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<Guid?>("ProvinciaIstatId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Regione")
.IsRequired()
.HasColumnType("nvarchar(max)");
@ -153,6 +156,8 @@ namespace StandManager.Infrastructure.Migrations
b.HasIndex("IdUtenteModifica");
b.HasIndex("ProvinciaIstatId");
b.ToTable("ComuneIstat");
});
@ -177,6 +182,9 @@ namespace StandManager.Infrastructure.Migrations
b.Property<string>("CodiceFiscale")
.HasColumnType("nvarchar(max)");
b.Property<Guid?>("ComuneIstatId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("DataCreazione")
.HasColumnType("datetime2");
@ -211,6 +219,9 @@ namespace StandManager.Infrastructure.Migrations
b.Property<string>("Provincia")
.HasColumnType("nvarchar(max)");
b.Property<Guid?>("ProvinciaIstatId")
.HasColumnType("uniqueidentifier");
b.Property<string>("RagioneSociale")
.IsRequired()
.HasColumnType("nvarchar(max)");
@ -224,10 +235,14 @@ namespace StandManager.Infrastructure.Migrations
b.HasIndex("ClienteId");
b.HasIndex("ComuneIstatId");
b.HasIndex("IdUtenteCreazione");
b.HasIndex("IdUtenteModifica");
b.HasIndex("ProvinciaIstatId");
b.ToTable("Destinazione");
});
@ -843,6 +858,12 @@ namespace StandManager.Infrastructure.Migrations
.WithMany()
.HasForeignKey("IdUtenteModifica");
b.HasOne("StandManager.Domain.Entita.ProvinciaIstat", "ProvinciaIstat")
.WithMany()
.HasForeignKey("ProvinciaIstatId");
b.Navigation("ProvinciaIstat");
b.Navigation("UtenteCreazione");
b.Navigation("UtenteModifica");
@ -858,6 +879,10 @@ namespace StandManager.Infrastructure.Migrations
.WithMany("Destinazioni")
.HasForeignKey("ClienteId");
b.HasOne("StandManager.Domain.Entita.ComuneIstat", "ComuneIstat")
.WithMany()
.HasForeignKey("ComuneIstatId");
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteCreazione")
.WithMany()
.HasForeignKey("IdUtenteCreazione");
@ -866,10 +891,18 @@ namespace StandManager.Infrastructure.Migrations
.WithMany()
.HasForeignKey("IdUtenteModifica");
b.HasOne("StandManager.Domain.Entita.ProvinciaIstat", "ProvinciaIstat")
.WithMany()
.HasForeignKey("ProvinciaIstatId");
b.Navigation("Agente");
b.Navigation("Cliente");
b.Navigation("ComuneIstat");
b.Navigation("ProvinciaIstat");
b.Navigation("UtenteCreazione");
b.Navigation("UtenteModifica");
@ -920,7 +953,7 @@ namespace StandManager.Infrastructure.Migrations
.HasForeignKey("ClienteId");
b.HasOne("StandManager.Domain.Entita.Evento", "Evento")
.WithMany()
.WithMany("InvitoEventoList")
.HasForeignKey("EventoId");
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteCreazione")
@ -955,7 +988,7 @@ namespace StandManager.Infrastructure.Migrations
.HasForeignKey("DestinazioneId");
b.HasOne("StandManager.Domain.Entita.Evento", "Evento")
.WithMany()
.WithMany("IscrizioneEventoList")
.HasForeignKey("EventoId");
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteCreazione")
@ -1144,6 +1177,13 @@ namespace StandManager.Infrastructure.Migrations
b.Navigation("Referenti");
});
modelBuilder.Entity("StandManager.Domain.Entita.Evento", b =>
{
b.Navigation("InvitoEventoList");
b.Navigation("IscrizioneEventoList");
});
modelBuilder.Entity("StandManager.Domain.Entita.InvitoEvento", b =>
{
b.Navigation("IscrizioniEvento");