80 lines
2.3 KiB
C#
80 lines
2.3 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace StandManager.Infrastructure.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class Capoarea : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AddColumn<Guid>(
|
|
name: "CapoareaId",
|
|
table: "Utente",
|
|
type: "uniqueidentifier",
|
|
nullable: true);
|
|
|
|
migrationBuilder.AddColumn<Guid>(
|
|
name: "CapoareaId",
|
|
table: "Cliente",
|
|
type: "uniqueidentifier",
|
|
nullable: true);
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Utente_CapoareaId",
|
|
table: "Utente",
|
|
column: "CapoareaId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Cliente_CapoareaId",
|
|
table: "Cliente",
|
|
column: "CapoareaId");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Cliente_Utente_CapoareaId",
|
|
table: "Cliente",
|
|
column: "CapoareaId",
|
|
principalTable: "Utente",
|
|
principalColumn: "Id");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Utente_Utente_CapoareaId",
|
|
table: "Utente",
|
|
column: "CapoareaId",
|
|
principalTable: "Utente",
|
|
principalColumn: "Id");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Cliente_Utente_CapoareaId",
|
|
table: "Cliente");
|
|
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Utente_Utente_CapoareaId",
|
|
table: "Utente");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_Utente_CapoareaId",
|
|
table: "Utente");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_Cliente_CapoareaId",
|
|
table: "Cliente");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "CapoareaId",
|
|
table: "Utente");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "CapoareaId",
|
|
table: "Cliente");
|
|
}
|
|
}
|
|
}
|