111 lines
4.4 KiB
C#
111 lines
4.4 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace StandManager.Infrastructure.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class InvitoEvento : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AddColumn<Guid>(
|
|
name: "InvitoEventoId",
|
|
table: "IscrizioneEvento",
|
|
type: "uniqueidentifier",
|
|
nullable: true);
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "InvitoEvento",
|
|
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),
|
|
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_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");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
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");
|
|
}
|
|
}
|
|
}
|