InventoryAgent/Inventory.Core/Migrations/20251019065246_AddHealthMetrics.cs

100 lines
2.8 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Inventory.Core.Migrations
{
/// <inheritdoc />
public partial class AddHealthMetrics : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "Storage",
table: "Devices",
newName: "StorageDevices");
migrationBuilder.AddColumn<double>(
name: "BatteryHealthPercent",
table: "Devices",
type: "float",
nullable: true);
migrationBuilder.AddColumn<double>(
name: "CpuTemperature",
table: "Devices",
type: "float",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "DriveHealth",
table: "Devices",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<double>(
name: "GpuTemperature",
table: "Devices",
type: "float",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "LocalAdmins",
table: "Devices",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "OsInstallDate",
table: "Devices",
type: "datetime2",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Printers",
table: "Devices",
type: "nvarchar(max)",
nullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "BatteryHealthPercent",
table: "Devices");
migrationBuilder.DropColumn(
name: "CpuTemperature",
table: "Devices");
migrationBuilder.DropColumn(
name: "DriveHealth",
table: "Devices");
migrationBuilder.DropColumn(
name: "GpuTemperature",
table: "Devices");
migrationBuilder.DropColumn(
name: "LocalAdmins",
table: "Devices");
migrationBuilder.DropColumn(
name: "OsInstallDate",
table: "Devices");
migrationBuilder.DropColumn(
name: "Printers",
table: "Devices");
migrationBuilder.RenameColumn(
name: "StorageDevices",
table: "Devices",
newName: "Storage");
}
}
}