61 lines
1.9 KiB
C#
61 lines
1.9 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace TemperatureLoggerAPI.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class updatedeviceinfoadddeviceid : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_TempLogs_DeviceInfo_deviceId",
|
|
table: "TempLogs");
|
|
|
|
migrationBuilder.RenameColumn(
|
|
name: "deviceId",
|
|
table: "TempLogs",
|
|
newName: "deviceID");
|
|
|
|
migrationBuilder.RenameIndex(
|
|
name: "IX_TempLogs_deviceId",
|
|
table: "TempLogs",
|
|
newName: "IX_TempLogs_deviceID");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_TempLogs_DeviceInfo_deviceID",
|
|
table: "TempLogs",
|
|
column: "deviceID",
|
|
principalTable: "DeviceInfo",
|
|
principalColumn: "Id");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_TempLogs_DeviceInfo_deviceID",
|
|
table: "TempLogs");
|
|
|
|
migrationBuilder.RenameColumn(
|
|
name: "deviceID",
|
|
table: "TempLogs",
|
|
newName: "deviceId");
|
|
|
|
migrationBuilder.RenameIndex(
|
|
name: "IX_TempLogs_deviceID",
|
|
table: "TempLogs",
|
|
newName: "IX_TempLogs_deviceId");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_TempLogs_DeviceInfo_deviceId",
|
|
table: "TempLogs",
|
|
column: "deviceId",
|
|
principalTable: "DeviceInfo",
|
|
principalColumn: "Id");
|
|
}
|
|
}
|
|
}
|