using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace StandManager.Infrastructure.Migrations
{
///
public partial class InvitoEvento : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn(
name: "InvitoEventoId",
table: "IscrizioneEvento",
type: "uniqueidentifier",
nullable: true);
migrationBuilder.CreateTable(
name: "InvitoEvento",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
EventoId = table.Column(type: "uniqueidentifier", nullable: true),
ClienteId = table.Column(type: "uniqueidentifier", nullable: true),
DataCreazione = table.Column(type: "datetime2", nullable: false),
DataModifica = table.Column(type: "datetime2", nullable: true),
Eliminato = table.Column(type: "bit", nullable: false),
IdUtenteCreazione = table.Column(type: "uniqueidentifier", nullable: true),
IdUtenteModifica = table.Column(type: "uniqueidentifier", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_InvitoEvento", x => x.Id);
table.ForeignKey(
name: "FK_InvitoEvento_Cliente_ClienteId",
column: x => x.ClienteId,
principalTable: "Cliente",
principalColumn: "Id");
table.ForeignKey(
name: "FK_InvitoEvento_Evento_EventoId",
column: x => x.EventoId,
principalTable: "Evento",
principalColumn: "Id");
table.ForeignKey(
name: "FK_InvitoEvento_Utente_IdUtenteCreazione",
column: x => x.IdUtenteCreazione,
principalTable: "Utente",
principalColumn: "Id");
table.ForeignKey(
name: "FK_InvitoEvento_Utente_IdUtenteModifica",
column: x => x.IdUtenteModifica,
principalTable: "Utente",
principalColumn: "Id");
});
migrationBuilder.CreateIndex(
name: "IX_IscrizioneEvento_InvitoEventoId",
table: "IscrizioneEvento",
column: "InvitoEventoId");
migrationBuilder.CreateIndex(
name: "IX_InvitoEvento_ClienteId",
table: "InvitoEvento",
column: "ClienteId");
migrationBuilder.CreateIndex(
name: "IX_InvitoEvento_EventoId",
table: "InvitoEvento",
column: "EventoId");
migrationBuilder.CreateIndex(
name: "IX_InvitoEvento_IdUtenteCreazione",
table: "InvitoEvento",
column: "IdUtenteCreazione");
migrationBuilder.CreateIndex(
name: "IX_InvitoEvento_IdUtenteModifica",
table: "InvitoEvento",
column: "IdUtenteModifica");
migrationBuilder.AddForeignKey(
name: "FK_IscrizioneEvento_InvitoEvento_InvitoEventoId",
table: "IscrizioneEvento",
column: "InvitoEventoId",
principalTable: "InvitoEvento",
principalColumn: "Id");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_IscrizioneEvento_InvitoEvento_InvitoEventoId",
table: "IscrizioneEvento");
migrationBuilder.DropTable(
name: "InvitoEvento");
migrationBuilder.DropIndex(
name: "IX_IscrizioneEvento_InvitoEventoId",
table: "IscrizioneEvento");
migrationBuilder.DropColumn(
name: "InvitoEventoId",
table: "IscrizioneEvento");
}
}
}