using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace RobotNet.RobotManager.Data.Migrations
{
///
public partial class fixRobotDb : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Robots_RobotModels_MapId",
table: "Robots");
migrationBuilder.DropIndex(
name: "IX_Robots_MapId",
table: "Robots");
migrationBuilder.CreateIndex(
name: "IX_Robots_ModelId",
table: "Robots",
column: "ModelId");
migrationBuilder.AddForeignKey(
name: "FK_Robots_RobotModels_ModelId",
table: "Robots",
column: "ModelId",
principalTable: "RobotModels",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Robots_RobotModels_ModelId",
table: "Robots");
migrationBuilder.DropIndex(
name: "IX_Robots_ModelId",
table: "Robots");
migrationBuilder.CreateIndex(
name: "IX_Robots_MapId",
table: "Robots",
column: "MapId");
migrationBuilder.AddForeignKey(
name: "FK_Robots_RobotModels_MapId",
table: "Robots",
column: "MapId",
principalTable: "RobotModels",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
}
}