657 lines
22 KiB
C#
657 lines
22 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using AmtScanner.Api.Data;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
|
|
#nullable disable
|
|
|
|
namespace AmtScanner.Api.Migrations
|
|
{
|
|
[DbContext(typeof(AppDbContext))]
|
|
[Migration("20260120122638_AddDeviceWindowsCredentials")]
|
|
partial class AddDeviceWindowsCredentials
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "8.0.0")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
|
|
|
modelBuilder.Entity("AmtScanner.Api.Models.AmtCredential", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("Description")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<bool>("IsDefault")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(200)
|
|
.HasColumnType("varchar(200)");
|
|
|
|
b.Property<string>("Password")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("Username")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("Name");
|
|
|
|
b.ToTable("AmtCredentials");
|
|
});
|
|
|
|
modelBuilder.Entity("AmtScanner.Api.Models.AmtDevice", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<bool>("AmtOnline")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<string>("Description")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<DateTime>("DiscoveredAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("Hostname")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("IpAddress")
|
|
.IsRequired()
|
|
.HasMaxLength(50)
|
|
.HasColumnType("varchar(50)");
|
|
|
|
b.Property<DateTime>("LastSeenAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<int>("MajorVersion")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("MinorVersion")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<bool>("OsOnline")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<int>("ProvisioningState")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("WindowsPassword")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("WindowsUsername")
|
|
.HasColumnType("longtext");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("IpAddress")
|
|
.IsUnique();
|
|
|
|
b.ToTable("AmtDevices");
|
|
});
|
|
|
|
modelBuilder.Entity("AmtScanner.Api.Models.HardwareInfo", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<long>("DeviceId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<DateTime>("LastUpdated")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<int?>("ProcessorCores")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int?>("ProcessorCurrentClockSpeed")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int?>("ProcessorMaxClockSpeed")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("ProcessorModel")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<int?>("ProcessorThreads")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("SystemManufacturer")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("SystemModel")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("SystemSerialNumber")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<long?>("TotalMemoryBytes")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("DeviceId");
|
|
|
|
b.HasIndex("LastUpdated");
|
|
|
|
b.ToTable("HardwareInfos");
|
|
});
|
|
|
|
modelBuilder.Entity("AmtScanner.Api.Models.MemoryModule", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<long?>("CapacityBytes")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<long>("HardwareInfoId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<string>("Manufacturer")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("MemoryType")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("PartNumber")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("SerialNumber")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("SlotLocation")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<int?>("SpeedMHz")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("HardwareInfoId");
|
|
|
|
b.ToTable("MemoryModules");
|
|
});
|
|
|
|
modelBuilder.Entity("AmtScanner.Api.Models.Menu", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("AuthList")
|
|
.HasMaxLength(1000)
|
|
.HasColumnType("varchar(1000)");
|
|
|
|
b.Property<string>("Component")
|
|
.HasMaxLength(200)
|
|
.HasColumnType("varchar(200)");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("Icon")
|
|
.HasMaxLength(100)
|
|
.HasColumnType("varchar(100)");
|
|
|
|
b.Property<bool>("IsHide")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<bool>("IsHideTab")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<bool>("IsIframe")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<bool>("IsSystem")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<bool>("KeepAlive")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<string>("Link")
|
|
.HasMaxLength(500)
|
|
.HasColumnType("varchar(500)");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("varchar(100)");
|
|
|
|
b.Property<int?>("ParentId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Path")
|
|
.IsRequired()
|
|
.HasMaxLength(200)
|
|
.HasColumnType("varchar(200)");
|
|
|
|
b.Property<string>("Roles")
|
|
.HasMaxLength(500)
|
|
.HasColumnType("varchar(500)");
|
|
|
|
b.Property<int>("Sort")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Title")
|
|
.HasMaxLength(200)
|
|
.HasColumnType("varchar(200)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("Name");
|
|
|
|
b.HasIndex("ParentId");
|
|
|
|
b.ToTable("Menus");
|
|
});
|
|
|
|
modelBuilder.Entity("AmtScanner.Api.Models.RemoteAccessToken", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<long>("DeviceId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<DateTime>("ExpiresAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<bool>("IsUsed")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<int>("MaxUseCount")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Note")
|
|
.HasMaxLength(500)
|
|
.HasColumnType("varchar(500)");
|
|
|
|
b.Property<string>("Token")
|
|
.IsRequired()
|
|
.HasMaxLength(64)
|
|
.HasColumnType("varchar(64)");
|
|
|
|
b.Property<int>("UseCount")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("UsedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("DeviceId");
|
|
|
|
b.HasIndex("Token")
|
|
.IsUnique();
|
|
|
|
b.ToTable("RemoteAccessTokens");
|
|
});
|
|
|
|
modelBuilder.Entity("AmtScanner.Api.Models.Role", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("Description")
|
|
.HasMaxLength(500)
|
|
.HasColumnType("varchar(500)");
|
|
|
|
b.Property<bool>("Enabled")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<string>("RoleCode")
|
|
.IsRequired()
|
|
.HasMaxLength(50)
|
|
.HasColumnType("varchar(50)");
|
|
|
|
b.Property<string>("RoleName")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("varchar(100)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("RoleCode")
|
|
.IsUnique();
|
|
|
|
b.ToTable("Roles");
|
|
});
|
|
|
|
modelBuilder.Entity("AmtScanner.Api.Models.RoleMenu", b =>
|
|
{
|
|
b.Property<int>("RoleId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("MenuId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("RoleId", "MenuId");
|
|
|
|
b.HasIndex("MenuId");
|
|
|
|
b.ToTable("RoleMenus");
|
|
});
|
|
|
|
modelBuilder.Entity("AmtScanner.Api.Models.StorageDevice", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<long?>("CapacityBytes")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<string>("DeviceId")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<long>("HardwareInfoId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<string>("InterfaceType")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("Model")
|
|
.HasColumnType("longtext");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("HardwareInfoId");
|
|
|
|
b.ToTable("StorageDevices");
|
|
});
|
|
|
|
modelBuilder.Entity("AmtScanner.Api.Models.User", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Avatar")
|
|
.HasMaxLength(500)
|
|
.HasColumnType("varchar(500)");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasMaxLength(100)
|
|
.HasColumnType("varchar(100)");
|
|
|
|
b.Property<string>("Email")
|
|
.HasMaxLength(200)
|
|
.HasColumnType("varchar(200)");
|
|
|
|
b.Property<string>("Gender")
|
|
.IsRequired()
|
|
.HasMaxLength(1)
|
|
.HasColumnType("varchar(1)");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<string>("NickName")
|
|
.HasMaxLength(100)
|
|
.HasColumnType("varchar(100)");
|
|
|
|
b.Property<string>("PasswordHash")
|
|
.IsRequired()
|
|
.HasMaxLength(200)
|
|
.HasColumnType("varchar(200)");
|
|
|
|
b.Property<string>("Phone")
|
|
.HasMaxLength(20)
|
|
.HasColumnType("varchar(20)");
|
|
|
|
b.Property<string>("RefreshToken")
|
|
.HasMaxLength(500)
|
|
.HasColumnType("varchar(500)");
|
|
|
|
b.Property<DateTime?>("RefreshTokenExpiryTime")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("Status")
|
|
.IsRequired()
|
|
.HasMaxLength(1)
|
|
.HasColumnType("varchar(1)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasMaxLength(100)
|
|
.HasColumnType("varchar(100)");
|
|
|
|
b.Property<string>("UserName")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("varchar(100)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("UserName")
|
|
.IsUnique();
|
|
|
|
b.ToTable("Users");
|
|
});
|
|
|
|
modelBuilder.Entity("AmtScanner.Api.Models.UserRole", b =>
|
|
{
|
|
b.Property<int>("UserId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("RoleId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("UserId", "RoleId");
|
|
|
|
b.HasIndex("RoleId");
|
|
|
|
b.ToTable("UserRoles");
|
|
});
|
|
|
|
modelBuilder.Entity("AmtScanner.Api.Models.WindowsCredential", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("Domain")
|
|
.HasMaxLength(200)
|
|
.HasColumnType("varchar(200)");
|
|
|
|
b.Property<bool>("IsDefault")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(200)
|
|
.HasColumnType("varchar(200)");
|
|
|
|
b.Property<string>("Note")
|
|
.HasMaxLength(500)
|
|
.HasColumnType("varchar(500)");
|
|
|
|
b.Property<string>("Password")
|
|
.IsRequired()
|
|
.HasMaxLength(500)
|
|
.HasColumnType("varchar(500)");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("Username")
|
|
.IsRequired()
|
|
.HasMaxLength(200)
|
|
.HasColumnType("varchar(200)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("Name");
|
|
|
|
b.ToTable("WindowsCredentials");
|
|
});
|
|
|
|
modelBuilder.Entity("AmtScanner.Api.Models.HardwareInfo", b =>
|
|
{
|
|
b.HasOne("AmtScanner.Api.Models.AmtDevice", "Device")
|
|
.WithMany()
|
|
.HasForeignKey("DeviceId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Device");
|
|
});
|
|
|
|
modelBuilder.Entity("AmtScanner.Api.Models.MemoryModule", b =>
|
|
{
|
|
b.HasOne("AmtScanner.Api.Models.HardwareInfo", "HardwareInfo")
|
|
.WithMany("MemoryModules")
|
|
.HasForeignKey("HardwareInfoId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("HardwareInfo");
|
|
});
|
|
|
|
modelBuilder.Entity("AmtScanner.Api.Models.Menu", b =>
|
|
{
|
|
b.HasOne("AmtScanner.Api.Models.Menu", "Parent")
|
|
.WithMany("Children")
|
|
.HasForeignKey("ParentId")
|
|
.OnDelete(DeleteBehavior.Restrict);
|
|
|
|
b.Navigation("Parent");
|
|
});
|
|
|
|
modelBuilder.Entity("AmtScanner.Api.Models.RemoteAccessToken", b =>
|
|
{
|
|
b.HasOne("AmtScanner.Api.Models.AmtDevice", "Device")
|
|
.WithMany()
|
|
.HasForeignKey("DeviceId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Device");
|
|
});
|
|
|
|
modelBuilder.Entity("AmtScanner.Api.Models.RoleMenu", b =>
|
|
{
|
|
b.HasOne("AmtScanner.Api.Models.Menu", "Menu")
|
|
.WithMany("RoleMenus")
|
|
.HasForeignKey("MenuId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("AmtScanner.Api.Models.Role", "Role")
|
|
.WithMany("RoleMenus")
|
|
.HasForeignKey("RoleId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Menu");
|
|
|
|
b.Navigation("Role");
|
|
});
|
|
|
|
modelBuilder.Entity("AmtScanner.Api.Models.StorageDevice", b =>
|
|
{
|
|
b.HasOne("AmtScanner.Api.Models.HardwareInfo", "HardwareInfo")
|
|
.WithMany("StorageDevices")
|
|
.HasForeignKey("HardwareInfoId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("HardwareInfo");
|
|
});
|
|
|
|
modelBuilder.Entity("AmtScanner.Api.Models.UserRole", b =>
|
|
{
|
|
b.HasOne("AmtScanner.Api.Models.Role", "Role")
|
|
.WithMany("UserRoles")
|
|
.HasForeignKey("RoleId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("AmtScanner.Api.Models.User", "User")
|
|
.WithMany("UserRoles")
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Role");
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("AmtScanner.Api.Models.HardwareInfo", b =>
|
|
{
|
|
b.Navigation("MemoryModules");
|
|
|
|
b.Navigation("StorageDevices");
|
|
});
|
|
|
|
modelBuilder.Entity("AmtScanner.Api.Models.Menu", b =>
|
|
{
|
|
b.Navigation("Children");
|
|
|
|
b.Navigation("RoleMenus");
|
|
});
|
|
|
|
modelBuilder.Entity("AmtScanner.Api.Models.Role", b =>
|
|
{
|
|
b.Navigation("RoleMenus");
|
|
|
|
b.Navigation("UserRoles");
|
|
});
|
|
|
|
modelBuilder.Entity("AmtScanner.Api.Models.User", b =>
|
|
{
|
|
b.Navigation("UserRoles");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|