//
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Moonlight.ApiServer.Database;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Moonlight.ApiServer.Database.Migrations
{
[DbContext(typeof(CoreDataContext))]
[Migration("20250919201409_RecreatedMigrationsForChangeOfSchema")]
partial class RecreatedMigrationsForChangeOfSchema
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasDefaultSchema("core")
.HasAnnotation("ProductVersion", "9.0.8")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireCounter", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("ExpireAt")
.HasColumnType("timestamp with time zone");
b.Property("Key")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property("Value")
.HasColumnType("bigint");
b.HasKey("Id");
b.HasIndex("ExpireAt");
b.HasIndex("Key", "Value");
b.ToTable("HangfireCounter", "core");
});
modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireHash", b =>
{
b.Property("Key")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property("Field")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property("ExpireAt")
.HasColumnType("timestamp with time zone");
b.Property("Value")
.HasColumnType("text");
b.HasKey("Key", "Field");
b.HasIndex("ExpireAt");
b.ToTable("HangfireHash", "core");
});
modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireJob", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property("ExpireAt")
.HasColumnType("timestamp with time zone");
b.Property("InvocationData")
.IsRequired()
.HasColumnType("text");
b.Property("StateId")
.HasColumnType("bigint");
b.Property("StateName")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.HasKey("Id");
b.HasIndex("ExpireAt");
b.HasIndex("StateId");
b.HasIndex("StateName");
b.ToTable("HangfireJob", "core");
});
modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireJobParameter", b =>
{
b.Property("JobId")
.HasColumnType("bigint");
b.Property("Name")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property("Value")
.HasColumnType("text");
b.HasKey("JobId", "Name");
b.ToTable("HangfireJobParameter", "core");
});
modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireList", b =>
{
b.Property("Key")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property("Position")
.HasColumnType("integer");
b.Property("ExpireAt")
.HasColumnType("timestamp with time zone");
b.Property("Value")
.HasColumnType("text");
b.HasKey("Key", "Position");
b.HasIndex("ExpireAt");
b.ToTable("HangfireList", "core");
});
modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireLock", b =>
{
b.Property("Id")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property("AcquiredAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.ToTable("HangfireLock", "core");
});
modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireQueuedJob", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("FetchedAt")
.IsConcurrencyToken()
.HasColumnType("timestamp with time zone");
b.Property("JobId")
.HasColumnType("bigint");
b.Property("Queue")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.HasKey("Id");
b.HasIndex("JobId");
b.HasIndex("Queue", "FetchedAt");
b.ToTable("HangfireQueuedJob", "core");
});
modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireServer", b =>
{
b.Property("Id")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property("Heartbeat")
.HasColumnType("timestamp with time zone");
b.Property("Queues")
.IsRequired()
.HasColumnType("text");
b.Property("StartedAt")
.HasColumnType("timestamp with time zone");
b.Property("WorkerCount")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("Heartbeat");
b.ToTable("HangfireServer", "core");
});
modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireSet", b =>
{
b.Property("Key")
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.Property("Value")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property("ExpireAt")
.HasColumnType("timestamp with time zone");
b.Property("Score")
.HasColumnType("double precision");
b.HasKey("Key", "Value");
b.HasIndex("ExpireAt");
b.HasIndex("Key", "Score");
b.ToTable("HangfireSet", "core");
});
modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireState", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property("Data")
.IsRequired()
.HasColumnType("text");
b.Property("JobId")
.HasColumnType("bigint");
b.Property("Name")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property("Reason")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("JobId");
b.ToTable("HangfireState", "core");
});
modelBuilder.Entity("Moonlight.ApiServer.Database.Entities.ApiKey", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property("Description")
.IsRequired()
.HasColumnType("text");
b.Property("ExpiresAt")
.HasColumnType("timestamp with time zone");
b.PrimitiveCollection("Permissions")
.IsRequired()
.HasColumnType("text[]");
b.HasKey("Id");
b.ToTable("ApiKeys", "core");
});
modelBuilder.Entity("Moonlight.ApiServer.Database.Entities.Theme", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("Author")
.IsRequired()
.HasColumnType("text");
b.Property("DonateUrl")
.HasColumnType("text");
b.Property("IsEnabled")
.HasColumnType("boolean");
b.Property("Name")
.IsRequired()
.HasColumnType("text");
b.Property("UpdateUrl")
.HasColumnType("text");
b.Property("Version")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Themes", "core");
});
modelBuilder.Entity("Moonlight.ApiServer.Database.Entities.User", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("Email")
.IsRequired()
.HasColumnType("text");
b.Property("Password")
.IsRequired()
.HasColumnType("text");
b.PrimitiveCollection("Permissions")
.IsRequired()
.HasColumnType("text[]");
b.Property("TokenValidTimestamp")
.HasColumnType("timestamp with time zone");
b.Property("Username")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Users", "core");
});
modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireJob", b =>
{
b.HasOne("Hangfire.EntityFrameworkCore.HangfireState", "State")
.WithMany()
.HasForeignKey("StateId");
b.Navigation("State");
});
modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireJobParameter", b =>
{
b.HasOne("Hangfire.EntityFrameworkCore.HangfireJob", "Job")
.WithMany("Parameters")
.HasForeignKey("JobId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Job");
});
modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireQueuedJob", b =>
{
b.HasOne("Hangfire.EntityFrameworkCore.HangfireJob", "Job")
.WithMany("QueuedJobs")
.HasForeignKey("JobId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Job");
});
modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireState", b =>
{
b.HasOne("Hangfire.EntityFrameworkCore.HangfireJob", "Job")
.WithMany("States")
.HasForeignKey("JobId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Job");
});
modelBuilder.Entity("Moonlight.ApiServer.Database.Entities.Theme", b =>
{
b.OwnsOne("Moonlight.ApiServer.Models.ApplicationTheme", "Content", b1 =>
{
b1.Property("ThemeId")
.HasColumnType("integer");
b1.Property("Border")
.HasColumnType("real");
b1.Property("ColorAccent")
.IsRequired()
.HasColumnType("text");
b1.Property("ColorAccentContent")
.IsRequired()
.HasColumnType("text");
b1.Property("ColorBackground")
.IsRequired()
.HasColumnType("text");
b1.Property("ColorBase100")
.IsRequired()
.HasColumnType("text");
b1.Property("ColorBase150")
.IsRequired()
.HasColumnType("text");
b1.Property("ColorBase200")
.IsRequired()
.HasColumnType("text");
b1.Property("ColorBase250")
.IsRequired()
.HasColumnType("text");
b1.Property("ColorBase300")
.IsRequired()
.HasColumnType("text");
b1.Property("ColorBaseContent")
.IsRequired()
.HasColumnType("text");
b1.Property("ColorError")
.IsRequired()
.HasColumnType("text");
b1.Property("ColorErrorContent")
.IsRequired()
.HasColumnType("text");
b1.Property("ColorInfo")
.IsRequired()
.HasColumnType("text");
b1.Property("ColorInfoContent")
.IsRequired()
.HasColumnType("text");
b1.Property("ColorNeutral")
.IsRequired()
.HasColumnType("text");
b1.Property("ColorNeutralContent")
.IsRequired()
.HasColumnType("text");
b1.Property("ColorPrimary")
.IsRequired()
.HasColumnType("text");
b1.Property("ColorPrimaryContent")
.IsRequired()
.HasColumnType("text");
b1.Property("ColorSecondary")
.IsRequired()
.HasColumnType("text");
b1.Property("ColorSecondaryContent")
.IsRequired()
.HasColumnType("text");
b1.Property("ColorSuccess")
.IsRequired()
.HasColumnType("text");
b1.Property("ColorSuccessContent")
.IsRequired()
.HasColumnType("text");
b1.Property("ColorWarning")
.IsRequired()
.HasColumnType("text");
b1.Property("ColorWarningContent")
.IsRequired()
.HasColumnType("text");
b1.Property("Depth")
.HasColumnType("integer");
b1.Property("Noise")
.HasColumnType("integer");
b1.Property("RadiusBox")
.HasColumnType("real");
b1.Property("RadiusField")
.HasColumnType("real");
b1.Property("RadiusSelector")
.HasColumnType("real");
b1.Property("SizeField")
.HasColumnType("real");
b1.Property("SizeSelector")
.HasColumnType("real");
b1.HasKey("ThemeId");
b1.ToTable("Themes", "core");
b1.ToJson("Content");
b1.WithOwner()
.HasForeignKey("ThemeId");
});
b.Navigation("Content")
.IsRequired();
});
modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireJob", b =>
{
b.Navigation("Parameters");
b.Navigation("QueuedJobs");
b.Navigation("States");
});
#pragma warning restore 612, 618
}
}
}