Migrations.

This commit is contained in:
Jared 2021-02-16 19:49:07 -08:00 committed by Jared Goodwin
parent ea7f4e5ce8
commit 2e356f6b99
11 changed files with 2733 additions and 31 deletions

View File

@ -0,0 +1,856 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using Remotely.Server.Data;
namespace Remotely.Server.Migrations.PostgreSql
{
[DbContext(typeof(PostgreSqlDbContext))]
[Migration("20210217033418_Remove 3rd Party Services")]
partial class Remove3rdPartyServices
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.UseIdentityByDefaultColumns()
.HasAnnotation("Relational:MaxIdentifierLength", 63)
.HasAnnotation("ProductVersion", "5.0.2");
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("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("character varying(256)");
b.Property<string>("NormalizedName")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasDatabaseName("RoleNameIndex");
b.ToTable("AspNetRoles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.UseIdentityByDefaultColumn();
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");
});
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("character varying(256)");
b.Property<bool>("EmailConfirmed")
.HasColumnType("boolean");
b.Property<bool>("LockoutEnabled")
.HasColumnType("boolean");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("timestamp with time zone");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("PasswordHash")
.HasColumnType("text");
b.Property<string>("PhoneNumber")
.HasColumnType("text");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("boolean");
b.Property<string>("SecurityStamp")
.HasColumnType("text");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("boolean");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex");
b.ToTable("RemotelyUsers");
b.HasDiscriminator<string>("Discriminator").HasValue("IdentityUser");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.UseIdentityByDefaultColumn();
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");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.Property<string>("LoginProvider")
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("ProviderKey")
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("ProviderDisplayName")
.HasColumnType("text");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("text");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins");
});
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");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("text");
b.Property<string>("LoginProvider")
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("Name")
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("Value")
.HasColumnType("text");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens");
});
modelBuilder.Entity("Remotely.Shared.Models.Alert", b =>
{
b.Property<string>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("text");
b.Property<DateTimeOffset>("CreatedOn")
.HasColumnType("timestamp with time zone");
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<DateTimeOffset?>("LastUsed")
.HasColumnType("timestamp with time zone");
b.Property<string>("Name")
.HasMaxLength(200)
.HasColumnType("character varying(200)");
b.Property<string>("OrganizationID")
.HasColumnType("text");
b.Property<string>("Secret")
.HasColumnType("text");
b.Property<string>("Token")
.HasColumnType("text");
b.HasKey("ID");
b.HasIndex("OrganizationID");
b.HasIndex("Token");
b.ToTable("ApiTokens");
});
modelBuilder.Entity("Remotely.Shared.Models.BrandingInfo", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("text");
b.Property<byte>("ButtonForegroundBlue")
.HasColumnType("smallint");
b.Property<byte>("ButtonForegroundGreen")
.HasColumnType("smallint");
b.Property<byte>("ButtonForegroundRed")
.HasColumnType("smallint");
b.Property<byte[]>("Icon")
.HasColumnType("bytea");
b.Property<string>("Product")
.HasMaxLength(25)
.HasColumnType("character varying(25)");
b.Property<byte>("TitleBackgroundBlue")
.HasColumnType("smallint");
b.Property<byte>("TitleBackgroundGreen")
.HasColumnType("smallint");
b.Property<byte>("TitleBackgroundRed")
.HasColumnType("smallint");
b.Property<byte>("TitleForegroundBlue")
.HasColumnType("smallint");
b.Property<byte>("TitleForegroundGreen")
.HasColumnType("smallint");
b.Property<byte>("TitleForegroundRed")
.HasColumnType("smallint");
b.HasKey("Id");
b.ToTable("BrandingInfo");
});
modelBuilder.Entity("Remotely.Shared.Models.CommandResult", b =>
{
b.Property<string>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("text");
b.Property<string>("CommandMode")
.HasColumnType("text");
b.Property<string>("CommandResults")
.HasColumnType("text");
b.Property<string>("CommandText")
.HasColumnType("text");
b.Property<string>("OrganizationID")
.HasColumnType("text");
b.Property<string>("PSCoreResults")
.HasColumnType("text");
b.Property<string>("SenderConnectionID")
.HasColumnType("text");
b.Property<string>("SenderUserID")
.HasColumnType("text");
b.Property<string>("TargetDeviceIDs")
.HasColumnType("text");
b.Property<DateTimeOffset>("TimeStamp")
.HasColumnType("timestamp with time zone");
b.HasKey("ID");
b.HasIndex("OrganizationID");
b.ToTable("CommandResults");
});
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("character varying(100)");
b.Property<double>("CpuUtilization")
.HasColumnType("double precision");
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("boolean");
b.Property<bool>("IsOnline")
.HasColumnType("boolean");
b.Property<DateTimeOffset>("LastOnline")
.HasColumnType("timestamp with time zone");
b.Property<string>("Notes")
.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("character varying(200)");
b.Property<double>("TotalMemory")
.HasColumnType("double precision");
b.Property<double>("TotalStorage")
.HasColumnType("double precision");
b.Property<double>("UsedMemory")
.HasColumnType("double precision");
b.Property<double>("UsedStorage")
.HasColumnType("double precision");
b.Property<int>("WebRtcSetting")
.HasColumnType("integer");
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("character varying(200)");
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<DateTimeOffset>("TimeStamp")
.HasColumnType("timestamp with time zone");
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<DateTimeOffset>("DateSent")
.HasColumnType("timestamp with time zone");
b.Property<string>("InvitedUser")
.HasColumnType("text");
b.Property<bool>("IsAdmin")
.HasColumnType("boolean");
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("boolean");
b.Property<string>("OrganizationName")
.HasMaxLength(25)
.HasColumnType("character varying(25)");
b.Property<string>("RelayCode")
.HasColumnType("text");
b.HasKey("ID");
b.HasIndex("BrandingInfoId");
b.ToTable("Organizations");
});
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("bytea");
b.Property<string>("FileName")
.HasColumnType("text");
b.Property<string>("OrganizationID")
.HasColumnType("text");
b.Property<DateTimeOffset>("Timestamp")
.HasColumnType("timestamp with time zone");
b.HasKey("ID");
b.HasIndex("OrganizationID");
b.ToTable("SharedFiles");
});
modelBuilder.Entity("Remotely.Shared.Models.RemotelyUser", b =>
{
b.HasBaseType("Microsoft.AspNetCore.Identity.IdentityUser");
b.Property<string>("DisplayName")
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.Property<bool>("IsAdministrator")
.HasColumnType("boolean");
b.Property<bool>("IsServerAdmin")
.HasColumnType("boolean");
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("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.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.Organization", b =>
{
b.HasOne("Remotely.Shared.Models.BrandingInfo", "BrandingInfo")
.WithMany()
.HasForeignKey("BrandingInfoId");
b.Navigation("BrandingInfo");
});
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
}
}
}

