Servizi e cose
This commit is contained in:
@ -0,0 +1,325 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace StandManager.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class EntitaEventi : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Cliente",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
RagioneSociale = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
PartitaIva = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Cap = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Citta = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Indirizzo = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Email = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
EmailInvito = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
NumeroTelefono = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
AgenteId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
DataCreazione = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DataModifica = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
Eliminato = table.Column<bool>(type: "bit", nullable: false),
|
||||
IdUtenteCreazione = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
IdUtenteModifica = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Cliente", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Cliente_Utente_AgenteId",
|
||||
column: x => x.AgenteId,
|
||||
principalTable: "Utente",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_Cliente_Utente_IdUtenteCreazione",
|
||||
column: x => x.IdUtenteCreazione,
|
||||
principalTable: "Utente",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_Cliente_Utente_IdUtenteModifica",
|
||||
column: x => x.IdUtenteModifica,
|
||||
principalTable: "Utente",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Evento",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
Titolo = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Descrizione = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Luogo = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
TemplateHtmlMailInvito = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
TemplateHtmlMailIscrizione = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
DataDa = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DataA = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DataCreazione = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DataModifica = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
Eliminato = table.Column<bool>(type: "bit", nullable: false),
|
||||
IdUtenteCreazione = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
IdUtenteModifica = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Evento", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Evento_Utente_IdUtenteCreazione",
|
||||
column: x => x.IdUtenteCreazione,
|
||||
principalTable: "Utente",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_Evento_Utente_IdUtenteModifica",
|
||||
column: x => x.IdUtenteModifica,
|
||||
principalTable: "Utente",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Destinazione",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
Clienteid = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
RagioneSociale = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
PartitaIva = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Cap = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Citta = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Indirizzo = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Email = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
EmailInvito = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
NumeroTelefono = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
AgenteId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
DataCreazione = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DataModifica = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
Eliminato = table.Column<bool>(type: "bit", nullable: false),
|
||||
IdUtenteCreazione = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
IdUtenteModifica = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Destinazione", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Destinazione_Cliente_Clienteid",
|
||||
column: x => x.Clienteid,
|
||||
principalTable: "Cliente",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_Destinazione_Utente_AgenteId",
|
||||
column: x => x.AgenteId,
|
||||
principalTable: "Utente",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_Destinazione_Utente_IdUtenteCreazione",
|
||||
column: x => x.IdUtenteCreazione,
|
||||
principalTable: "Utente",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_Destinazione_Utente_IdUtenteModifica",
|
||||
column: x => x.IdUtenteModifica,
|
||||
principalTable: "Utente",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "IscrizioneEvento",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
EventoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
ClienteId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
DestinazioneId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
Partecipanti = table.Column<int>(type: "int", nullable: false),
|
||||
Note = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
QrCodeCode = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
ScanCompleto = table.Column<bool>(type: "bit", nullable: false),
|
||||
DataScan = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
DataCreazione = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DataModifica = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
Eliminato = table.Column<bool>(type: "bit", nullable: false),
|
||||
IdUtenteCreazione = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
IdUtenteModifica = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_IscrizioneEvento", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_IscrizioneEvento_Cliente_ClienteId",
|
||||
column: x => x.ClienteId,
|
||||
principalTable: "Cliente",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_IscrizioneEvento_Destinazione_DestinazioneId",
|
||||
column: x => x.DestinazioneId,
|
||||
principalTable: "Destinazione",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_IscrizioneEvento_Evento_EventoId",
|
||||
column: x => x.EventoId,
|
||||
principalTable: "Evento",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_IscrizioneEvento_Utente_IdUtenteCreazione",
|
||||
column: x => x.IdUtenteCreazione,
|
||||
principalTable: "Utente",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_IscrizioneEvento_Utente_IdUtenteModifica",
|
||||
column: x => x.IdUtenteModifica,
|
||||
principalTable: "Utente",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Referente",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
DestinazioneId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
Nome = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Cognome = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Email = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
NumeroTelefono = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Ruolo = table.Column<int>(type: "int", nullable: false),
|
||||
RuoloNote = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
DataCreazione = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DataModifica = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
Eliminato = table.Column<bool>(type: "bit", nullable: false),
|
||||
IdUtenteCreazione = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
IdUtenteModifica = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Referente", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Referente_Destinazione_DestinazioneId",
|
||||
column: x => x.DestinazioneId,
|
||||
principalTable: "Destinazione",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_Referente_Utente_IdUtenteCreazione",
|
||||
column: x => x.IdUtenteCreazione,
|
||||
principalTable: "Utente",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_Referente_Utente_IdUtenteModifica",
|
||||
column: x => x.IdUtenteModifica,
|
||||
principalTable: "Utente",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Cliente_AgenteId",
|
||||
table: "Cliente",
|
||||
column: "AgenteId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Cliente_IdUtenteCreazione",
|
||||
table: "Cliente",
|
||||
column: "IdUtenteCreazione");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Cliente_IdUtenteModifica",
|
||||
table: "Cliente",
|
||||
column: "IdUtenteModifica");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Destinazione_AgenteId",
|
||||
table: "Destinazione",
|
||||
column: "AgenteId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Destinazione_Clienteid",
|
||||
table: "Destinazione",
|
||||
column: "Clienteid");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Destinazione_IdUtenteCreazione",
|
||||
table: "Destinazione",
|
||||
column: "IdUtenteCreazione");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Destinazione_IdUtenteModifica",
|
||||
table: "Destinazione",
|
||||
column: "IdUtenteModifica");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Evento_IdUtenteCreazione",
|
||||
table: "Evento",
|
||||
column: "IdUtenteCreazione");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Evento_IdUtenteModifica",
|
||||
table: "Evento",
|
||||
column: "IdUtenteModifica");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_IscrizioneEvento_ClienteId",
|
||||
table: "IscrizioneEvento",
|
||||
column: "ClienteId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_IscrizioneEvento_DestinazioneId",
|
||||
table: "IscrizioneEvento",
|
||||
column: "DestinazioneId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_IscrizioneEvento_EventoId",
|
||||
table: "IscrizioneEvento",
|
||||
column: "EventoId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_IscrizioneEvento_IdUtenteCreazione",
|
||||
table: "IscrizioneEvento",
|
||||
column: "IdUtenteCreazione");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_IscrizioneEvento_IdUtenteModifica",
|
||||
table: "IscrizioneEvento",
|
||||
column: "IdUtenteModifica");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Referente_DestinazioneId",
|
||||
table: "Referente",
|
||||
column: "DestinazioneId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Referente_IdUtenteCreazione",
|
||||
table: "Referente",
|
||||
column: "IdUtenteCreazione");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Referente_IdUtenteModifica",
|
||||
table: "Referente",
|
||||
column: "IdUtenteModifica");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "IscrizioneEvento");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Referente");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Evento");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Destinazione");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Cliente");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user