60 lines
1.8 KiB
C#
60 lines
1.8 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace StandManager.Infrastructure.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class GuidComune : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropColumn(
|
|
name: "Comune",
|
|
table: "IscrizioneEvento");
|
|
|
|
migrationBuilder.AddColumn<Guid>(
|
|
name: "ComuneId",
|
|
table: "IscrizioneEvento",
|
|
type: "uniqueidentifier",
|
|
nullable: true);
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_IscrizioneEvento_ComuneId",
|
|
table: "IscrizioneEvento",
|
|
column: "ComuneId");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_IscrizioneEvento_ComuneIstat_ComuneId",
|
|
table: "IscrizioneEvento",
|
|
column: "ComuneId",
|
|
principalTable: "ComuneIstat",
|
|
principalColumn: "Id");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_IscrizioneEvento_ComuneIstat_ComuneId",
|
|
table: "IscrizioneEvento");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_IscrizioneEvento_ComuneId",
|
|
table: "IscrizioneEvento");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "ComuneId",
|
|
table: "IscrizioneEvento");
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "Comune",
|
|
table: "IscrizioneEvento",
|
|
type: "nvarchar(max)",
|
|
nullable: true);
|
|
}
|
|
}
|
|
}
|