mirror of
https://github.com/chylex/Minecraft-Phantom-Panel.git
synced 2024-11-23 19:42:51 +01:00
354 lines
12 KiB
C#
354 lines
12 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using System.Text.Json;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
using Phantom.Controller.Database;
|
|
|
|
#nullable disable
|
|
|
|
namespace Phantom.Controller.Database.Postgres.Migrations
|
|
{
|
|
[DbContext(typeof(ApplicationDbContext))]
|
|
[Migration("20240407211636_UserAgentAccess")]
|
|
partial class UserAgentAccess
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "8.0.0")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
|
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("Phantom.Controller.Database.Entities.AgentEntity", b =>
|
|
{
|
|
b.Property<Guid>("AgentGuid")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("BuildVersion")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int>("MaxInstances")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<ushort>("MaxMemory")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int>("ProtocolVersion")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("AgentGuid");
|
|
|
|
b.ToTable("Agents", "agents");
|
|
});
|
|
|
|
modelBuilder.Entity("Phantom.Controller.Database.Entities.AuditLogEntity", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
|
|
b.Property<JsonDocument>("Data")
|
|
.HasColumnType("jsonb");
|
|
|
|
b.Property<string>("EventType")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("SubjectId")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("SubjectType")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<Guid?>("UserGuid")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTime>("UtcTime")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("UserGuid");
|
|
|
|
b.ToTable("AuditLog", "system");
|
|
});
|
|
|
|
modelBuilder.Entity("Phantom.Controller.Database.Entities.EventLogEntity", b =>
|
|
{
|
|
b.Property<Guid>("EventGuid")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid?>("AgentGuid")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<JsonDocument>("Data")
|
|
.HasColumnType("jsonb");
|
|
|
|
b.Property<string>("EventType")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("SubjectId")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("SubjectType")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<DateTime>("UtcTime")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.HasKey("EventGuid");
|
|
|
|
b.ToTable("EventLog", "system");
|
|
});
|
|
|
|
modelBuilder.Entity("Phantom.Controller.Database.Entities.InstanceEntity", b =>
|
|
{
|
|
b.Property<Guid>("InstanceGuid")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("AgentGuid")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("InstanceName")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<Guid>("JavaRuntimeGuid")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("JvmArguments")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<bool>("LaunchAutomatically")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<ushort>("MemoryAllocation")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("MinecraftServerKind")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("MinecraftVersion")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int>("RconPort")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("ServerPort")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("InstanceGuid");
|
|
|
|
b.ToTable("Instances", "agents");
|
|
});
|
|
|
|
modelBuilder.Entity("Phantom.Controller.Database.Entities.PermissionEntity", b =>
|
|
{
|
|
b.Property<string>("Id")
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("Permissions", "identity");
|
|
});
|
|
|
|
modelBuilder.Entity("Phantom.Controller.Database.Entities.RoleEntity", b =>
|
|
{
|
|
b.Property<Guid>("RoleGuid")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("RoleGuid");
|
|
|
|
b.ToTable("Roles", "identity");
|
|
});
|
|
|
|
modelBuilder.Entity("Phantom.Controller.Database.Entities.RolePermissionEntity", b =>
|
|
{
|
|
b.Property<Guid>("RoleGuid")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("PermissionId")
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("RoleGuid", "PermissionId");
|
|
|
|
b.HasIndex("PermissionId");
|
|
|
|
b.ToTable("RolePermissions", "identity");
|
|
});
|
|
|
|
modelBuilder.Entity("Phantom.Controller.Database.Entities.UserAgentAccessEntity", b =>
|
|
{
|
|
b.Property<Guid>("UserGuid")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("AgentGuid")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("UserGuid", "AgentGuid");
|
|
|
|
b.HasIndex("AgentGuid");
|
|
|
|
b.ToTable("UserAgentAccess", "identity");
|
|
});
|
|
|
|
modelBuilder.Entity("Phantom.Controller.Database.Entities.UserEntity", b =>
|
|
{
|
|
b.Property<Guid>("UserGuid")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("PasswordHash")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("UserGuid");
|
|
|
|
b.HasIndex("Name")
|
|
.IsUnique();
|
|
|
|
b.ToTable("Users", "identity");
|
|
});
|
|
|
|
modelBuilder.Entity("Phantom.Controller.Database.Entities.UserPermissionEntity", b =>
|
|
{
|
|
b.Property<Guid>("UserGuid")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("PermissionId")
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("UserGuid", "PermissionId");
|
|
|
|
b.HasIndex("PermissionId");
|
|
|
|
b.ToTable("UserPermissions", "identity");
|
|
});
|
|
|
|
modelBuilder.Entity("Phantom.Controller.Database.Entities.UserRoleEntity", b =>
|
|
{
|
|
b.Property<Guid>("UserGuid")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("RoleGuid")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("UserGuid", "RoleGuid");
|
|
|
|
b.HasIndex("RoleGuid");
|
|
|
|
b.ToTable("UserRoles", "identity");
|
|
});
|
|
|
|
modelBuilder.Entity("Phantom.Controller.Database.Entities.AuditLogEntity", b =>
|
|
{
|
|
b.HasOne("Phantom.Controller.Database.Entities.UserEntity", "User")
|
|
.WithMany()
|
|
.HasForeignKey("UserGuid")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("Phantom.Controller.Database.Entities.RolePermissionEntity", b =>
|
|
{
|
|
b.HasOne("Phantom.Controller.Database.Entities.PermissionEntity", null)
|
|
.WithMany()
|
|
.HasForeignKey("PermissionId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("Phantom.Controller.Database.Entities.RoleEntity", null)
|
|
.WithMany()
|
|
.HasForeignKey("RoleGuid")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("Phantom.Controller.Database.Entities.UserAgentAccessEntity", b =>
|
|
{
|
|
b.HasOne("Phantom.Controller.Database.Entities.AgentEntity", null)
|
|
.WithMany()
|
|
.HasForeignKey("AgentGuid")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("Phantom.Controller.Database.Entities.UserEntity", null)
|
|
.WithMany()
|
|
.HasForeignKey("UserGuid")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("Phantom.Controller.Database.Entities.UserPermissionEntity", b =>
|
|
{
|
|
b.HasOne("Phantom.Controller.Database.Entities.PermissionEntity", null)
|
|
.WithMany()
|
|
.HasForeignKey("PermissionId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("Phantom.Controller.Database.Entities.UserEntity", null)
|
|
.WithMany()
|
|
.HasForeignKey("UserGuid")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("Phantom.Controller.Database.Entities.UserRoleEntity", b =>
|
|
{
|
|
b.HasOne("Phantom.Controller.Database.Entities.RoleEntity", "Role")
|
|
.WithMany()
|
|
.HasForeignKey("RoleGuid")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("Phantom.Controller.Database.Entities.UserEntity", "User")
|
|
.WithMany()
|
|
.HasForeignKey("UserGuid")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Role");
|
|
|
|
b.Navigation("User");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|