Switched to postgresql. Documented startup. Updated dbcontext register call. Added virtual plugin manifest loading

This commit is contained in:
2025-02-26 22:39:48 +01:00
parent a8d867c3c7
commit 8f1cc29b8d
20 changed files with 555 additions and 2437 deletions

View File

@@ -2,9 +2,9 @@
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using MoonlightServers.ApiServer.Database;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
@@ -17,32 +17,31 @@ namespace MoonlightServers.ApiServer.Database.Migrations
{
#pragma warning disable 612, 618
modelBuilder
.HasDefaultSchema("Servers")
.HasAnnotation("ProductVersion", "8.0.11")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
.HasAnnotation("Relational:MaxIdentifierLength", 63);
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("MoonlightServers.ApiServer.Database.Entities.Allocation", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
.HasColumnType("integer");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("IpAddress")
.IsRequired()
.HasColumnType("longtext");
.HasColumnType("text");
b.Property<int>("NodeId")
.HasColumnType("int");
.HasColumnType("integer");
b.Property<int>("Port")
.HasColumnType("int");
.HasColumnType("integer");
b.Property<int?>("ServerId")
.HasColumnType("int");
.HasColumnType("integer");
b.HasKey("Id");
@@ -50,90 +49,90 @@ namespace MoonlightServers.ApiServer.Database.Migrations
b.HasIndex("ServerId");
b.ToTable("Allocations", "Servers");
b.ToTable("Servers_Allocations", (string)null);
});
modelBuilder.Entity("MoonlightServers.ApiServer.Database.Entities.Node", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
.HasColumnType("integer");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<bool>("EnableDynamicFirewall")
.HasColumnType("tinyint(1)");
.HasColumnType("boolean");
b.Property<bool>("EnableTransparentMode")
.HasColumnType("tinyint(1)");
.HasColumnType("boolean");
b.Property<string>("Fqdn")
.IsRequired()
.HasColumnType("longtext");
.HasColumnType("text");
b.Property<int>("FtpPort")
.HasColumnType("int");
.HasColumnType("integer");
b.Property<int>("HttpPort")
.HasColumnType("int");
.HasColumnType("integer");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
.HasColumnType("text");
b.Property<string>("Token")
.IsRequired()
.HasColumnType("longtext");
.HasColumnType("text");
b.Property<bool>("UseSsl")
.HasColumnType("tinyint(1)");
.HasColumnType("boolean");
b.HasKey("Id");
b.ToTable("Nodes", "Servers");
b.ToTable("Servers_Nodes", (string)null);
});
modelBuilder.Entity("MoonlightServers.ApiServer.Database.Entities.Server", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
.HasColumnType("integer");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("Bandwidth")
.HasColumnType("int");
.HasColumnType("integer");
b.Property<int>("Cpu")
.HasColumnType("int");
.HasColumnType("integer");
b.Property<int>("Disk")
.HasColumnType("int");
.HasColumnType("integer");
b.Property<int>("DockerImageIndex")
.HasColumnType("int");
.HasColumnType("integer");
b.Property<int>("Memory")
.HasColumnType("int");
.HasColumnType("integer");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
.HasColumnType("text");
b.Property<int>("NodeId")
.HasColumnType("int");
.HasColumnType("integer");
b.Property<int>("OwnerId")
.HasColumnType("int");
.HasColumnType("integer");
b.Property<int>("StarId")
.HasColumnType("int");
.HasColumnType("integer");
b.Property<string>("StartupOverride")
.HasColumnType("longtext");
.HasColumnType("text");
b.Property<bool>("UseVirtualDisk")
.HasColumnType("tinyint(1)");
.HasColumnType("boolean");
b.HasKey("Id");
@@ -141,209 +140,209 @@ namespace MoonlightServers.ApiServer.Database.Migrations
b.HasIndex("StarId");
b.ToTable("Servers", "Servers");
b.ToTable("Servers_Servers", (string)null);
});
modelBuilder.Entity("MoonlightServers.ApiServer.Database.Entities.ServerBackup", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
.HasColumnType("integer");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<bool>("Completed")
.HasColumnType("tinyint(1)");
.HasColumnType("boolean");
b.Property<DateTime>("CompletedAt")
.HasColumnType("datetime(6)");
.HasColumnType("timestamp with time zone");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)");
.HasColumnType("timestamp with time zone");
b.Property<int?>("ServerId")
.HasColumnType("int");
.HasColumnType("integer");
b.Property<long>("Size")
.HasColumnType("bigint");
b.Property<bool>("Successful")
.HasColumnType("tinyint(1)");
.HasColumnType("boolean");
b.HasKey("Id");
b.HasIndex("ServerId");
b.ToTable("ServerBackups", "Servers");
b.ToTable("Servers_ServerBackups", (string)null);
});
modelBuilder.Entity("MoonlightServers.ApiServer.Database.Entities.ServerVariable", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
.HasColumnType("integer");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Key")
.IsRequired()
.HasColumnType("longtext");
.HasColumnType("text");
b.Property<int>("ServerId")
.HasColumnType("int");
.HasColumnType("integer");
b.Property<string>("Value")
.IsRequired()
.HasColumnType("longtext");
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("ServerId");
b.ToTable("ServerVariables", "Servers");
b.ToTable("Servers_ServerVariables", (string)null);
});
modelBuilder.Entity("MoonlightServers.ApiServer.Database.Entities.Star", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
.HasColumnType("integer");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<bool>("AllowDockerImageChange")
.HasColumnType("tinyint(1)");
.HasColumnType("boolean");
b.Property<string>("Author")
.IsRequired()
.HasColumnType("longtext");
.HasColumnType("text");
b.Property<int>("DefaultDockerImage")
.HasColumnType("int");
.HasColumnType("integer");
b.Property<string>("DonateUrl")
.HasColumnType("longtext");
.HasColumnType("text");
b.Property<string>("InstallDockerImage")
.IsRequired()
.HasColumnType("longtext");
.HasColumnType("text");
b.Property<string>("InstallScript")
.IsRequired()
.HasColumnType("longtext");
.HasColumnType("text");
b.Property<string>("InstallShell")
.IsRequired()
.HasColumnType("longtext");
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
.HasColumnType("text");
b.Property<string>("OnlineDetection")
.IsRequired()
.HasColumnType("longtext");
.HasColumnType("text");
b.Property<string>("ParseConfiguration")
.IsRequired()
.HasColumnType("longtext");
.HasColumnType("text");
b.Property<int>("RequiredAllocations")
.HasColumnType("int");
.HasColumnType("integer");
b.Property<string>("StartupCommand")
.IsRequired()
.HasColumnType("longtext");
.HasColumnType("text");
b.Property<string>("StopCommand")
.IsRequired()
.HasColumnType("longtext");
.HasColumnType("text");
b.Property<string>("UpdateUrl")
.HasColumnType("longtext");
.HasColumnType("text");
b.Property<string>("Version")
.IsRequired()
.HasColumnType("longtext");
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Stars", "Servers");
b.ToTable("Servers_Stars", (string)null);
});
modelBuilder.Entity("MoonlightServers.ApiServer.Database.Entities.StarDockerImage", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
.HasColumnType("integer");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<bool>("AutoPulling")
.HasColumnType("tinyint(1)");
.HasColumnType("boolean");
b.Property<string>("DisplayName")
.IsRequired()
.HasColumnType("longtext");
.HasColumnType("text");
b.Property<string>("Identifier")
.IsRequired()
.HasColumnType("longtext");
.HasColumnType("text");
b.Property<int>("StarId")
.HasColumnType("int");
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("StarId");
b.ToTable("StarDockerImages", "Servers");
b.ToTable("Servers_StarDockerImages", (string)null);
});
modelBuilder.Entity("MoonlightServers.ApiServer.Database.Entities.StarVariable", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
.HasColumnType("integer");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<bool>("AllowEditing")
.HasColumnType("tinyint(1)");
.HasColumnType("boolean");
b.Property<bool>("AllowViewing")
.HasColumnType("tinyint(1)");
.HasColumnType("boolean");
b.Property<string>("DefaultValue")
.IsRequired()
.HasColumnType("longtext");
.HasColumnType("text");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("longtext");
.HasColumnType("text");
b.Property<string>("Filter")
.HasColumnType("longtext");
.HasColumnType("text");
b.Property<string>("Key")
.IsRequired()
.HasColumnType("longtext");
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
.HasColumnType("text");
b.Property<int>("StarId")
.HasColumnType("int");
.HasColumnType("integer");
b.Property<int>("Type")
.HasColumnType("int");
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("StarId");
b.ToTable("StarVariables", "Servers");
b.ToTable("Servers_StarVariables", (string)null);
});
modelBuilder.Entity("MoonlightServers.ApiServer.Database.Entities.Allocation", b =>