//
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Remotely.Server.Data;
namespace Remotely.Server.Migrations.SqlServer
{
[DbContext(typeof(SqlServerDbContext))]
partial class SqlServerDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.UseIdentityColumns()
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("ProductVersion", "5.0.0");
modelBuilder.Entity("DeviceGroupRemotelyUser", b =>
{
b.Property("DeviceGroupsID")
.HasColumnType("nvarchar(450)");
b.Property("UsersId")
.HasColumnType("nvarchar(450)");
b.HasKey("DeviceGroupsID", "UsersId");
b.HasIndex("UsersId");
b.ToTable("DeviceGroupRemotelyUser");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property("Id")
.HasColumnType("nvarchar(450)");
b.Property("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("nvarchar(max)");
b.Property("Name")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property("NormalizedName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasDatabaseName("RoleNameIndex")
.HasFilter("[NormalizedName] IS NOT NULL");
b.ToTable("AspNetRoles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.UseIdentityColumn();
b.Property("ClaimType")
.HasColumnType("nvarchar(max)");
b.Property("ClaimValue")
.HasColumnType("nvarchar(max)");
b.Property("RoleId")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
{
b.Property("Id")
.HasColumnType("nvarchar(450)");
b.Property("AccessFailedCount")
.HasColumnType("int");
b.Property("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("nvarchar(max)");
b.Property("Discriminator")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("Email")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property("EmailConfirmed")
.HasColumnType("bit");
b.Property("LockoutEnabled")
.HasColumnType("bit");
b.Property("LockoutEnd")
.HasColumnType("datetimeoffset");
b.Property("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property("PasswordHash")
.HasColumnType("nvarchar(max)");
b.Property("PhoneNumber")
.HasColumnType("nvarchar(max)");
b.Property("PhoneNumberConfirmed")
.HasColumnType("bit");
b.Property("SecurityStamp")
.HasColumnType("nvarchar(max)");
b.Property("TwoFactorEnabled")
.HasColumnType("bit");
b.Property("UserName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex")
.HasFilter("[NormalizedUserName] IS NOT NULL");
b.ToTable("RemotelyUsers");
b.HasDiscriminator("Discriminator").HasValue("IdentityUser");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.UseIdentityColumn();
b.Property("ClaimType")
.HasColumnType("nvarchar(max)");
b.Property("ClaimValue")
.HasColumnType("nvarchar(max)");
b.Property("UserId")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
{
b.Property("LoginProvider")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property("ProviderKey")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property("ProviderDisplayName")
.HasColumnType("nvarchar(max)");
b.Property("UserId")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
{
b.Property("UserId")
.HasColumnType("nvarchar(450)");
b.Property("RoleId")
.HasColumnType("nvarchar(450)");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
{
b.Property("UserId")
.HasColumnType("nvarchar(450)");
b.Property("LoginProvider")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property("Name")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property("Value")
.HasColumnType("nvarchar(max)");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens");
});
modelBuilder.Entity("Remotely.Shared.Models.Alert", b =>
{
b.Property("ID")
.HasColumnType("nvarchar(450)");
b.Property("CreatedOn")
.HasColumnType("datetimeoffset");
b.Property("DeviceID")
.HasColumnType("nvarchar(450)");
b.Property("Message")
.HasColumnType("nvarchar(max)");
b.Property("OrganizationID")
.HasColumnType("nvarchar(450)");
b.Property("UserID")
.HasColumnType("nvarchar(450)");
b.HasKey("ID");
b.HasIndex("DeviceID");
b.HasIndex("OrganizationID");
b.HasIndex("UserID");
b.ToTable("Alerts");
});
modelBuilder.Entity("Remotely.Shared.Models.ApiToken", b =>
{
b.Property("ID")
.HasColumnType("nvarchar(450)");
b.Property("LastUsed")
.HasColumnType("datetimeoffset");
b.Property("Name")
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property("OrganizationID")
.HasColumnType("nvarchar(450)");
b.Property("Secret")
.HasColumnType("nvarchar(max)");
b.Property("Token")
.HasColumnType("nvarchar(450)");
b.HasKey("ID");
b.HasIndex("OrganizationID");
b.HasIndex("Token");
b.ToTable("ApiTokens");
});
modelBuilder.Entity("Remotely.Shared.Models.CommandResult", b =>
{
b.Property("ID")
.HasColumnType("nvarchar(450)");
b.Property("CommandMode")
.HasColumnType("nvarchar(max)");
b.Property("CommandResults")
.HasColumnType("nvarchar(max)");
b.Property("CommandText")
.HasColumnType("nvarchar(max)");
b.Property("OrganizationID")
.HasColumnType("nvarchar(450)");
b.Property("PSCoreResults")
.HasColumnType("nvarchar(max)");
b.Property("SenderConnectionID")
.HasColumnType("nvarchar(max)");
b.Property("SenderUserID")
.HasColumnType("nvarchar(max)");
b.Property("TargetDeviceIDs")
.HasColumnType("nvarchar(max)");
b.Property("TimeStamp")
.HasColumnType("datetimeoffset");
b.HasKey("ID");
b.HasIndex("OrganizationID");
b.ToTable("CommandResults");
});
modelBuilder.Entity("Remotely.Shared.Models.Device", b =>
{
b.Property("ID")
.HasColumnType("nvarchar(450)");
b.Property("AgentVersion")
.HasColumnType("nvarchar(max)");
b.Property("Alias")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property("CpuUtilization")
.HasColumnType("float");
b.Property("CurrentUser")
.HasColumnType("nvarchar(max)");
b.Property("DeviceGroupID")
.HasColumnType("nvarchar(450)");
b.Property("DeviceName")
.HasColumnType("nvarchar(450)");
b.Property("Drives")
.HasColumnType("nvarchar(max)");
b.Property("Is64Bit")
.HasColumnType("bit");
b.Property("IsOnline")
.HasColumnType("bit");
b.Property("LastOnline")
.HasColumnType("datetimeoffset");
b.Property("Notes")
.HasColumnType("nvarchar(max)");
b.Property("OSArchitecture")
.HasColumnType("int");
b.Property("OSDescription")
.HasColumnType("nvarchar(max)");
b.Property("OrganizationID")
.HasColumnType("nvarchar(450)");
b.Property("Platform")
.HasColumnType("nvarchar(max)");
b.Property("ProcessorCount")
.HasColumnType("int");
b.Property("PublicIP")
.HasColumnType("nvarchar(max)");
b.Property("ServerVerificationToken")
.HasColumnType("nvarchar(max)");
b.Property("Tags")
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property("TotalMemory")
.HasColumnType("float");
b.Property("TotalStorage")
.HasColumnType("float");
b.Property("UsedMemory")
.HasColumnType("float");
b.Property("UsedStorage")
.HasColumnType("float");
b.HasKey("ID");
b.HasIndex("DeviceGroupID");
b.HasIndex("DeviceName");
b.HasIndex("OrganizationID");
b.ToTable("Devices");
});
modelBuilder.Entity("Remotely.Shared.Models.DeviceGroup", b =>
{
b.Property("ID")
.HasColumnType("nvarchar(450)");
b.Property("Name")
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property("OrganizationID")
.HasColumnType("nvarchar(450)");
b.HasKey("ID");
b.HasIndex("OrganizationID");
b.ToTable("DeviceGroups");
});
modelBuilder.Entity("Remotely.Shared.Models.EventLog", b =>
{
b.Property("ID")
.HasColumnType("nvarchar(450)");
b.Property("EventType")
.HasColumnType("int");
b.Property("Message")
.HasColumnType("nvarchar(max)");
b.Property("OrganizationID")
.HasColumnType("nvarchar(450)");
b.Property("Source")
.HasColumnType("nvarchar(max)");
b.Property("StackTrace")
.HasColumnType("nvarchar(max)");
b.Property("TimeStamp")
.HasColumnType("datetimeoffset");
b.HasKey("ID");
b.HasIndex("OrganizationID");
b.ToTable("EventLogs");
});
modelBuilder.Entity("Remotely.Shared.Models.InviteLink", b =>
{
b.Property("ID")
.HasColumnType("nvarchar(450)");
b.Property("DateSent")
.HasColumnType("datetimeoffset");
b.Property("InvitedUser")
.HasColumnType("nvarchar(max)");
b.Property("IsAdmin")
.HasColumnType("bit");
b.Property("OrganizationID")
.HasColumnType("nvarchar(450)");
b.Property("ResetUrl")
.HasColumnType("nvarchar(max)");
b.HasKey("ID");
b.HasIndex("OrganizationID");
b.ToTable("InviteLinks");
});
modelBuilder.Entity("Remotely.Shared.Models.Organization", b =>
{
b.Property("ID")
.HasColumnType("nvarchar(450)");
b.Property("OrganizationName")
.HasMaxLength(25)
.HasColumnType("nvarchar(25)");
b.HasKey("ID");
b.ToTable("Organizations");
});
modelBuilder.Entity("Remotely.Shared.Models.SharedFile", b =>
{
b.Property("ID")
.HasColumnType("nvarchar(450)");
b.Property("ContentType")
.HasColumnType("nvarchar(max)");
b.Property("FileContents")
.HasColumnType("varbinary(max)");
b.Property("FileName")
.HasColumnType("nvarchar(max)");
b.Property("OrganizationID")
.HasColumnType("nvarchar(450)");
b.Property("Timestamp")
.HasColumnType("datetimeoffset");
b.HasKey("ID");
b.HasIndex("OrganizationID");
b.ToTable("SharedFiles");
});
modelBuilder.Entity("Remotely.Shared.Models.RemotelyUser", b =>
{
b.HasBaseType("Microsoft.AspNetCore.Identity.IdentityUser");
b.Property("DisplayName")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property("IsAdministrator")
.HasColumnType("bit");
b.Property("IsServerAdmin")
.HasColumnType("bit");
b.Property("OrganizationID")
.HasColumnType("nvarchar(450)");
b.Property("TempPassword")
.HasColumnType("nvarchar(max)");
b.Property("UserOptions")
.HasColumnType("nvarchar(max)");
b.HasIndex("OrganizationID");
b.HasIndex("UserName");
b.HasDiscriminator().HasValue("RemotelyUser");
});
modelBuilder.Entity("DeviceGroupRemotelyUser", b =>
{
b.HasOne("Remotely.Shared.Models.DeviceGroup", null)
.WithMany()
.HasForeignKey("DeviceGroupsID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Remotely.Shared.Models.RemotelyUser", null)
.WithMany()
.HasForeignKey("UsersId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Remotely.Shared.Models.Alert", b =>
{
b.HasOne("Remotely.Shared.Models.Device", "Device")
.WithMany("Alerts")
.HasForeignKey("DeviceID");
b.HasOne("Remotely.Shared.Models.Organization", "Organization")
.WithMany("Alerts")
.HasForeignKey("OrganizationID");
b.HasOne("Remotely.Shared.Models.RemotelyUser", "User")
.WithMany("Alerts")
.HasForeignKey("UserID");
b.Navigation("Device");
b.Navigation("Organization");
b.Navigation("User");
});
modelBuilder.Entity("Remotely.Shared.Models.ApiToken", b =>
{
b.HasOne("Remotely.Shared.Models.Organization", "Organization")
.WithMany("ApiTokens")
.HasForeignKey("OrganizationID");
b.Navigation("Organization");
});
modelBuilder.Entity("Remotely.Shared.Models.CommandResult", b =>
{
b.HasOne("Remotely.Shared.Models.Organization", "Organization")
.WithMany("CommandResults")
.HasForeignKey("OrganizationID");
b.Navigation("Organization");
});
modelBuilder.Entity("Remotely.Shared.Models.Device", b =>
{
b.HasOne("Remotely.Shared.Models.DeviceGroup", "DeviceGroup")
.WithMany("Devices")
.HasForeignKey("DeviceGroupID");
b.HasOne("Remotely.Shared.Models.Organization", "Organization")
.WithMany("Devices")
.HasForeignKey("OrganizationID");
b.Navigation("DeviceGroup");
b.Navigation("Organization");
});
modelBuilder.Entity("Remotely.Shared.Models.DeviceGroup", b =>
{
b.HasOne("Remotely.Shared.Models.Organization", "Organization")
.WithMany("DeviceGroups")
.HasForeignKey("OrganizationID");
b.Navigation("Organization");
});
modelBuilder.Entity("Remotely.Shared.Models.EventLog", b =>
{
b.HasOne("Remotely.Shared.Models.Organization", "Organization")
.WithMany("EventLogs")
.HasForeignKey("OrganizationID");
b.Navigation("Organization");
});
modelBuilder.Entity("Remotely.Shared.Models.InviteLink", b =>
{
b.HasOne("Remotely.Shared.Models.Organization", "Organization")
.WithMany("InviteLinks")
.HasForeignKey("OrganizationID");
b.Navigation("Organization");
});
modelBuilder.Entity("Remotely.Shared.Models.SharedFile", b =>
{
b.HasOne("Remotely.Shared.Models.Organization", "Organization")
.WithMany("SharedFiles")
.HasForeignKey("OrganizationID");
b.Navigation("Organization");
});
modelBuilder.Entity("Remotely.Shared.Models.RemotelyUser", b =>
{
b.HasOne("Remotely.Shared.Models.Organization", "Organization")
.WithMany("RemotelyUsers")
.HasForeignKey("OrganizationID");
b.Navigation("Organization");
});
modelBuilder.Entity("Remotely.Shared.Models.Device", b =>
{
b.Navigation("Alerts");
});
modelBuilder.Entity("Remotely.Shared.Models.DeviceGroup", b =>
{
b.Navigation("Devices");
});
modelBuilder.Entity("Remotely.Shared.Models.Organization", b =>
{
b.Navigation("Alerts");
b.Navigation("ApiTokens");
b.Navigation("CommandResults");
b.Navigation("DeviceGroups");
b.Navigation("Devices");
b.Navigation("EventLogs");
b.Navigation("InviteLinks");
b.Navigation("RemotelyUsers");
b.Navigation("SharedFiles");
});
modelBuilder.Entity("Remotely.Shared.Models.RemotelyUser", b =>
{
b.Navigation("Alerts");
});
#pragma warning restore 612, 618
}
}
}