50 lines
1.5 KiB
C#
50 lines
1.5 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace ManagerService.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class UpdateConfigurationLinkInDevice : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropColumn(
|
|
name: "Configuration",
|
|
table: "Devices");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Devices_ConfigurationId",
|
|
table: "Devices",
|
|
column: "ConfigurationId");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Devices_Configurations_ConfigurationId",
|
|
table: "Devices",
|
|
column: "ConfigurationId",
|
|
principalTable: "Configurations",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Devices_Configurations_ConfigurationId",
|
|
table: "Devices");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_Devices_ConfigurationId",
|
|
table: "Devices");
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "Configuration",
|
|
table: "Devices",
|
|
type: "text",
|
|
nullable: true);
|
|
}
|
|
}
|
|
}
|