//
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("20260122052853_AddAmtNewTables")]
partial class AddAmtNewTables
{
///
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.AmtDevice_new", b =>
{
b.Property("Uuid")
.HasMaxLength(36)
.HasColumnType("varchar(36)");
b.Property("AmtPassword")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.Property("AmtUsername")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)");
b.Property("AmtVersion")
.HasMaxLength(20)
.HasColumnType("varchar(20)");
b.Property("CreatedAt")
.HasColumnType("datetime(6)");
b.Property("Gateway")
.HasMaxLength(45)
.HasColumnType("varchar(45)");
b.Property("Hostname")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property("IpAddress")
.IsRequired()
.HasMaxLength(45)
.HasColumnType("varchar(45)");
b.Property("SubnetMask")
.HasMaxLength(45)
.HasColumnType("varchar(45)");
b.Property("UpdatedAt")
.HasColumnType("datetime(6)");
b.HasKey("Uuid");
b.HasIndex("IpAddress");
b.ToTable("AmtDevices_new");
});
modelBuilder.Entity("AmtScanner.Api.Models.AmtPendingDevice_new", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property("AmtPassword")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.Property("AmtUsername")
.HasMaxLength(64)
.HasColumnType("varchar(64)");
b.Property("AmtVersion")
.HasMaxLength(20)
.HasColumnType("varchar(20)");
b.Property("CreatedAt")
.HasColumnType("datetime(6)");
b.Property("Gateway")
.HasMaxLength(45)
.HasColumnType("varchar(45)");
b.Property("IpAddress")
.IsRequired()
.HasMaxLength(45)
.HasColumnType("varchar(45)");
b.Property("IsTakenOver")
.HasColumnType("tinyint(1)");
b.Property("ProvisioningState")
.HasMaxLength(20)
.HasColumnType("varchar(20)");
b.Property("Source")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("varchar(20)");
b.Property("SubnetMask")
.HasMaxLength(45)
.HasColumnType("varchar(45)");
b.Property("UpdatedAt")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.HasIndex("IpAddress")
.IsUnique();
b.ToTable("AmtPendingDevices_new");
});
modelBuilder.Entity("AmtScanner.Api.Models.Menu", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property("AuthList")
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property("Component")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property("CreatedAt")
.HasColumnType("datetime(6)");
b.Property("Icon")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property("IsHide")
.HasColumnType("tinyint(1)");
b.Property("IsHideTab")
.HasColumnType("tinyint(1)");
b.Property("IsIframe")
.HasColumnType("tinyint(1)");
b.Property("IsSystem")
.HasColumnType("tinyint(1)");
b.Property("KeepAlive")
.HasColumnType("tinyint(1)");
b.Property("Link")
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.Property("Name")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property("ParentId")
.HasColumnType("int");
b.Property("Path")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property("Roles")
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.Property("Sort")
.HasColumnType("int");
b.Property("Title")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.HasIndex("Name");
b.HasIndex("ParentId");
b.ToTable("Menus");
});
modelBuilder.Entity("AmtScanner.Api.Models.Role", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property("CreatedAt")
.HasColumnType("datetime(6)");
b.Property("Description")
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.Property("Enabled")
.HasColumnType("tinyint(1)");
b.Property("RoleCode")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("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("RoleId")
.HasColumnType("int");
b.Property("MenuId")
.HasColumnType("int");
b.HasKey("RoleId", "MenuId");
b.HasIndex("MenuId");
b.ToTable("RoleMenus");
});
modelBuilder.Entity("AmtScanner.Api.Models.User", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property("Avatar")
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.Property("CreatedAt")
.HasColumnType("datetime(6)");
b.Property("CreatedBy")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property("Email")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property("Gender")
.IsRequired()
.HasMaxLength(1)
.HasColumnType("varchar(1)");
b.Property("IsDeleted")
.HasColumnType("tinyint(1)");
b.Property("NickName")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property("PasswordHash")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property("Phone")
.HasMaxLength(20)
.HasColumnType("varchar(20)");
b.Property("RefreshToken")
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.Property("RefreshTokenExpiryTime")
.HasColumnType("datetime(6)");
b.Property("Status")
.IsRequired()
.HasMaxLength(1)
.HasColumnType("varchar(1)");
b.Property("UpdatedAt")
.HasColumnType("datetime(6)");
b.Property("UpdatedBy")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property("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("UserId")
.HasColumnType("int");
b.Property("RoleId")
.HasColumnType("int");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("UserRoles");
});
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.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.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.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
}
}
}