using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace StandManager.Infrastructure.Migrations
{
    /// <inheritdoc />
    public partial class DateIscrizioneEvento : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_Destinazione_Cliente_Clienteid",
                table: "Destinazione");

            migrationBuilder.RenameColumn(
                name: "Clienteid",
                table: "Destinazione",
                newName: "ClienteId");

            migrationBuilder.RenameIndex(
                name: "IX_Destinazione_Clienteid",
                table: "Destinazione",
                newName: "IX_Destinazione_ClienteId");

            migrationBuilder.AddColumn<DateTime>(
                name: "IscrizioneA",
                table: "Evento",
                type: "datetime2",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder.AddColumn<DateTime>(
                name: "IscrizioneDa",
                table: "Evento",
                type: "datetime2",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder.AddForeignKey(
                name: "FK_Destinazione_Cliente_ClienteId",
                table: "Destinazione",
                column: "ClienteId",
                principalTable: "Cliente",
                principalColumn: "Id");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_Destinazione_Cliente_ClienteId",
                table: "Destinazione");

            migrationBuilder.DropColumn(
                name: "IscrizioneA",
                table: "Evento");

            migrationBuilder.DropColumn(
                name: "IscrizioneDa",
                table: "Evento");

            migrationBuilder.RenameColumn(
                name: "ClienteId",
                table: "Destinazione",
                newName: "Clienteid");

            migrationBuilder.RenameIndex(
                name: "IX_Destinazione_ClienteId",
                table: "Destinazione",
                newName: "IX_Destinazione_Clienteid");

            migrationBuilder.AddForeignKey(
                name: "FK_Destinazione_Cliente_Clienteid",
                table: "Destinazione",
                column: "Clienteid",
                principalTable: "Cliente",
                principalColumn: "Id");
        }
    }
}
