RobotNet/RobotNet.RobotManager/Data/Migrations/20250509071716_fixRobotDb.cs
2025-10-15 15:15:53 +07:00

61 lines
1.8 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace RobotNet.RobotManager.Data.Migrations
{
/// <inheritdoc />
public partial class fixRobotDb : Migration
{
/// <inheritdoc />
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);
}
/// <inheritdoc />
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);
}
}
}