using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Inventory.Core.Migrations
{
///
public partial class InitialCreate : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Devices",
columns: table => new
{
Id = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
HardwareIdentifier = table.Column(type: "nvarchar(450)", nullable: true),
ComputerName = table.Column(type: "nvarchar(max)", nullable: true),
DeviceType = table.Column(type: "nvarchar(max)", nullable: true),
SerialNumber = table.Column(type: "nvarchar(max)", nullable: true),
MotherboardSerialNumber = table.Column(type: "nvarchar(max)", nullable: true),
SystemUUID = table.Column(type: "nvarchar(max)", nullable: true),
Processor = table.Column(type: "nvarchar(max)", nullable: true),
RAM = table.Column(type: "nvarchar(max)", nullable: true),
GPUs = table.Column(type: "nvarchar(max)", nullable: true),
Storage = table.Column(type: "nvarchar(max)", nullable: true),
HasOpticalDrive = table.Column(type: "bit", nullable: false),
Monitors = table.Column(type: "nvarchar(max)", nullable: true),
OSVersion = table.Column(type: "nvarchar(max)", nullable: true),
OSLicenseKey = table.Column(type: "nvarchar(max)", nullable: true),
IPAddress = table.Column(type: "nvarchar(max)", nullable: true),
MACAddress = table.Column(type: "nvarchar(max)", nullable: true),
PreviousIPAddress = table.Column(type: "nvarchar(max)", nullable: true),
LastSeen = table.Column(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Devices", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_Devices_HardwareIdentifier",
table: "Devices",
column: "HardwareIdentifier",
unique: true,
filter: "[HardwareIdentifier] IS NOT NULL");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Devices");
}
}
}