View File

@ -0,0 +1,44 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Remotely.Server.Migrations.PostgreSql
{
public partial class Remove3rdPartyServices : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "GithubUser",
table: "Organizations");
migrationBuilder.DropColumn(
name: "SponsorAmount",
table: "Organizations");
migrationBuilder.DropColumn(
name: "UnlockCode",
table: "Organizations");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "GithubUser",
table: "Organizations",
type: "text",
nullable: true);
migrationBuilder.AddColumn<double>(
name: "SponsorAmount",
table: "Organizations",
type: "double precision",
nullable: false,
defaultValue: 0.0);
migrationBuilder.AddColumn<string>(
name: "UnlockCode",
table: "Organizations",
type: "text",
nullable: true);
}
}
}

View File

@ -241,6 +241,7 @@ namespace Remotely.Server.Migrations.PostgreSql
modelBuilder.Entity("Remotely.Shared.Models.Alert", b =>
{
b.Property<string>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("text");
b.Property<DateTimeOffset>("CreatedOn")
@ -272,6 +273,7 @@ namespace Remotely.Server.Migrations.PostgreSql
modelBuilder.Entity("Remotely.Shared.Models.ApiToken", b =>
{
b.Property<string>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("text");
b.Property<DateTimeOffset?>("LastUsed")
@ -302,6 +304,7 @@ namespace Remotely.Server.Migrations.PostgreSql
modelBuilder.Entity("Remotely.Shared.Models.BrandingInfo", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("text");
b.Property<byte>("ButtonForegroundBlue")
@ -346,6 +349,7 @@ namespace Remotely.Server.Migrations.PostgreSql
modelBuilder.Entity("Remotely.Shared.Models.CommandResult", b =>
{
b.Property<string>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("text");
b.Property<string>("CommandMode")
@ -475,6 +479,7 @@ namespace Remotely.Server.Migrations.PostgreSql
modelBuilder.Entity("Remotely.Shared.Models.DeviceGroup", b =>
{
b.Property<string>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("text");
b.Property<string>("Name")
@ -494,6 +499,7 @@ namespace Remotely.Server.Migrations.PostgreSql
modelBuilder.Entity("Remotely.Shared.Models.EventLog", b =>
{
b.Property<string>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("text");
b.Property<int>("EventType")
@ -524,6 +530,7 @@ namespace Remotely.Server.Migrations.PostgreSql
modelBuilder.Entity("Remotely.Shared.Models.InviteLink", b =>
{
b.Property<string>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("text");
b.Property<DateTimeOffset>("DateSent")
@ -551,14 +558,12 @@ namespace Remotely.Server.Migrations.PostgreSql
modelBuilder.Entity("Remotely.Shared.Models.Organization", b =>
{
b.Property<string>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("text");
b.Property<string>("BrandingInfoId")
.HasColumnType("text");
b.Property<string>("GithubUser")
.HasColumnType("text");
b.Property<bool>("IsDefaultOrganization")
.HasColumnType("boolean");
@ -569,12 +574,6 @@ namespace Remotely.Server.Migrations.PostgreSql
b.Property<string>("RelayCode")
.HasColumnType("text");
b.Property<double>("SponsorAmount")
.HasColumnType("double precision");
b.Property<string>("UnlockCode")
.HasColumnType("text");
b.HasKey("ID");
b.HasIndex("BrandingInfoId");
@ -585,6 +584,7 @@ namespace Remotely.Server.Migrations.PostgreSql
modelBuilder.Entity("Remotely.Shared.Models.SharedFile", b =>
{
b.Property<string>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("text");
b.Property<string>("ContentType")

View File

@ -1,4 +1,5 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Remotely.Server.Migrations.SqlServer
@ -38,7 +39,7 @@ namespace Remotely.Server.Migrations.SqlServer
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
RoleId = table.Column<string>(nullable: false),
ClaimType = table.Column<string>(nullable: true),
ClaimValue = table.Column<string>(nullable: true)
@ -277,7 +278,7 @@ namespace Remotely.Server.Migrations.SqlServer
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
UserId = table.Column<string>(nullable: false),
ClaimType = table.Column<string>(nullable: true),
ClaimValue = table.Column<string>(nullable: true)

View File

@ -0,0 +1,858 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Remotely.Server.Data;
namespace Remotely.Server.Migrations.SqlServer
{
[DbContext(typeof(SqlServerDbContext))]
[Migration("20210217033404_Remove 3rd Party Services")]
partial class Remove3rdPartyServices
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.UseIdentityColumns()
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("ProductVersion", "5.0.2");
modelBuilder.Entity("DeviceGroupRemotelyUser", b =>
{
b.Property<string>("DeviceGroupsID")
.HasColumnType("nvarchar(450)");
b.Property<string>("UsersId")
.HasColumnType("nvarchar(450)");
b.HasKey("DeviceGroupsID", "UsersId");
b.HasIndex("UsersId");
b.ToTable("DeviceGroupRemotelyUser");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property<string>("Id")
.HasColumnType("nvarchar(450)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("nvarchar(max)");
b.Property<string>("Name")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("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<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.UseIdentityColumn();
b.Property<string>("ClaimType")
.HasColumnType("nvarchar(max)");
b.Property<string>("ClaimValue")
.HasColumnType("nvarchar(max)");
b.Property<string>("RoleId")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
{
b.Property<string>("Id")
.HasColumnType("nvarchar(450)");
b.Property<int>("AccessFailedCount")
.HasColumnType("int");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("nvarchar(max)");
b.Property<string>("Discriminator")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<bool>("EmailConfirmed")
.HasColumnType("bit");
b.Property<bool>("LockoutEnabled")
.HasColumnType("bit");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("datetimeoffset");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("PasswordHash")
.HasColumnType("nvarchar(max)");
b.Property<string>("PhoneNumber")
.HasColumnType("nvarchar(max)");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("bit");
b.Property<string>("SecurityStamp")
.HasColumnType("nvarchar(max)");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("bit");
b.Property<string>("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<string>("Discriminator").HasValue("IdentityUser");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.UseIdentityColumn();
b.Property<string>("ClaimType")
.HasColumnType("nvarchar(max)");
b.Property<string>("ClaimValue")
.HasColumnType("nvarchar(max)");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.Property<string>("LoginProvider")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("ProviderKey")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("ProviderDisplayName")
.HasColumnType("nvarchar(max)");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("nvarchar(450)");
b.Property<string>("RoleId")
.HasColumnType("nvarchar(450)");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("nvarchar(450)");
b.Property<string>("LoginProvider")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("Name")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("Value")
.HasColumnType("nvarchar(max)");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens");
});
modelBuilder.Entity("Remotely.Shared.Models.Alert", b =>
{
b.Property<string>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<DateTimeOffset>("CreatedOn")
.HasColumnType("datetimeoffset");
b.Property<string>("DeviceID")
.HasColumnType("nvarchar(450)");
b.Property<string>("Message")
.HasColumnType("nvarchar(max)");
b.Property<string>("OrganizationID")
.HasColumnType("nvarchar(450)");
b.Property<string>("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<string>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<DateTimeOffset?>("LastUsed")
.HasColumnType("datetimeoffset");
b.Property<string>("Name")
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<string>("OrganizationID")
.HasColumnType("nvarchar(450)");
b.Property<string>("Secret")
.HasColumnType("nvarchar(max)");
b.Property<string>("Token")
.HasColumnType("nvarchar(450)");
b.HasKey("ID");
b.HasIndex("OrganizationID");
b.HasIndex("Token");
b.ToTable("ApiTokens");
});
modelBuilder.Entity("Remotely.Shared.Models.BrandingInfo", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<byte>("ButtonForegroundBlue")
.HasColumnType("tinyint");
b.Property<byte>("ButtonForegroundGreen")
.HasColumnType("tinyint");
b.Property<byte>("ButtonForegroundRed")
.HasColumnType("tinyint");
b.Property<byte[]>("Icon")
.HasColumnType("varbinary(max)");
b.Property<string>("Product")
.HasMaxLength(25)
.HasColumnType("nvarchar(25)");
b.Property<byte>("TitleBackgroundBlue")
.HasColumnType("tinyint");
b.Property<byte>("TitleBackgroundGreen")
.HasColumnType("tinyint");
b.Property<byte>("TitleBackgroundRed")
.HasColumnType("tinyint");
b.Property<byte>("TitleForegroundBlue")
.HasColumnType("tinyint");
b.Property<byte>("TitleForegroundGreen")
.HasColumnType("tinyint");
b.Property<byte>("TitleForegroundRed")
.HasColumnType("tinyint");
b.HasKey("Id");
b.ToTable("BrandingInfo");
});
modelBuilder.Entity("Remotely.Shared.Models.CommandResult", b =>
{
b.Property<string>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("CommandMode")
.HasColumnType("nvarchar(max)");
b.Property<string>("CommandResults")
.HasColumnType("nvarchar(max)");
b.Property<string>("CommandText")
.HasColumnType("nvarchar(max)");
b.Property<string>("OrganizationID")
.HasColumnType("nvarchar(450)");
b.Property<string>("PSCoreResults")
.HasColumnType("nvarchar(max)");
b.Property<string>("SenderConnectionID")
.HasColumnType("nvarchar(max)");
b.Property<string>("SenderUserID")
.HasColumnType("nvarchar(max)");
b.Property<string>("TargetDeviceIDs")
.HasColumnType("nvarchar(max)");
b.Property<DateTimeOffset>("TimeStamp")
.HasColumnType("datetimeoffset");
b.HasKey("ID");
b.HasIndex("OrganizationID");
b.ToTable("CommandResults");
});
modelBuilder.Entity("Remotely.Shared.Models.Device", b =>
{
b.Property<string>("ID")
.HasColumnType("nvarchar(450)");
b.Property<string>("AgentVersion")
.HasColumnType("nvarchar(max)");
b.Property<string>("Alias")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<double>("CpuUtilization")
.HasColumnType("float");
b.Property<string>("CurrentUser")
.HasColumnType("nvarchar(max)");
b.Property<string>("DeviceGroupID")
.HasColumnType("nvarchar(450)");
b.Property<string>("DeviceName")
.HasColumnType("nvarchar(450)");
b.Property<string>("Drives")
.HasColumnType("nvarchar(max)");
b.Property<bool>("Is64Bit")
.HasColumnType("bit");
b.Property<bool>("IsOnline")
.HasColumnType("bit");
b.Property<DateTimeOffset>("LastOnline")
.HasColumnType("datetimeoffset");
b.Property<string>("Notes")
.HasColumnType("nvarchar(max)");
b.Property<int>("OSArchitecture")
.HasColumnType("int");
b.Property<string>("OSDescription")
.HasColumnType("nvarchar(max)");
b.Property<string>("OrganizationID")
.HasColumnType("nvarchar(450)");
b.Property<string>("Platform")
.HasColumnType("nvarchar(max)");
b.Property<int>("ProcessorCount")
.HasColumnType("int");
b.Property<string>("PublicIP")
.HasColumnType("nvarchar(max)");
b.Property<string>("ServerVerificationToken")
.HasColumnType("nvarchar(max)");
b.Property<string>("Tags")
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<double>("TotalMemory")
.HasColumnType("float");
b.Property<double>("TotalStorage")
.HasColumnType("float");
b.Property<double>("UsedMemory")
.HasColumnType("float");
b.Property<double>("UsedStorage")
.HasColumnType("float");
b.Property<int>("WebRtcSetting")
.HasColumnType("int");
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("nvarchar(450)");
b.Property<string>("Name")
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<string>("OrganizationID")
.HasColumnType("nvarchar(450)");
b.HasKey("ID");
b.HasIndex("OrganizationID");
b.ToTable("DeviceGroups");
});
modelBuilder.Entity("Remotely.Shared.Models.EventLog", b =>
{
b.Property<string>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<int>("EventType")
.HasColumnType("int");
b.Property<string>("Message")
.HasColumnType("nvarchar(max)");
b.Property<string>("OrganizationID")
.HasColumnType("nvarchar(450)");
b.Property<string>("Source")
.HasColumnType("nvarchar(max)");
b.Property<string>("StackTrace")
.HasColumnType("nvarchar(max)");
b.Property<DateTimeOffset>("TimeStamp")
.HasColumnType("datetimeoffset");
b.HasKey("ID");
b.HasIndex("OrganizationID");
b.ToTable("EventLogs");
});
modelBuilder.Entity("Remotely.Shared.Models.InviteLink", b =>
{
b.Property<string>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<DateTimeOffset>("DateSent")
.HasColumnType("datetimeoffset");
b.Property<string>("InvitedUser")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsAdmin")
.HasColumnType("bit");
b.Property<string>("OrganizationID")
.HasColumnType("nvarchar(450)");
b.Property<string>("ResetUrl")
.HasColumnType("nvarchar(max)");
b.HasKey("ID");
b.HasIndex("OrganizationID");
b.ToTable("InviteLinks");
});
modelBuilder.Entity("Remotely.Shared.Models.Organization", b =>
{
b.Property<string>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("BrandingInfoId")
.HasColumnType("nvarchar(450)");
b.Property<bool>("IsDefaultOrganization")
.HasColumnType("bit");
b.Property<string>("OrganizationName")
.HasMaxLength(25)
.HasColumnType("nvarchar(25)");
b.Property<string>("RelayCode")
.HasColumnType("nvarchar(max)");
b.HasKey("ID");
b.HasIndex("BrandingInfoId");
b.ToTable("Organizations");
});
modelBuilder.Entity("Remotely.Shared.Models.SharedFile", b =>
{
b.Property<string>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("ContentType")
.HasColumnType("nvarchar(max)");
b.Property<byte[]>("FileContents")
.HasColumnType("varbinary(max)");
b.Property<string>("FileName")
.HasColumnType("nvarchar(max)");
b.Property<string>("OrganizationID")
.HasColumnType("nvarchar(450)");
b.Property<DateTimeOffset>("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<string>("DisplayName")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<bool>("IsAdministrator")
.HasColumnType("bit");
b.Property<bool>("IsServerAdmin")
.HasColumnType("bit");
b.Property<string>("OrganizationID")
.HasColumnType("nvarchar(450)");
b.Property<string>("TempPassword")
.HasColumnType("nvarchar(max)");
b.Property<string>("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<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.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.Organization", b =>
{
b.HasOne("Remotely.Shared.Models.BrandingInfo", "BrandingInfo")
.WithMany()
.HasForeignKey("BrandingInfoId");
b.Navigation("BrandingInfo");
});
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
}
}
}

View File

@ -0,0 +1,44 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Remotely.Server.Migrations.SqlServer
{
public partial class Remove3rdPartyServices : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "GithubUser",
table: "Organizations");
migrationBuilder.DropColumn(
name: "SponsorAmount",
table: "Organizations");
migrationBuilder.DropColumn(
name: "UnlockCode",
table: "Organizations");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "GithubUser",
table: "Organizations",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<double>(
name: "SponsorAmount",
table: "Organizations",
type: "float",
nullable: false,
defaultValue: 0.0);
migrationBuilder.AddColumn<string>(
name: "UnlockCode",
table: "Organizations",
type: "nvarchar(max)",
nullable: true);
}
}
}

View File

@ -243,6 +243,7 @@ namespace Remotely.Server.Migrations.SqlServer
modelBuilder.Entity("Remotely.Shared.Models.Alert", b =>
{
b.Property<string>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<DateTimeOffset>("CreatedOn")
@ -274,6 +275,7 @@ namespace Remotely.Server.Migrations.SqlServer
modelBuilder.Entity("Remotely.Shared.Models.ApiToken", b =>
{
b.Property<string>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<DateTimeOffset?>("LastUsed")
@ -304,6 +306,7 @@ namespace Remotely.Server.Migrations.SqlServer
modelBuilder.Entity("Remotely.Shared.Models.BrandingInfo", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<byte>("ButtonForegroundBlue")
@ -348,6 +351,7 @@ namespace Remotely.Server.Migrations.SqlServer
modelBuilder.Entity("Remotely.Shared.Models.CommandResult", b =>
{
b.Property<string>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("CommandMode")
@ -477,6 +481,7 @@ namespace Remotely.Server.Migrations.SqlServer
modelBuilder.Entity("Remotely.Shared.Models.DeviceGroup", b =>
{
b.Property<string>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("Name")
@ -496,6 +501,7 @@ namespace Remotely.Server.Migrations.SqlServer
modelBuilder.Entity("Remotely.Shared.Models.EventLog", b =>
{
b.Property<string>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<int>("EventType")
@ -526,6 +532,7 @@ namespace Remotely.Server.Migrations.SqlServer
modelBuilder.Entity("Remotely.Shared.Models.InviteLink", b =>
{
b.Property<string>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<DateTimeOffset>("DateSent")
@ -553,14 +560,12 @@ namespace Remotely.Server.Migrations.SqlServer
modelBuilder.Entity("Remotely.Shared.Models.Organization", b =>
{
b.Property<string>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("BrandingInfoId")
.HasColumnType("nvarchar(450)");
b.Property<string>("GithubUser")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDefaultOrganization")
.HasColumnType("bit");
@ -571,12 +576,6 @@ namespace Remotely.Server.Migrations.SqlServer
b.Property<string>("RelayCode")
.HasColumnType("nvarchar(max)");
b.Property<double>("SponsorAmount")
.HasColumnType("float");
b.Property<string>("UnlockCode")
.HasColumnType("nvarchar(max)");
b.HasKey("ID");
b.HasIndex("BrandingInfoId");
@ -587,6 +586,7 @@ namespace Remotely.Server.Migrations.SqlServer
modelBuilder.Entity("Remotely.Shared.Models.SharedFile", b =>
{
b.Property<string>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("ContentType")

View File

@ -0,0 +1,857 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Remotely.Server.Data;
namespace Remotely.Server.Migrations.Sqlite
{
[DbContext(typeof(SqliteDbContext))]
[Migration("20210217033350_Remove 3rd Party Services")]
partial class Remove3rdPartyServices
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "5.0.2");
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("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");
});
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");
});
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");
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");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.Property<string>("LoginProvider")
.HasMaxLength(128)
.HasColumnType("TEXT");
b.Property<string>("ProviderKey")
.HasMaxLength(128)
.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");
});
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");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("TEXT");
b.Property<string>("LoginProvider")
.HasMaxLength(128)
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasMaxLength(128)
.HasColumnType("TEXT");
b.Property<string>("Value")
.HasColumnType("TEXT");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens");
});
modelBuilder.Entity("Remotely.Shared.Models.Alert", b =>
{
b.Property<string>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreatedOn")
.IsRequired()
.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.Property<string>("Token")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("OrganizationID");
b.HasIndex("Token");
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.CommandResult", b =>
{
b.Property<string>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CommandMode")
.HasColumnType("TEXT");
b.Property<string>("CommandResults")
.HasColumnType("TEXT");
b.Property<string>("CommandText")
.HasColumnType("TEXT");
b.Property<string>("OrganizationID")
.HasColumnType("TEXT");
b.Property<string>("PSCoreResults")
.HasColumnType("TEXT");
b.Property<string>("SenderConnectionID")
.HasColumnType("TEXT");
b.Property<string>("SenderUserID")
.HasColumnType("TEXT");
b.Property<string>("TargetDeviceIDs")
.HasColumnType("TEXT");
b.Property<string>("TimeStamp")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("OrganizationID");
b.ToTable("CommandResults");
});
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")
.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.Property<int>("WebRtcSetting")
.HasColumnType("INTEGER");
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.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<string>("DisplayName")
.HasMaxLength(100)
.HasColumnType("TEXT");
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("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.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.Organization", b =>
{
b.HasOne("Remotely.Shared.Models.BrandingInfo", "BrandingInfo")
.WithMany()
.HasForeignKey("BrandingInfoId");
b.Navigation("BrandingInfo");
});
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
}
}
}

View File

@ -0,0 +1,44 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Remotely.Server.Migrations.Sqlite
{
public partial class Remove3rdPartyServices : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "GithubUser",
table: "Organizations");
migrationBuilder.DropColumn(
name: "SponsorAmount",
table: "Organizations");
migrationBuilder.DropColumn(
name: "UnlockCode",
table: "Organizations");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "GithubUser",
table: "Organizations",
type: "TEXT",
nullable: true);
migrationBuilder.AddColumn<double>(
name: "SponsorAmount",
table: "Organizations",
type: "REAL",
nullable: false,
defaultValue: 0.0);
migrationBuilder.AddColumn<string>(
name: "UnlockCode",
table: "Organizations",
type: "TEXT",
nullable: true);
}
}
}

View File

@ -236,6 +236,7 @@ namespace Remotely.Server.Migrations.Sqlite
modelBuilder.Entity("Remotely.Shared.Models.Alert", b =>
{
b.Property<string>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreatedOn")
@ -268,6 +269,7 @@ namespace Remotely.Server.Migrations.Sqlite
modelBuilder.Entity("Remotely.Shared.Models.ApiToken", b =>
{
b.Property<string>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("LastUsed")
@ -298,6 +300,7 @@ namespace Remotely.Server.Migrations.Sqlite
modelBuilder.Entity("Remotely.Shared.Models.BrandingInfo", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<byte>("ButtonForegroundBlue")
@ -342,6 +345,7 @@ namespace Remotely.Server.Migrations.Sqlite
modelBuilder.Entity("Remotely.Shared.Models.CommandResult", b =>
{
b.Property<string>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CommandMode")
@ -473,6 +477,7 @@ namespace Remotely.Server.Migrations.Sqlite
modelBuilder.Entity("Remotely.Shared.Models.DeviceGroup", b =>
{
b.Property<string>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Name")
@ -492,6 +497,7 @@ namespace Remotely.Server.Migrations.Sqlite
modelBuilder.Entity("Remotely.Shared.Models.EventLog", b =>
{
b.Property<string>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<int>("EventType")
@ -523,6 +529,7 @@ namespace Remotely.Server.Migrations.Sqlite
modelBuilder.Entity("Remotely.Shared.Models.InviteLink", b =>
{
b.Property<string>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("DateSent")
@ -551,14 +558,12 @@ namespace Remotely.Server.Migrations.Sqlite
modelBuilder.Entity("Remotely.Shared.Models.Organization", b =>
{
b.Property<string>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("BrandingInfoId")
.HasColumnType("TEXT");
b.Property<string>("GithubUser")
.HasColumnType("TEXT");
b.Property<bool>("IsDefaultOrganization")
.HasColumnType("INTEGER");
@ -569,12 +574,6 @@ namespace Remotely.Server.Migrations.Sqlite
b.Property<string>("RelayCode")
.HasColumnType("TEXT");
b.Property<double>("SponsorAmount")
.HasColumnType("REAL");
b.Property<string>("UnlockCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("BrandingInfoId");
@ -585,6 +584,7 @@ namespace Remotely.Server.Migrations.Sqlite
modelBuilder.Entity("Remotely.Shared.Models.SharedFile", b =>
{
b.Property<string>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ContentType")

View File

@ -22,8 +22,6 @@ namespace Remotely.Shared.Models
public ICollection<EventLog> EventLogs { get; set; }
public string GithubUser { get; set; }
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public string ID { get; set; }