// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Remotely.Server.Data;

#nullable disable

namespace Remotely.Server.Migrations.Sqlite
{
    [DbContext(typeof(SqliteDbContext))]
    [Migration("20220827150619_Remove deprecated WebRTC")]
    partial class RemovedeprecatedWebRTC
    {
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder.HasAnnotation("ProductVersion", "6.0.6");

            modelBuilder.Entity("DeviceGroupRemotelyUser", b =>
                {
                    b.Property<string>("DeviceGroupsID")
                        .HasColumnType("TEXT");

                    b.Property<string>("UsersId")
                        .HasColumnType("TEXT");

                    b.HasKey("DeviceGroupsID", "UsersId");

                    b.HasIndex("UsersId");

                    b.ToTable("DeviceGroupRemotelyUser");
                });

            modelBuilder.Entity("DeviceGroupScriptSchedule", b =>
                {
                    b.Property<string>("DeviceGroupsID")
                        .HasColumnType("TEXT");

                    b.Property<int>("ScriptSchedulesId")
                        .HasColumnType("INTEGER");

                    b.HasKey("DeviceGroupsID", "ScriptSchedulesId");

                    b.HasIndex("ScriptSchedulesId");

                    b.ToTable("DeviceGroupScriptSchedule");
                });

            modelBuilder.Entity("DeviceScriptRun", b =>
                {
                    b.Property<string>("DevicesID")
                        .HasColumnType("TEXT");

                    b.Property<int>("ScriptRunsId")
                        .HasColumnType("INTEGER");

                    b.HasKey("DevicesID", "ScriptRunsId");

                    b.HasIndex("ScriptRunsId");

                    b.ToTable("DeviceScriptRun");
                });

            modelBuilder.Entity("DeviceScriptRun1", b =>
                {
                    b.Property<string>("DevicesCompletedID")
                        .HasColumnType("TEXT");

                    b.Property<int>("ScriptRunsCompletedId")
                        .HasColumnType("INTEGER");

                    b.HasKey("DevicesCompletedID", "ScriptRunsCompletedId");

                    b.HasIndex("ScriptRunsCompletedId");

                    b.ToTable("DeviceScriptRun1");
                });

