Compare commits
1 Commits
64e4d7201e
...
v2.1_Repla
| Author | SHA1 | Date | |
|---|---|---|---|
| ab92edb008 |
@@ -1,5 +1,4 @@
|
|||||||
using Hangfire.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using MoonCore.Extended.SingleDb;
|
using MoonCore.Extended.SingleDb;
|
||||||
using Moonlight.ApiServer.Configuration;
|
using Moonlight.ApiServer.Configuration;
|
||||||
using Moonlight.ApiServer.Database.Entities;
|
using Moonlight.ApiServer.Database.Entities;
|
||||||
@@ -30,7 +29,6 @@ public class CoreDataContext : DatabaseContext
|
|||||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
base.OnModelCreating(modelBuilder);
|
base.OnModelCreating(modelBuilder);
|
||||||
modelBuilder.OnHangfireModelCreating();
|
|
||||||
|
|
||||||
modelBuilder.Ignore<ApplicationTheme>();
|
modelBuilder.Ignore<ApplicationTheme>();
|
||||||
modelBuilder.Entity<Theme>()
|
modelBuilder.Entity<Theme>()
|
||||||
|
|||||||
260
Moonlight.ApiServer/Database/Migrations/20250819195904_RemovedHangfire.Designer.cs
generated
Normal file
260
Moonlight.ApiServer/Database/Migrations/20250819195904_RemovedHangfire.Designer.cs
generated
Normal file
@@ -0,0 +1,260 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
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("20250819195904_RemovedHangfire")]
|
||||||
|
partial class RemovedHangfire
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "9.0.7")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||||
|
|
||||||
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("Moonlight.ApiServer.Database.Entities.ApiKey", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("CreatedAt")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("ExpiresAt")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.PrimitiveCollection<string[]>("Permissions")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text[]");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Core_ApiKeys", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Moonlight.ApiServer.Database.Entities.Theme", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Author")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("DonateUrl")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<bool>("IsEnabled")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("UpdateUrl")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Version")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Core_Themes", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Moonlight.ApiServer.Database.Entities.User", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Email")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Password")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.PrimitiveCollection<string[]>("Permissions")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text[]");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("TokenValidTimestamp")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("Username")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Core_Users", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Moonlight.ApiServer.Database.Entities.Theme", b =>
|
||||||
|
{
|
||||||
|
b.OwnsOne("Moonlight.ApiServer.Models.ApplicationTheme", "Content", b1 =>
|
||||||
|
{
|
||||||
|
b1.Property<int>("ThemeId")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b1.Property<float>("Border")
|
||||||
|
.HasColumnType("real");
|
||||||
|
|
||||||
|
b1.Property<string>("ColorAccent")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b1.Property<string>("ColorAccentContent")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b1.Property<string>("ColorBackground")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b1.Property<string>("ColorBase100")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b1.Property<string>("ColorBase150")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b1.Property<string>("ColorBase200")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b1.Property<string>("ColorBase250")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b1.Property<string>("ColorBase300")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b1.Property<string>("ColorBaseContent")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b1.Property<string>("ColorError")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b1.Property<string>("ColorErrorContent")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b1.Property<string>("ColorInfo")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b1.Property<string>("ColorInfoContent")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b1.Property<string>("ColorNeutral")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b1.Property<string>("ColorNeutralContent")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b1.Property<string>("ColorPrimary")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b1.Property<string>("ColorPrimaryContent")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b1.Property<string>("ColorSecondary")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b1.Property<string>("ColorSecondaryContent")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b1.Property<string>("ColorSuccess")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b1.Property<string>("ColorSuccessContent")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b1.Property<string>("ColorWarning")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b1.Property<string>("ColorWarningContent")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b1.Property<int>("Depth")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b1.Property<int>("Noise")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b1.Property<float>("RadiusBox")
|
||||||
|
.HasColumnType("real");
|
||||||
|
|
||||||
|
b1.Property<float>("RadiusField")
|
||||||
|
.HasColumnType("real");
|
||||||
|
|
||||||
|
b1.Property<float>("RadiusSelector")
|
||||||
|
.HasColumnType("real");
|
||||||
|
|
||||||
|
b1.Property<float>("SizeField")
|
||||||
|
.HasColumnType("real");
|
||||||
|
|
||||||
|
b1.Property<float>("SizeSelector")
|
||||||
|
.HasColumnType("real");
|
||||||
|
|
||||||
|
b1.HasKey("ThemeId");
|
||||||
|
|
||||||
|
b1.ToTable("Core_Themes");
|
||||||
|
|
||||||
|
b1.ToJson("Content");
|
||||||
|
|
||||||
|
b1.WithOwner()
|
||||||
|
.HasForeignKey("ThemeId");
|
||||||
|
});
|
||||||
|
|
||||||
|
b.Navigation("Content")
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,290 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace Moonlight.ApiServer.Database.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class RemovedHangfire : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_HangfireJob_HangfireState_StateId",
|
||||||
|
table: "HangfireJob");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "HangfireCounter");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "HangfireHash");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "HangfireJobParameter");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "HangfireList");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "HangfireLock");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "HangfireQueuedJob");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "HangfireServer");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "HangfireSet");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "HangfireState");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "HangfireJob");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "HangfireCounter",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<long>(type: "bigint", nullable: false)
|
||||||
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||||
|
ExpireAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
|
||||||
|
Key = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
||||||
|
Value = table.Column<long>(type: "bigint", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_HangfireCounter", x => x.Id);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "HangfireHash",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Key = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
||||||
|
Field = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
||||||
|
ExpireAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
|
||||||
|
Value = table.Column<string>(type: "text", nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_HangfireHash", x => new { x.Key, x.Field });
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "HangfireList",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Key = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
||||||
|
Position = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
ExpireAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
|
||||||
|
Value = table.Column<string>(type: "text", nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_HangfireList", x => new { x.Key, x.Position });
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "HangfireLock",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
||||||
|
AcquiredAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_HangfireLock", x => x.Id);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "HangfireServer",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
||||||
|
Heartbeat = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||||
|
Queues = table.Column<string>(type: "text", nullable: false),
|
||||||
|
StartedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||||
|
WorkerCount = table.Column<int>(type: "integer", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_HangfireServer", x => x.Id);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "HangfireSet",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Key = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: false),
|
||||||
|
Value = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
||||||
|
ExpireAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
|
||||||
|
Score = table.Column<double>(type: "double precision", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_HangfireSet", x => new { x.Key, x.Value });
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "HangfireJob",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<long>(type: "bigint", nullable: false)
|
||||||
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||||
|
StateId = table.Column<long>(type: "bigint", nullable: true),
|
||||||
|
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||||
|
ExpireAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
|
||||||
|
InvocationData = table.Column<string>(type: "text", nullable: false),
|
||||||
|
StateName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_HangfireJob", x => x.Id);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "HangfireJobParameter",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
JobId = table.Column<long>(type: "bigint", nullable: false),
|
||||||
|
Name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
||||||
|
Value = table.Column<string>(type: "text", nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_HangfireJobParameter", x => new { x.JobId, x.Name });
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_HangfireJobParameter_HangfireJob_JobId",
|
||||||
|
column: x => x.JobId,
|
||||||
|
principalTable: "HangfireJob",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "HangfireQueuedJob",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<long>(type: "bigint", nullable: false)
|
||||||
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||||
|
JobId = table.Column<long>(type: "bigint", nullable: false),
|
||||||
|
FetchedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
|
||||||
|
Queue = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_HangfireQueuedJob", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_HangfireQueuedJob_HangfireJob_JobId",
|
||||||
|
column: x => x.JobId,
|
||||||
|
principalTable: "HangfireJob",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "HangfireState",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<long>(type: "bigint", nullable: false)
|
||||||
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||||
|
JobId = table.Column<long>(type: "bigint", nullable: false),
|
||||||
|
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||||
|
Data = table.Column<string>(type: "text", nullable: false),
|
||||||
|
Name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
||||||
|
Reason = table.Column<string>(type: "text", nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_HangfireState", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_HangfireState_HangfireJob_JobId",
|
||||||
|
column: x => x.JobId,
|
||||||
|
principalTable: "HangfireJob",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_HangfireCounter_ExpireAt",
|
||||||
|
table: "HangfireCounter",
|
||||||
|
column: "ExpireAt");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_HangfireCounter_Key_Value",
|
||||||
|
table: "HangfireCounter",
|
||||||
|
columns: new[] { "Key", "Value" });
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_HangfireHash_ExpireAt",
|
||||||
|
table: "HangfireHash",
|
||||||
|
column: "ExpireAt");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_HangfireJob_ExpireAt",
|
||||||
|
table: "HangfireJob",
|
||||||
|
column: "ExpireAt");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_HangfireJob_StateId",
|
||||||
|
table: "HangfireJob",
|
||||||
|
column: "StateId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_HangfireJob_StateName",
|
||||||
|
table: "HangfireJob",
|
||||||
|
column: "StateName");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_HangfireList_ExpireAt",
|
||||||
|
table: "HangfireList",
|
||||||
|
column: "ExpireAt");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_HangfireQueuedJob_JobId",
|
||||||
|
table: "HangfireQueuedJob",
|
||||||
|
column: "JobId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_HangfireQueuedJob_Queue_FetchedAt",
|
||||||
|
table: "HangfireQueuedJob",
|
||||||
|
columns: new[] { "Queue", "FetchedAt" });
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_HangfireServer_Heartbeat",
|
||||||
|
table: "HangfireServer",
|
||||||
|
column: "Heartbeat");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_HangfireSet_ExpireAt",
|
||||||
|
table: "HangfireSet",
|
||||||
|
column: "ExpireAt");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_HangfireSet_Key_Score",
|
||||||
|
table: "HangfireSet",
|
||||||
|
columns: new[] { "Key", "Score" });
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_HangfireState_JobId",
|
||||||
|
table: "HangfireState",
|
||||||
|
column: "JobId");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HangfireJob_HangfireState_StateId",
|
||||||
|
table: "HangfireJob",
|
||||||
|
column: "StateId",
|
||||||
|
principalTable: "HangfireState",
|
||||||
|
principalColumn: "Id");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
222
Moonlight.ApiServer/Database/Migrations/20250819200221_AddedTickerQ.Designer.cs
generated
Normal file
222
Moonlight.ApiServer/Database/Migrations/20250819200221_AddedTickerQ.Designer.cs
generated
Normal file
@@ -0,0 +1,222 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
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(TickerDataContext))]
|
||||||
|
[Migration("20250819200221_AddedTickerQ")]
|
||||||
|
partial class AddedTickerQ
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "9.0.7")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||||
|
|
||||||
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("TickerQ.EntityFrameworkCore.Entities.CronTickerEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Expression")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Function")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("InitIdentifier")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<byte[]>("Request")
|
||||||
|
.HasColumnType("bytea");
|
||||||
|
|
||||||
|
b.Property<int>("Retries")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.PrimitiveCollection<int[]>("RetryIntervals")
|
||||||
|
.HasColumnType("integer[]");
|
||||||
|
|
||||||
|
b.Property<DateTime>("UpdatedAt")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("Expression")
|
||||||
|
.HasDatabaseName("IX_CronTickers_Expression");
|
||||||
|
|
||||||
|
b.ToTable("CronTickers", "ticker");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("TickerQ.EntityFrameworkCore.Entities.CronTickerOccurrenceEntity<TickerQ.EntityFrameworkCore.Entities.CronTickerEntity>", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<Guid>("CronTickerId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<long>("ElapsedTime")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<string>("Exception")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("ExecutedAt")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<DateTime>("ExecutionTime")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("LockHolder")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LockedAt")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<int>("RetryCount")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<int>("Status")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("CronTickerId")
|
||||||
|
.HasDatabaseName("IX_CronTickerOccurrence_CronTickerId");
|
||||||
|
|
||||||
|
b.HasIndex("ExecutionTime")
|
||||||
|
.HasDatabaseName("IX_CronTickerOccurrence_ExecutionTime");
|
||||||
|
|
||||||
|
b.HasIndex("CronTickerId", "ExecutionTime")
|
||||||
|
.IsUnique()
|
||||||
|
.HasDatabaseName("UQ_CronTickerId_ExecutionTime");
|
||||||
|
|
||||||
|
b.HasIndex("Status", "ExecutionTime")
|
||||||
|
.HasDatabaseName("IX_CronTickerOccurrence_Status_ExecutionTime");
|
||||||
|
|
||||||
|
b.ToTable("CronTickerOccurrences", "ticker");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("TickerQ.EntityFrameworkCore.Entities.TimeTickerEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<Guid?>("BatchParent")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<int?>("BatchRunCondition")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<long>("ElapsedTime")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<string>("Exception")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("ExecutedAt")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<DateTime>("ExecutionTime")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("Function")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("InitIdentifier")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("LockHolder")
|
||||||
|
.IsConcurrencyToken()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LockedAt")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<byte[]>("Request")
|
||||||
|
.HasColumnType("bytea");
|
||||||
|
|
||||||
|
b.Property<int>("Retries")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<int>("RetryCount")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.PrimitiveCollection<int[]>("RetryIntervals")
|
||||||
|
.HasColumnType("integer[]");
|
||||||
|
|
||||||
|
b.Property<int>("Status")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<DateTime>("UpdatedAt")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("BatchParent");
|
||||||
|
|
||||||
|
b.HasIndex("ExecutionTime")
|
||||||
|
.HasDatabaseName("IX_TimeTicker_ExecutionTime");
|
||||||
|
|
||||||
|
b.HasIndex("Status", "ExecutionTime")
|
||||||
|
.HasDatabaseName("IX_TimeTicker_Status_ExecutionTime");
|
||||||
|
|
||||||
|
b.ToTable("TimeTickers", "ticker");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("TickerQ.EntityFrameworkCore.Entities.CronTickerOccurrenceEntity<TickerQ.EntityFrameworkCore.Entities.CronTickerEntity>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("TickerQ.EntityFrameworkCore.Entities.CronTickerEntity", "CronTicker")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("CronTickerId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("CronTicker");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("TickerQ.EntityFrameworkCore.Entities.TimeTickerEntity", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("TickerQ.EntityFrameworkCore.Entities.TimeTickerEntity", "ParentJob")
|
||||||
|
.WithMany("ChildJobs")
|
||||||
|
.HasForeignKey("BatchParent")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict);
|
||||||
|
|
||||||
|
b.Navigation("ParentJob");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("TickerQ.EntityFrameworkCore.Entities.TimeTickerEntity", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("ChildJobs");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,169 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace Moonlight.ApiServer.Database.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class AddedTickerQ : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.EnsureSchema(
|
||||||
|
name: "ticker");
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "CronTickers",
|
||||||
|
schema: "ticker",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
Expression = table.Column<string>(type: "text", nullable: true),
|
||||||
|
Request = table.Column<byte[]>(type: "bytea", nullable: true),
|
||||||
|
Retries = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
RetryIntervals = table.Column<int[]>(type: "integer[]", nullable: true),
|
||||||
|
Function = table.Column<string>(type: "text", nullable: true),
|
||||||
|
Description = table.Column<string>(type: "text", nullable: true),
|
||||||
|
InitIdentifier = table.Column<string>(type: "text", nullable: true),
|
||||||
|
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||||
|
UpdatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_CronTickers", x => x.Id);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "TimeTickers",
|
||||||
|
schema: "ticker",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
Status = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
LockHolder = table.Column<string>(type: "text", nullable: true),
|
||||||
|
Request = table.Column<byte[]>(type: "bytea", nullable: true),
|
||||||
|
ExecutionTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||||
|
LockedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
|
||||||
|
ExecutedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
|
||||||
|
Exception = table.Column<string>(type: "text", nullable: true),
|
||||||
|
ElapsedTime = table.Column<long>(type: "bigint", nullable: false),
|
||||||
|
Retries = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
RetryCount = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
RetryIntervals = table.Column<int[]>(type: "integer[]", nullable: true),
|
||||||
|
BatchParent = table.Column<Guid>(type: "uuid", nullable: true),
|
||||||
|
BatchRunCondition = table.Column<int>(type: "integer", nullable: true),
|
||||||
|
Function = table.Column<string>(type: "text", nullable: true),
|
||||||
|
Description = table.Column<string>(type: "text", nullable: true),
|
||||||
|
InitIdentifier = table.Column<string>(type: "text", nullable: true),
|
||||||
|
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||||
|
UpdatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_TimeTickers", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_TimeTickers_TimeTickers_BatchParent",
|
||||||
|
column: x => x.BatchParent,
|
||||||
|
principalSchema: "ticker",
|
||||||
|
principalTable: "TimeTickers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "CronTickerOccurrences",
|
||||||
|
schema: "ticker",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
Status = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
LockHolder = table.Column<string>(type: "text", nullable: true),
|
||||||
|
ExecutionTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||||
|
CronTickerId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
LockedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
|
||||||
|
ExecutedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
|
||||||
|
Exception = table.Column<string>(type: "text", nullable: true),
|
||||||
|
ElapsedTime = table.Column<long>(type: "bigint", nullable: false),
|
||||||
|
RetryCount = table.Column<int>(type: "integer", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_CronTickerOccurrences", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_CronTickerOccurrences_CronTickers_CronTickerId",
|
||||||
|
column: x => x.CronTickerId,
|
||||||
|
principalSchema: "ticker",
|
||||||
|
principalTable: "CronTickers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_CronTickerOccurrence_CronTickerId",
|
||||||
|
schema: "ticker",
|
||||||
|
table: "CronTickerOccurrences",
|
||||||
|
column: "CronTickerId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_CronTickerOccurrence_ExecutionTime",
|
||||||
|
schema: "ticker",
|
||||||
|
table: "CronTickerOccurrences",
|
||||||
|
column: "ExecutionTime");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_CronTickerOccurrence_Status_ExecutionTime",
|
||||||
|
schema: "ticker",
|
||||||
|
table: "CronTickerOccurrences",
|
||||||
|
columns: new[] { "Status", "ExecutionTime" });
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "UQ_CronTickerId_ExecutionTime",
|
||||||
|
schema: "ticker",
|
||||||
|
table: "CronTickerOccurrences",
|
||||||
|
columns: new[] { "CronTickerId", "ExecutionTime" },
|
||||||
|
unique: true);
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_CronTickers_Expression",
|
||||||
|
schema: "ticker",
|
||||||
|
table: "CronTickers",
|
||||||
|
column: "Expression");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_TimeTicker_ExecutionTime",
|
||||||
|
schema: "ticker",
|
||||||
|
table: "TimeTickers",
|
||||||
|
column: "ExecutionTime");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_TimeTicker_Status_ExecutionTime",
|
||||||
|
schema: "ticker",
|
||||||
|
table: "TimeTickers",
|
||||||
|
columns: new[] { "Status", "ExecutionTime" });
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_TimeTickers_BatchParent",
|
||||||
|
schema: "ticker",
|
||||||
|
table: "TimeTickers",
|
||||||
|
column: "BatchParent");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "CronTickerOccurrences",
|
||||||
|
schema: "ticker");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "TimeTickers",
|
||||||
|
schema: "ticker");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "CronTickers",
|
||||||
|
schema: "ticker");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -22,259 +22,6 @@ namespace Moonlight.ApiServer.Database.Migrations
|
|||||||
|
|
||||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||||
|
|
||||||
modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireCounter", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime?>("ExpireAt")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Key")
|
|
||||||
.IsRequired()
|
|
||||||
.HasMaxLength(256)
|
|
||||||
.HasColumnType("character varying(256)");
|
|
||||||
|
|
||||||
b.Property<long>("Value")
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("ExpireAt");
|
|
||||||
|
|
||||||
b.HasIndex("Key", "Value");
|
|
||||||
|
|
||||||
b.ToTable("HangfireCounter");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireHash", b =>
|
|
||||||
{
|
|
||||||
b.Property<string>("Key")
|
|
||||||
.HasMaxLength(256)
|
|
||||||
.HasColumnType("character varying(256)");
|
|
||||||
|
|
||||||
b.Property<string>("Field")
|
|
||||||
.HasMaxLength(256)
|
|
||||||
.HasColumnType("character varying(256)");
|
|
||||||
|
|
||||||
b.Property<DateTime?>("ExpireAt")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Value")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Key", "Field");
|
|
||||||
|
|
||||||
b.HasIndex("ExpireAt");
|
|
||||||
|
|
||||||
b.ToTable("HangfireHash");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireJob", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedAt")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<DateTime?>("ExpireAt")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("InvocationData")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<long?>("StateId")
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
b.Property<string>("StateName")
|
|
||||||
.HasMaxLength(256)
|
|
||||||
.HasColumnType("character varying(256)");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("ExpireAt");
|
|
||||||
|
|
||||||
b.HasIndex("StateId");
|
|
||||||
|
|
||||||
b.HasIndex("StateName");
|
|
||||||
|
|
||||||
b.ToTable("HangfireJob");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireJobParameter", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("JobId")
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.HasMaxLength(256)
|
|
||||||
.HasColumnType("character varying(256)");
|
|
||||||
|
|
||||||
b.Property<string>("Value")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("JobId", "Name");
|
|
||||||
|
|
||||||
b.ToTable("HangfireJobParameter");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireList", b =>
|
|
||||||
{
|
|
||||||
b.Property<string>("Key")
|
|
||||||
.HasMaxLength(256)
|
|
||||||
.HasColumnType("character varying(256)");
|
|
||||||
|
|
||||||
b.Property<int>("Position")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<DateTime?>("ExpireAt")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Value")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Key", "Position");
|
|
||||||
|
|
||||||
b.HasIndex("ExpireAt");
|
|
||||||
|
|
||||||
b.ToTable("HangfireList");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireLock", b =>
|
|
||||||
{
|
|
||||||
b.Property<string>("Id")
|
|
||||||
.HasMaxLength(256)
|
|
||||||
.HasColumnType("character varying(256)");
|
|
||||||
|
|
||||||
b.Property<DateTime>("AcquiredAt")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("HangfireLock");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireQueuedJob", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime?>("FetchedAt")
|
|
||||||
.IsConcurrencyToken()
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<long>("JobId")
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
b.Property<string>("Queue")
|
|
||||||
.IsRequired()
|
|
||||||
.HasMaxLength(256)
|
|
||||||
.HasColumnType("character varying(256)");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("JobId");
|
|
||||||
|
|
||||||
b.HasIndex("Queue", "FetchedAt");
|
|
||||||
|
|
||||||
b.ToTable("HangfireQueuedJob");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireServer", b =>
|
|
||||||
{
|
|
||||||
b.Property<string>("Id")
|
|
||||||
.HasMaxLength(256)
|
|
||||||
.HasColumnType("character varying(256)");
|
|
||||||
|
|
||||||
b.Property<DateTime>("Heartbeat")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Queues")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<DateTime>("StartedAt")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<int>("WorkerCount")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("Heartbeat");
|
|
||||||
|
|
||||||
b.ToTable("HangfireServer");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireSet", b =>
|
|
||||||
{
|
|
||||||
b.Property<string>("Key")
|
|
||||||
.HasMaxLength(100)
|
|
||||||
.HasColumnType("character varying(100)");
|
|
||||||
|
|
||||||
b.Property<string>("Value")
|
|
||||||
.HasMaxLength(256)
|
|
||||||
.HasColumnType("character varying(256)");
|
|
||||||
|
|
||||||
b.Property<DateTime?>("ExpireAt")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<double>("Score")
|
|
||||||
.HasColumnType("double precision");
|
|
||||||
|
|
||||||
b.HasKey("Key", "Value");
|
|
||||||
|
|
||||||
b.HasIndex("ExpireAt");
|
|
||||||
|
|
||||||
b.HasIndex("Key", "Score");
|
|
||||||
|
|
||||||
b.ToTable("HangfireSet");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireState", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedAt")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Data")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<long>("JobId")
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasMaxLength(256)
|
|
||||||
.HasColumnType("character varying(256)");
|
|
||||||
|
|
||||||
b.Property<string>("Reason")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("JobId");
|
|
||||||
|
|
||||||
b.ToTable("HangfireState");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Moonlight.ApiServer.Database.Entities.ApiKey", b =>
|
modelBuilder.Entity("Moonlight.ApiServer.Database.Entities.ApiKey", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("Id")
|
b.Property<int>("Id")
|
||||||
@@ -368,48 +115,6 @@ namespace Moonlight.ApiServer.Database.Migrations
|
|||||||
b.ToTable("Core_Users", (string)null);
|
b.ToTable("Core_Users", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
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 =>
|
modelBuilder.Entity("Moonlight.ApiServer.Database.Entities.Theme", b =>
|
||||||
{
|
{
|
||||||
b.OwnsOne("Moonlight.ApiServer.Models.ApplicationTheme", "Content", b1 =>
|
b.OwnsOne("Moonlight.ApiServer.Models.ApplicationTheme", "Content", b1 =>
|
||||||
@@ -512,11 +217,11 @@ namespace Moonlight.ApiServer.Database.Migrations
|
|||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b1.Property<float>("Depth")
|
b1.Property<int>("Depth")
|
||||||
.HasColumnType("real");
|
.HasColumnType("integer");
|
||||||
|
|
||||||
b1.Property<float>("Noise")
|
b1.Property<int>("Noise")
|
||||||
.HasColumnType("real");
|
.HasColumnType("integer");
|
||||||
|
|
||||||
b1.Property<float>("RadiusBox")
|
b1.Property<float>("RadiusBox")
|
||||||
.HasColumnType("real");
|
.HasColumnType("real");
|
||||||
@@ -546,15 +251,6 @@ namespace Moonlight.ApiServer.Database.Migrations
|
|||||||
b.Navigation("Content")
|
b.Navigation("Content")
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireJob", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Parameters");
|
|
||||||
|
|
||||||
b.Navigation("QueuedJobs");
|
|
||||||
|
|
||||||
b.Navigation("States");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
#pragma warning restore 612, 618
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,219 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
using Moonlight.ApiServer.Database;
|
||||||
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace Moonlight.ApiServer.Database.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(TickerDataContext))]
|
||||||
|
partial class TickerDataContextModelSnapshot : ModelSnapshot
|
||||||
|
{
|
||||||
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "9.0.7")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||||
|
|
||||||
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("TickerQ.EntityFrameworkCore.Entities.CronTickerEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Expression")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Function")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("InitIdentifier")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<byte[]>("Request")
|
||||||
|
.HasColumnType("bytea");
|
||||||
|
|
||||||
|
b.Property<int>("Retries")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.PrimitiveCollection<int[]>("RetryIntervals")
|
||||||
|
.HasColumnType("integer[]");
|
||||||
|
|
||||||
|
b.Property<DateTime>("UpdatedAt")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("Expression")
|
||||||
|
.HasDatabaseName("IX_CronTickers_Expression");
|
||||||
|
|
||||||
|
b.ToTable("CronTickers", "ticker");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("TickerQ.EntityFrameworkCore.Entities.CronTickerOccurrenceEntity<TickerQ.EntityFrameworkCore.Entities.CronTickerEntity>", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<Guid>("CronTickerId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<long>("ElapsedTime")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<string>("Exception")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("ExecutedAt")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<DateTime>("ExecutionTime")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("LockHolder")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LockedAt")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<int>("RetryCount")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<int>("Status")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("CronTickerId")
|
||||||
|
.HasDatabaseName("IX_CronTickerOccurrence_CronTickerId");
|
||||||
|
|
||||||
|
b.HasIndex("ExecutionTime")
|
||||||
|
.HasDatabaseName("IX_CronTickerOccurrence_ExecutionTime");
|
||||||
|
|
||||||
|
b.HasIndex("CronTickerId", "ExecutionTime")
|
||||||
|
.IsUnique()
|
||||||
|
.HasDatabaseName("UQ_CronTickerId_ExecutionTime");
|
||||||
|
|
||||||
|
b.HasIndex("Status", "ExecutionTime")
|
||||||
|
.HasDatabaseName("IX_CronTickerOccurrence_Status_ExecutionTime");
|
||||||
|
|
||||||
|
b.ToTable("CronTickerOccurrences", "ticker");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("TickerQ.EntityFrameworkCore.Entities.TimeTickerEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<Guid?>("BatchParent")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<int?>("BatchRunCondition")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<long>("ElapsedTime")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<string>("Exception")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("ExecutedAt")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<DateTime>("ExecutionTime")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("Function")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("InitIdentifier")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("LockHolder")
|
||||||
|
.IsConcurrencyToken()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LockedAt")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<byte[]>("Request")
|
||||||
|
.HasColumnType("bytea");
|
||||||
|
|
||||||
|
b.Property<int>("Retries")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<int>("RetryCount")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.PrimitiveCollection<int[]>("RetryIntervals")
|
||||||
|
.HasColumnType("integer[]");
|
||||||
|
|
||||||
|
b.Property<int>("Status")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<DateTime>("UpdatedAt")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("BatchParent");
|
||||||
|
|
||||||
|
b.HasIndex("ExecutionTime")
|
||||||
|
.HasDatabaseName("IX_TimeTicker_ExecutionTime");
|
||||||
|
|
||||||
|
b.HasIndex("Status", "ExecutionTime")
|
||||||
|
.HasDatabaseName("IX_TimeTicker_Status_ExecutionTime");
|
||||||
|
|
||||||
|
b.ToTable("TimeTickers", "ticker");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("TickerQ.EntityFrameworkCore.Entities.CronTickerOccurrenceEntity<TickerQ.EntityFrameworkCore.Entities.CronTickerEntity>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("TickerQ.EntityFrameworkCore.Entities.CronTickerEntity", "CronTicker")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("CronTickerId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("CronTicker");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("TickerQ.EntityFrameworkCore.Entities.TimeTickerEntity", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("TickerQ.EntityFrameworkCore.Entities.TimeTickerEntity", "ParentJob")
|
||||||
|
.WithMany("ChildJobs")
|
||||||
|
.HasForeignKey("BatchParent")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict);
|
||||||
|
|
||||||
|
b.Navigation("ParentJob");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("TickerQ.EntityFrameworkCore.Entities.TimeTickerEntity", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("ChildJobs");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
31
Moonlight.ApiServer/Database/TickerDataContext.cs
Normal file
31
Moonlight.ApiServer/Database/TickerDataContext.cs
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using MoonCore.Extended.SingleDb;
|
||||||
|
using Moonlight.ApiServer.Configuration;
|
||||||
|
using TickerQ.EntityFrameworkCore.Configurations;
|
||||||
|
|
||||||
|
namespace Moonlight.ApiServer.Database;
|
||||||
|
|
||||||
|
public class TickerDataContext : DatabaseContext
|
||||||
|
{
|
||||||
|
public override string Prefix => "Ticker";
|
||||||
|
|
||||||
|
public TickerDataContext(AppConfiguration configuration)
|
||||||
|
{
|
||||||
|
Options = new()
|
||||||
|
{
|
||||||
|
Host = configuration.Database.Host,
|
||||||
|
Port = configuration.Database.Port,
|
||||||
|
Username = configuration.Database.Username,
|
||||||
|
Password = configuration.Database.Password,
|
||||||
|
Database = configuration.Database.Database
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
// Apply TickerQ entity configurations explicitly
|
||||||
|
modelBuilder.ApplyConfiguration(new TimeTickerConfigurations());
|
||||||
|
modelBuilder.ApplyConfiguration(new CronTickerConfigurations());
|
||||||
|
modelBuilder.ApplyConfiguration(new CronTickerOccurrenceConfigurations());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
using Hangfire;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using Moonlight.Shared.Http.Responses.Admin.Hangfire;
|
|
||||||
|
|
||||||
namespace Moonlight.ApiServer.Http.Controllers.Admin.Sys;
|
|
||||||
|
|
||||||
[ApiController]
|
|
||||||
[Route("api/admin/system/hangfire")]
|
|
||||||
[Authorize(Policy = "permissions:admin.system.hangfire")]
|
|
||||||
public class HangfireController : Controller
|
|
||||||
{
|
|
||||||
private readonly JobStorage JobStorage;
|
|
||||||
|
|
||||||
public HangfireController(JobStorage jobStorage)
|
|
||||||
{
|
|
||||||
JobStorage = jobStorage;
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet("stats")]
|
|
||||||
public Task<HangfireStatsResponse> GetStats()
|
|
||||||
{
|
|
||||||
var statistics = JobStorage.GetMonitoringApi().GetStatistics();
|
|
||||||
|
|
||||||
return Task.FromResult(new HangfireStatsResponse()
|
|
||||||
{
|
|
||||||
Awaiting = statistics.Awaiting,
|
|
||||||
Deleted = statistics.Deleted,
|
|
||||||
Enqueued = statistics.Enqueued,
|
|
||||||
Failed = statistics.Failed,
|
|
||||||
Processing = statistics.Processing,
|
|
||||||
Queues = statistics.Queues,
|
|
||||||
Recurring = statistics.Recurring,
|
|
||||||
Retries = statistics.Retries,
|
|
||||||
Scheduled = statistics.Scheduled,
|
|
||||||
Servers = statistics.Servers,
|
|
||||||
Succeeded = statistics.Succeeded
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using TickerQ.Utilities.Enums;
|
||||||
|
using TickerQ.Utilities.Interfaces;
|
||||||
|
|
||||||
|
namespace Moonlight.ApiServer.Implementations;
|
||||||
|
|
||||||
|
public class TickerExceptionHandler : ITickerExceptionHandler
|
||||||
|
{
|
||||||
|
private readonly ILogger<TickerExceptionHandler> Logger;
|
||||||
|
|
||||||
|
public TickerExceptionHandler(ILogger<TickerExceptionHandler> logger)
|
||||||
|
{
|
||||||
|
Logger = logger;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task HandleExceptionAsync(Exception exception, Guid tickerId, TickerType tickerType)
|
||||||
|
{
|
||||||
|
Logger.LogError(exception, "An unhandled error occured while running ticker {id} ({type})", tickerId, tickerType);
|
||||||
|
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task HandleCanceledExceptionAsync(Exception exception, Guid tickerId, TickerType tickerType)
|
||||||
|
{
|
||||||
|
Logger.LogError(exception, "An unhandled error occured while handling canceled ticker {id} ({type})", tickerId, tickerType);
|
||||||
|
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -23,9 +23,6 @@
|
|||||||
<IsPackable>true</IsPackable>
|
<IsPackable>true</IsPackable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Hangfire.AspNetCore" Version="1.8.20" />
|
|
||||||
<PackageReference Include="Hangfire.Core" Version="1.8.20" />
|
|
||||||
<PackageReference Include="Hangfire.EntityFrameworkCore" Version="0.7.0" />
|
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.7" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.7" />
|
||||||
<PackageReference Include="MoonCore" Version="1.9.2" />
|
<PackageReference Include="MoonCore" Version="1.9.2" />
|
||||||
<PackageReference Include="MoonCore.Extended" Version="1.3.5" />
|
<PackageReference Include="MoonCore.Extended" Version="1.3.5" />
|
||||||
@@ -37,6 +34,8 @@
|
|||||||
<PackageReference Include="SharpZipLib" Version="1.4.2" />
|
<PackageReference Include="SharpZipLib" Version="1.4.2" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="8.1.2" />
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="8.1.2" />
|
||||||
<PackageReference Include="Ben.Demystifier" Version="0.4.1" />
|
<PackageReference Include="Ben.Demystifier" Version="0.4.1" />
|
||||||
|
<PackageReference Include="TickerQ" Version="2.4.4" />
|
||||||
|
<PackageReference Include="TickerQ.EntityFrameworkCore" Version="2.4.4" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Remove="storage\**\*" />
|
<Compile Remove="storage\**\*" />
|
||||||
|
|||||||
@@ -1,48 +0,0 @@
|
|||||||
using Hangfire;
|
|
||||||
using Hangfire.EntityFrameworkCore;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
using Microsoft.Extensions.Hosting;
|
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using Moonlight.ApiServer.Database;
|
|
||||||
|
|
||||||
namespace Moonlight.ApiServer.Startup;
|
|
||||||
|
|
||||||
public partial class Startup
|
|
||||||
{
|
|
||||||
private Task RegisterHangfire()
|
|
||||||
{
|
|
||||||
WebApplicationBuilder.Services.AddHangfire((provider, configuration) =>
|
|
||||||
{
|
|
||||||
configuration.SetDataCompatibilityLevel(CompatibilityLevel.Version_180);
|
|
||||||
configuration.UseSimpleAssemblyNameTypeSerializer();
|
|
||||||
configuration.UseRecommendedSerializerSettings();
|
|
||||||
configuration.UseEFCoreStorage(() =>
|
|
||||||
{
|
|
||||||
var scope = provider.CreateScope();
|
|
||||||
return scope.ServiceProvider.GetRequiredService<CoreDataContext>();
|
|
||||||
}, new EFCoreStorageOptions());
|
|
||||||
});
|
|
||||||
|
|
||||||
WebApplicationBuilder.Services.AddHangfireServer();
|
|
||||||
|
|
||||||
WebApplicationBuilder.Logging.AddFilter(
|
|
||||||
"Hangfire.Server.BackgroundServerProcess",
|
|
||||||
LogLevel.Warning
|
|
||||||
);
|
|
||||||
|
|
||||||
WebApplicationBuilder.Logging.AddFilter(
|
|
||||||
"Hangfire.BackgroundJobServer",
|
|
||||||
LogLevel.Warning
|
|
||||||
);
|
|
||||||
|
|
||||||
return Task.CompletedTask;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Task UseHangfire()
|
|
||||||
{
|
|
||||||
if (WebApplication.Environment.IsDevelopment())
|
|
||||||
WebApplication.UseHangfireDashboard();
|
|
||||||
|
|
||||||
return Task.CompletedTask;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
34
Moonlight.ApiServer/Startup/Startup.TickerQ.cs
Normal file
34
Moonlight.ApiServer/Startup/Startup.TickerQ.cs
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using Moonlight.ApiServer.Database;
|
||||||
|
using Moonlight.ApiServer.Implementations;
|
||||||
|
using TickerQ.DependencyInjection;
|
||||||
|
using TickerQ.EntityFrameworkCore.DependencyInjection;
|
||||||
|
|
||||||
|
namespace Moonlight.ApiServer.Startup;
|
||||||
|
|
||||||
|
public partial class Startup
|
||||||
|
{
|
||||||
|
private Task RegisterTickerQ()
|
||||||
|
{
|
||||||
|
WebApplicationBuilder.Services.AddTickerQ(builder =>
|
||||||
|
{
|
||||||
|
builder.SetExceptionHandler<TickerExceptionHandler>();
|
||||||
|
|
||||||
|
builder.AddOperationalStore<TickerDataContext>(optionBuilder =>
|
||||||
|
{
|
||||||
|
optionBuilder.CancelMissedTickersOnApplicationRestart();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
WebApplicationBuilder.Services.AddDbContext<TickerDataContext>();
|
||||||
|
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Task UseTickerQ()
|
||||||
|
{
|
||||||
|
WebApplication.UseTickerQ();
|
||||||
|
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -45,7 +45,7 @@ public partial class Startup
|
|||||||
await RegisterDatabase();
|
await RegisterDatabase();
|
||||||
await RegisterAuth();
|
await RegisterAuth();
|
||||||
await RegisterCors();
|
await RegisterCors();
|
||||||
await RegisterHangfire();
|
await RegisterTickerQ();
|
||||||
await HookPluginBuild();
|
await HookPluginBuild();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ public partial class Startup
|
|||||||
await UseCors();
|
await UseCors();
|
||||||
await UseBase();
|
await UseBase();
|
||||||
await UseAuth();
|
await UseAuth();
|
||||||
await UseHangfire();
|
await UseTickerQ();
|
||||||
await HookPluginConfigure();
|
await HookPluginConfigure();
|
||||||
|
|
||||||
await MapBase();
|
await MapBase();
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
<div class="alert alert-soft alert-primary border-2 flex items-center p-2.5" role="alert">
|
|
||||||
<div class="avatar me-2">
|
|
||||||
<div class="size-7 rounded-full">
|
|
||||||
<img src="/_content/Moonlight.Client/img/ghost.png" alt="avatar" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="text-primary-content">
|
|
||||||
@ChildContent
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@code
|
|
||||||
{
|
|
||||||
[Parameter] public RenderFragment ChildContent { get; set; }
|
|
||||||
}
|
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
@inject DownloadService DownloadService
|
@inject DownloadService DownloadService
|
||||||
|
|
||||||
<div class="mb-5">
|
<div class="mb-5">
|
||||||
<NavTabs Index="4" Names="UiConstants.AdminNavNames" Links="UiConstants.AdminNavLinks" />
|
<NavTabs Index="3" Names="UiConstants.AdminNavNames" Links="UiConstants.AdminNavLinks" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="grid grid-cols-2">
|
<div class="grid grid-cols-2">
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
@inject DownloadService DownloadService
|
@inject DownloadService DownloadService
|
||||||
|
|
||||||
<div class="mb-5">
|
<div class="mb-5">
|
||||||
<NavTabs Index="5" Names="UiConstants.AdminNavNames" Links="UiConstants.AdminNavLinks"/>
|
<NavTabs Index="4" Names="UiConstants.AdminNavNames" Links="UiConstants.AdminNavLinks"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="grid grid-cols-2">
|
<div class="grid grid-cols-2">
|
||||||
|
|||||||
@@ -1,48 +0,0 @@
|
|||||||
@page "/admin/system/hangfire"
|
|
||||||
|
|
||||||
@using Microsoft.AspNetCore.Authorization
|
|
||||||
@using MoonCore.Helpers
|
|
||||||
@using Moonlight.Shared.Http.Responses.Admin.Hangfire
|
|
||||||
@using Moonlight.Client.UI.Components
|
|
||||||
|
|
||||||
@attribute [Authorize(Policy = "permissions:admin.system.hangfire")]
|
|
||||||
|
|
||||||
@inject HttpApiClient ApiClient
|
|
||||||
|
|
||||||
<div class="mb-5">
|
|
||||||
<NavTabs Index="3" Names="UiConstants.AdminNavNames" Links="UiConstants.AdminNavLinks"/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mb-5">
|
|
||||||
<HelperMessage>
|
|
||||||
Hangfire is used to run scheduled and repeating tasks scalable via multiple instances. Here you can see a bunch of stats of the integrated hangfire instance
|
|
||||||
</HelperMessage>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<LazyLoader Load="Load">
|
|
||||||
<div class="grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-4 gap-5">
|
|
||||||
<StatCard Title="Servers" Text="@Stats.Servers.ToString()" Icon="icon-server"/>
|
|
||||||
<StatCard Title="Recurring" Text="@Stats.Recurring.ToString()" Icon="icon-calendar-sync"/>
|
|
||||||
<StatCard Title="Enqueued" Text="@Stats.Enqueued.ToString()" Icon="icon-list-end"/>
|
|
||||||
<StatCard Title="Queues" Text="@Stats.Queues.ToString()" Icon="icon-logs"/>
|
|
||||||
<StatCard Title="Scheduled" Text="@Stats.Scheduled.ToString()" Icon="icon-calendar-check-2"/>
|
|
||||||
<StatCard Title="Processing" Text="@Stats.Processing.ToString()" Icon="icon-pickaxe"/>
|
|
||||||
<StatCard Title="Succeeded" Text="@Stats.Succeeded.ToString()" Icon="icon-check-check"/>
|
|
||||||
<StatCard Title="Failed" Text="@Stats.Failed.ToString()" Icon="icon-ban"/>
|
|
||||||
<StatCard Title="Deleted" Text="@Stats.Deleted.ToString()" Icon="icon-trash-2"/>
|
|
||||||
<StatCard Title="Retries" Text="@(Stats.Retries?.ToString() ?? "-")" Icon="icon-rotate-ccw"/>
|
|
||||||
<StatCard Title="Awaiting" Text="@(Stats.Awaiting?.ToString() ?? "-")" Icon="icon-loader"/>
|
|
||||||
</div>
|
|
||||||
</LazyLoader>
|
|
||||||
|
|
||||||
@code
|
|
||||||
{
|
|
||||||
private HangfireStatsResponse Stats;
|
|
||||||
|
|
||||||
private async Task Load(LazyLoader _)
|
|
||||||
{
|
|
||||||
Stats = await ApiClient.GetJson<HangfireStatsResponse>(
|
|
||||||
"api/admin/system/hangfire/stats"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -4,12 +4,12 @@ public static class UiConstants
|
|||||||
{
|
{
|
||||||
public static readonly string[] AdminNavNames =
|
public static readonly string[] AdminNavNames =
|
||||||
[
|
[
|
||||||
"Overview", "Customisation", "Files", "Hangfire", "Advanced", "Diagnose"
|
"Overview", "Customisation", "Files", "Advanced", "Diagnose"
|
||||||
];
|
];
|
||||||
|
|
||||||
public static readonly string[] AdminNavLinks =
|
public static readonly string[] AdminNavLinks =
|
||||||
[
|
[
|
||||||
"/admin/system", "/admin/system/customisation", "/admin/system/files", "/admin/system/hangfire",
|
"/admin/system", "/admin/system/customisation", "/admin/system/files",
|
||||||
"/admin/system/advanced", "/admin/system/diagnose"
|
"/admin/system/advanced", "/admin/system/diagnose"
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
namespace Moonlight.Shared.Http.Responses.Admin.Hangfire;
|
|
||||||
|
|
||||||
public class HangfireStatsResponse
|
|
||||||
{
|
|
||||||
public long Servers { get; set; }
|
|
||||||
public long Recurring { get; set; }
|
|
||||||
public long Enqueued { get; set; }
|
|
||||||
public long Queues { get; set; }
|
|
||||||
public long Scheduled { get; set; }
|
|
||||||
public long Processing { get; set; }
|
|
||||||
public long Succeeded { get; set; }
|
|
||||||
public long Failed { get; set; }
|
|
||||||
public long Deleted { get; set; }
|
|
||||||
public long? Retries { get; set; }
|
|
||||||
public long? Awaiting { get; set; }
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user