            modelBuilder.Entity("DeviceScriptSchedule", b =>
                {
                    b.Property<string>("DevicesID")
                        .HasColumnType("TEXT");

                    b.Property<int>("ScriptSchedulesId")
                        .HasColumnType("INTEGER");

                    b.HasKey("DevicesID", "ScriptSchedulesId");

                    b.HasIndex("ScriptSchedulesId");

                    b.ToTable("DeviceScriptSchedule");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("TEXT");

                    b.Property<string>("ConcurrencyStamp")
                        .IsConcurrencyToken()
                        .HasColumnType("TEXT");

                    b.Property<string>("Name")
                        .HasMaxLength(256)
                        .HasColumnType("TEXT");

                    b.Property<string>("NormalizedName")
                        .HasMaxLength(256)
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("NormalizedName")
                        .IsUnique()
                        .HasDatabaseName("RoleNameIndex");

                    b.ToTable("AspNetRoles", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<string>("ClaimType")
                        .HasColumnType("TEXT");

                    b.Property<string>("ClaimValue")
                        .HasColumnType("TEXT");

                    b.Property<string>("RoleId")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("RoleId");

                    b.ToTable("AspNetRoleClaims", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("TEXT");

                    b.Property<int>("AccessFailedCount")
                        .HasColumnType("INTEGER");

                    b.Property<string>("ConcurrencyStamp")
                        .IsConcurrencyToken()
                        .HasColumnType("TEXT");

                    b.Property<string>("Discriminator")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("Email")
                        .HasMaxLength(256)
                        .HasColumnType("TEXT");

                    b.Property<bool>("EmailConfirmed")
                        .HasColumnType("INTEGER");

                    b.Property<bool>("LockoutEnabled")
                        .HasColumnType("INTEGER");

                    b.Property<string>("LockoutEnd")
                        .HasColumnType("TEXT");

                    b.Property<string>("NormalizedEmail")
                        .HasMaxLength(256)
                        .HasColumnType("TEXT");

                    b.Property<string>("NormalizedUserName")
                        .HasMaxLength(256)
                        .HasColumnType("TEXT");

                    b.Property<string>("PasswordHash")
                        .HasColumnType("TEXT");

                    b.Property<string>("PhoneNumber")
                        .HasColumnType("TEXT");

                    b.Property<bool>("PhoneNumberConfirmed")
                        .HasColumnType("INTEGER");

                    b.Property<string>("SecurityStamp")
                        .HasColumnType("TEXT");

                    b.Property<bool>("TwoFactorEnabled")
                        .HasColumnType("INTEGER");

                    b.Property<string>("UserName")
                        .HasMaxLength(256)
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("NormalizedEmail")
                        .HasDatabaseName("EmailIndex");

                    b.HasIndex("NormalizedUserName")
                        .IsUnique()
                        .HasDatabaseName("UserNameIndex");

                    b.ToTable("RemotelyUsers", (string)null);

                    b.HasDiscriminator<string>("Discriminator").HasValue("IdentityUser");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<string>("ClaimType")
                        .HasColumnType("TEXT");

                    b.Property<string>("ClaimValue")
                        .HasColumnType("TEXT");

                    b.Property<string>("UserId")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("UserId");

                    b.ToTable("AspNetUserClaims", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
                {
                    b.Property<string>("LoginProvider")
                        .HasColumnType("TEXT");

                    b.Property<string>("ProviderKey")
                        .HasColumnType("TEXT");

                    b.Property<string>("ProviderDisplayName")
                        .HasColumnType("TEXT");

                    b.Property<string>("UserId")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.HasKey("LoginProvider", "ProviderKey");

                    b.HasIndex("UserId");

                    b.ToTable("AspNetUserLogins", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
                {
                    b.Property<string>("UserId")
                        .HasColumnType("TEXT");

                    b.Property<string>("RoleId")
                        .HasColumnType("TEXT");

                    b.HasKey("UserId", "RoleId");

                    b.HasIndex("RoleId");

                    b.ToTable("AspNetUserRoles", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
                {
                    b.Property<string>("UserId")
                        .HasColumnType("TEXT");

                    b.Property<string>("LoginProvider")
                        .HasColumnType("TEXT");

                    b.Property<string>("Name")
                        .HasColumnType("TEXT");

                    b.Property<string>("Value")
                        .HasColumnType("TEXT");

                    b.HasKey("UserId", "LoginProvider", "Name");

                    b.ToTable("AspNetUserTokens", (string)null);
                });

            modelBuilder.Entity("Remotely.Shared.Models.Alert", b =>
                {
                    b.Property<string>("ID")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedOn")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("Details")
                        .HasColumnType("TEXT");

                    b.Property<string>("DeviceID")
                        .HasColumnType("TEXT");

                    b.Property<string>("Message")
                        .HasColumnType("TEXT");

                    b.Property<string>("OrganizationID")
                        .HasColumnType("TEXT");

                    b.Property<string>("UserID")
                        .HasColumnType("TEXT");

                    b.HasKey("ID");

                    b.HasIndex("DeviceID");

                    b.HasIndex("OrganizationID");

                    b.HasIndex("UserID");

                    b.ToTable("Alerts");
                });

            modelBuilder.Entity("Remotely.Shared.Models.ApiToken", b =>
                {
                    b.Property<string>("ID")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("TEXT");

                    b.Property<string>("LastUsed")
                        .HasColumnType("TEXT");

                    b.Property<string>("Name")
                        .HasMaxLength(200)
                        .HasColumnType("TEXT");

                    b.Property<string>("OrganizationID")
                        .HasColumnType("TEXT");

                    b.Property<string>("Secret")
                        .HasColumnType("TEXT");

                    b.HasKey("ID");

                    b.HasIndex("OrganizationID");

                    b.ToTable("ApiTokens");
                });

            modelBuilder.Entity("Remotely.Shared.Models.BrandingInfo", b =>
                {
                    b.Property<string>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("TEXT");

                    b.Property<byte>("ButtonForegroundBlue")
                        .HasColumnType("INTEGER");

                    b.Property<byte>("ButtonForegroundGreen")
                        .HasColumnType("INTEGER");

                    b.Property<byte>("ButtonForegroundRed")
                        .HasColumnType("INTEGER");

                    b.Property<byte[]>("Icon")
                        .HasColumnType("BLOB");

                    b.Property<string>("Product")
                        .HasMaxLength(25)
                        .HasColumnType("TEXT");

                    b.Property<byte>("TitleBackgroundBlue")
                        .HasColumnType("INTEGER");

                    b.Property<byte>("TitleBackgroundGreen")
                        .HasColumnType("INTEGER");

                    b.Property<byte>("TitleBackgroundRed")
                        .HasColumnType("INTEGER");

                    b.Property<byte>("TitleForegroundBlue")
                        .HasColumnType("INTEGER");

                    b.Property<byte>("TitleForegroundGreen")
                        .HasColumnType("INTEGER");

                    b.Property<byte>("TitleForegroundRed")
                        .HasColumnType("INTEGER");

                    b.HasKey("Id");

                    b.ToTable("BrandingInfo");
                });

            modelBuilder.Entity("Remotely.Shared.Models.Device", b =>
                {
                    b.Property<string>("ID")
                        .HasColumnType("TEXT");

                    b.Property<string>("AgentVersion")
                        .HasColumnType("TEXT");

                    b.Property<string>("Alias")
                        .HasMaxLength(100)
                        .HasColumnType("TEXT");

                    b.Property<double>("CpuUtilization")
                        .HasColumnType("REAL");

                    b.Property<string>("CurrentUser")
                        .HasColumnType("TEXT");

                    b.Property<string>("DeviceGroupID")
                        .HasColumnType("TEXT");

                    b.Property<string>("DeviceName")
                        .HasColumnType("TEXT");

                    b.Property<string>("Drives")
                        .HasColumnType("TEXT");

                    b.Property<bool>("Is64Bit")
                        .HasColumnType("INTEGER");

                    b.Property<bool>("IsOnline")
                        .HasColumnType("INTEGER");

                    b.Property<string>("LastOnline")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("Notes")
                        .HasMaxLength(5000)
                        .HasColumnType("TEXT");

                    b.Property<int>("OSArchitecture")
                        .HasColumnType("INTEGER");

                    b.Property<string>("OSDescription")
                        .HasColumnType("TEXT");

                    b.Property<string>("OrganizationID")
                        .HasColumnType("TEXT");

                    b.Property<string>("Platform")
                        .HasColumnType("TEXT");

                    b.Property<int>("ProcessorCount")
                        .HasColumnType("INTEGER");

                    b.Property<string>("PublicIP")
                        .HasColumnType("TEXT");

                    b.Property<string>("ServerVerificationToken")
                        .HasColumnType("TEXT");

                    b.Property<string>("Tags")
                        .HasMaxLength(200)
                        .HasColumnType("TEXT");

                    b.Property<double>("TotalMemory")
                        .HasColumnType("REAL");

                    b.Property<double>("TotalStorage")
                        .HasColumnType("REAL");

                    b.Property<double>("UsedMemory")
                        .HasColumnType("REAL");

                    b.Property<double>("UsedStorage")
                        .HasColumnType("REAL");

                    b.HasKey("ID");

                    b.HasIndex("DeviceGroupID");

                    b.HasIndex("DeviceName");

                    b.HasIndex("OrganizationID");

                    b.ToTable("Devices");
                });

            modelBuilder.Entity("Remotely.Shared.Models.DeviceGroup", b =>
                {
                    b.Property<string>("ID")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("TEXT");

                    b.Property<string>("Name")
                        .HasMaxLength(200)
                        .HasColumnType("TEXT");

                    b.Property<string>("OrganizationID")
                        .HasColumnType("TEXT");

                    b.HasKey("ID");

                    b.HasIndex("OrganizationID");

                    b.ToTable("DeviceGroups");
                });

            modelBuilder.Entity("Remotely.Shared.Models.EventLog", b =>
                {
                    b.Property<string>("ID")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("TEXT");

                    b.Property<int>("EventType")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Message")
                        .HasColumnType("TEXT");

                    b.Property<string>("OrganizationID")
                        .HasColumnType("TEXT");

                    b.Property<string>("Source")
                        .HasColumnType("TEXT");

                    b.Property<string>("StackTrace")
                        .HasColumnType("TEXT");

                    b.Property<string>("TimeStamp")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.HasKey("ID");

                    b.HasIndex("OrganizationID");

                    b.ToTable("EventLogs");
                });

            modelBuilder.Entity("Remotely.Shared.Models.InviteLink", b =>
                {
                    b.Property<string>("ID")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("TEXT");

                    b.Property<string>("DateSent")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("InvitedUser")
                        .HasColumnType("TEXT");

                    b.Property<bool>("IsAdmin")
                        .HasColumnType("INTEGER");

                    b.Property<string>("OrganizationID")
                        .HasColumnType("TEXT");

                    b.Property<string>("ResetUrl")
                        .HasColumnType("TEXT");

                    b.HasKey("ID");

                    b.HasIndex("OrganizationID");

                    b.ToTable("InviteLinks");
                });

            modelBuilder.Entity("Remotely.Shared.Models.Organization", b =>
                {
                    b.Property<string>("ID")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("TEXT");

                    b.Property<string>("BrandingInfoId")
                        .HasColumnType("TEXT");

                    b.Property<bool>("IsDefaultOrganization")
                        .HasColumnType("INTEGER");

                    b.Property<string>("OrganizationName")
                        .HasMaxLength(25)
                        .HasColumnType("TEXT");

                    b.Property<string>("RelayCode")
                        .HasColumnType("TEXT");

                    b.HasKey("ID");

                    b.HasIndex("BrandingInfoId");

                    b.ToTable("Organizations");
                });

            modelBuilder.Entity("Remotely.Shared.Models.SavedScript", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("TEXT");

                    b.Property<string>("Content")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatorId")
                        .HasColumnType("TEXT");

                    b.Property<string>("FolderPath")
                        .HasMaxLength(200)
                        .HasColumnType("TEXT");

                    b.Property<bool>("GenerateAlertOnError")
                        .HasColumnType("INTEGER");

                    b.Property<bool>("IsPublic")
                        .HasColumnType("INTEGER");

                    b.Property<bool>("IsQuickScript")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("TEXT");

                    b.Property<string>("OrganizationID")
                        .HasColumnType("TEXT");

                    b.Property<bool>("SendEmailOnError")
                        .HasColumnType("INTEGER");

                    b.Property<string>("SendErrorEmailTo")
                        .HasColumnType("TEXT");

                    b.Property<int>("Shell")
                        .HasColumnType("INTEGER");

                    b.HasKey("Id");

                    b.HasIndex("CreatorId");

                    b.HasIndex("OrganizationID");

                    b.ToTable("SavedScripts");
                });

            modelBuilder.Entity("Remotely.Shared.Models.ScriptResult", b =>
                {
                    b.Property<string>("ID")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("TEXT");

                    b.Property<string>("DeviceID")
                        .HasColumnType("TEXT");

                    b.Property<string>("ErrorOutput")
                        .HasColumnType("TEXT");

                    b.Property<bool>("HadErrors")
                        .HasColumnType("INTEGER");

                    b.Property<int>("InputType")
                        .HasColumnType("INTEGER");

                    b.Property<string>("OrganizationID")
                        .HasColumnType("TEXT");

                    b.Property<TimeSpan>("RunTime")
                        .HasColumnType("TEXT");

                    b.Property<Guid?>("SavedScriptId")
                        .HasColumnType("TEXT");

                    b.Property<int?>("ScheduleId")
                        .HasColumnType("INTEGER");

                    b.Property<string>("ScriptInput")
                        .HasColumnType("TEXT");

                    b.Property<int?>("ScriptRunId")
                        .HasColumnType("INTEGER");

                    b.Property<string>("SenderConnectionID")
                        .HasColumnType("TEXT");

                    b.Property<string>("SenderUserName")
                        .HasColumnType("TEXT");

                    b.Property<int>("Shell")
                        .HasColumnType("INTEGER");

                    b.Property<string>("StandardOutput")
                        .HasColumnType("TEXT");

                    b.Property<string>("TimeStamp")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.HasKey("ID");

                    b.HasIndex("DeviceID");

                    b.HasIndex("OrganizationID");

                    b.HasIndex("ScheduleId");

                    b.HasIndex("ScriptRunId");

                    b.ToTable("ScriptResults");
                });

            modelBuilder.Entity("Remotely.Shared.Models.ScriptRun", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<string>("Initiator")
                        .HasColumnType("TEXT");

                    b.Property<int>("InputType")
                        .HasColumnType("INTEGER");

                    b.Property<string>("OrganizationID")
                        .HasColumnType("TEXT");

                    b.Property<string>("RunAt")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<bool>("RunOnNextConnect")
                        .HasColumnType("INTEGER");

                    b.Property<Guid?>("SavedScriptId")
                        .HasColumnType("TEXT");

                    b.Property<int?>("ScheduleId")
                        .HasColumnType("INTEGER");

                    b.Property<int?>("ScriptScheduleId")
                        .HasColumnType("INTEGER");

                    b.HasKey("Id");

                    b.HasIndex("OrganizationID");

                    b.HasIndex("ScriptScheduleId");

                    b.ToTable("ScriptRuns");
                });

            modelBuilder.Entity("Remotely.Shared.Models.ScriptSchedule", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<string>("CreatedAt")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatorId")
                        .HasColumnType("TEXT");

                    b.Property<int>("Interval")
                        .HasColumnType("INTEGER");

                    b.Property<string>("LastRun")
                        .HasColumnType("TEXT");

                    b.Property<string>("Name")
                        .HasColumnType("TEXT");

                    b.Property<string>("NextRun")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("OrganizationID")
                        .HasColumnType("TEXT");

                    b.Property<bool>("RunOnNextConnect")
                        .HasColumnType("INTEGER");

                    b.Property<Guid>("SavedScriptId")
                        .HasColumnType("TEXT");

                    b.Property<string>("StartAt")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("CreatorId");

                    b.HasIndex("OrganizationID");

                    b.ToTable("ScriptSchedules");
                });

            modelBuilder.Entity("Remotely.Shared.Models.SharedFile", b =>
                {
                    b.Property<string>("ID")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("TEXT");

                    b.Property<string>("ContentType")
                        .HasColumnType("TEXT");

                    b.Property<byte[]>("FileContents")
                        .HasColumnType("BLOB");

                    b.Property<string>("FileName")
                        .HasColumnType("TEXT");

                    b.Property<string>("OrganizationID")
                        .HasColumnType("TEXT");

                    b.Property<string>("Timestamp")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.HasKey("ID");

                    b.HasIndex("OrganizationID");

                    b.ToTable("SharedFiles");
                });

            modelBuilder.Entity("Remotely.Shared.Models.RemotelyUser", b =>
                {
                    b.HasBaseType("Microsoft.AspNetCore.Identity.IdentityUser");

                    b.Property<bool>("IsAdministrator")
                        .HasColumnType("INTEGER");

                    b.Property<bool>("IsServerAdmin")
                        .HasColumnType("INTEGER");

                    b.Property<string>("OrganizationID")
                        .HasColumnType("TEXT");

                    b.Property<string>("TempPassword")
                        .HasColumnType("TEXT");

                    b.Property<string>("UserOptions")
                        .HasColumnType("TEXT");

                    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("DeviceGroupScriptSchedule", b =>
                {
                    b.HasOne("Remotely.Shared.Models.DeviceGroup", null)
                        .WithMany()
                        .HasForeignKey("DeviceGroupsID")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Remotely.Shared.Models.ScriptSchedule", null)
                        .WithMany()
                        .HasForeignKey("ScriptSchedulesId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("DeviceScriptRun", b =>
                {
                    b.HasOne("Remotely.Shared.Models.Device", null)
                        .WithMany()
                        .HasForeignKey("DevicesID")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Remotely.Shared.Models.ScriptRun", null)
                        .WithMany()
                        .HasForeignKey("ScriptRunsId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("DeviceScriptRun1", b =>
                {
                    b.HasOne("Remotely.Shared.Models.Device", null)
                        .WithMany()
                        .HasForeignKey("DevicesCompletedID")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Remotely.Shared.Models.ScriptRun", null)
                        .WithMany()
                        .HasForeignKey("ScriptRunsCompletedId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("DeviceScriptSchedule", b =>
                {
                    b.HasOne("Remotely.Shared.Models.Device", null)
                        .WithMany()
                        .HasForeignKey("DevicesID")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Remotely.Shared.Models.ScriptSchedule", null)
                        .WithMany()
                        .HasForeignKey("ScriptSchedulesId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
                        .WithMany()
                        .HasForeignKey("RoleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", 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<string>", 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.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.Organization", b =>
                {
                    b.HasOne("Remotely.Shared.Models.BrandingInfo", "BrandingInfo")
                        .WithMany()
                        .HasForeignKey("BrandingInfoId");

                    b.Navigation("BrandingInfo");
                });

            modelBuilder.Entity("Remotely.Shared.Models.SavedScript", b =>
                {
                    b.HasOne("Remotely.Shared.Models.RemotelyUser", "Creator")
                        .WithMany("SavedScripts")
                        .HasForeignKey("CreatorId");

                    b.HasOne("Remotely.Shared.Models.Organization", "Organization")
                        .WithMany("SavedScripts")
                        .HasForeignKey("OrganizationID");

                    b.Navigation("Creator");

                    b.Navigation("Organization");
                });

            modelBuilder.Entity("Remotely.Shared.Models.ScriptResult", b =>
                {
                    b.HasOne("Remotely.Shared.Models.Device", "Device")
                        .WithMany("ScriptResults")
                        .HasForeignKey("DeviceID");

                    b.HasOne("Remotely.Shared.Models.Organization", "Organization")
                        .WithMany("ScriptResults")
                        .HasForeignKey("OrganizationID");

                    b.HasOne("Remotely.Shared.Models.ScriptSchedule", "Schedule")
                        .WithMany()
                        .HasForeignKey("ScheduleId");

                    b.HasOne("Remotely.Shared.Models.ScriptRun", null)
                        .WithMany("Results")
                        .HasForeignKey("ScriptRunId");

                    b.Navigation("Device");

                    b.Navigation("Organization");

                    b.Navigation("Schedule");
                });

            modelBuilder.Entity("Remotely.Shared.Models.ScriptRun", b =>
                {
                    b.HasOne("Remotely.Shared.Models.Organization", "Organization")
                        .WithMany("ScriptRuns")
                        .HasForeignKey("OrganizationID");

                    b.HasOne("Remotely.Shared.Models.ScriptSchedule", null)
                        .WithMany("ScriptRuns")
                        .HasForeignKey("ScriptScheduleId");

                    b.Navigation("Organization");
                });

            modelBuilder.Entity("Remotely.Shared.Models.ScriptSchedule", b =>
                {
                    b.HasOne("Remotely.Shared.Models.RemotelyUser", "Creator")
                        .WithMany("ScriptSchedules")
                        .HasForeignKey("CreatorId");

                    b.HasOne("Remotely.Shared.Models.Organization", "Organization")
                        .WithMany("ScriptSchedules")
                        .HasForeignKey("OrganizationID");

                    b.Navigation("Creator");

                    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");

                    b.Navigation("ScriptResults");
                });

            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("DeviceGroups");

                    b.Navigation("Devices");

                    b.Navigation("EventLogs");

                    b.Navigation("InviteLinks");

                    b.Navigation("RemotelyUsers");

                    b.Navigation("SavedScripts");

                    b.Navigation("ScriptResults");

                    b.Navigation("ScriptRuns");

                    b.Navigation("ScriptSchedules");

                    b.Navigation("SharedFiles");
                });

            modelBuilder.Entity("Remotely.Shared.Models.ScriptRun", b =>
                {
                    b.Navigation("Results");
                });

            modelBuilder.Entity("Remotely.Shared.Models.ScriptSchedule", b =>
                {
                    b.Navigation("ScriptRuns");
                });

            modelBuilder.Entity("Remotely.Shared.Models.RemotelyUser", b =>
                {
                    b.Navigation("Alerts");

                    b.Navigation("SavedScripts");

                    b.Navigation("ScriptSchedules");
                });
#pragma warning restore 612, 618
        }
    }
}
