Adds per-library consumption settings to the domain, storage, and API

This commit is contained in:
BinaryAlley committed 2026-10-24 10:20:00 +03:00
1 parent eaca69bf2a
commit b2d274f609
47 files changed
+4371 -11

No files matched your search

@@ -71,6 +71,14 @@ public class LibraryConfiguration : IEntityTypeConfiguration<LibraryEntity>
.HasDefaultValue(null)
.HasColumnOrder(11);
builder.Property(library => library.ShouldTrackConsumptionProgress)
.HasDefaultValue(false)
.HasColumnOrder(12);
builder.Property(library => library.CompletionThresholdPercentage)
.HasDefaultValue(null)
.HasColumnOrder(13);
// one user with many libraries
builder.HasOne(library => library.User)
.WithMany(user => user.Libraries)
@@ -130,18 +138,18 @@ public class LibraryConfiguration : IEntityTypeConfiguration<LibraryEntity>
// audit
builder.Property(library => library.CreatedOnUtc)
.IsRequired()
.HasColumnOrder(12);
.HasColumnOrder(14);
builder.Property(library => library.CreatedBy)
.IsRequired()
.HasColumnOrder(13);
.HasColumnOrder(15);
builder.Property(library => library.UpdatedOnUtc)
.HasDefaultValue(null)
.HasColumnOrder(14);
.HasColumnOrder(16);
builder.Property(library => library.UpdatedBy)
.HasDefaultValue(null)
.HasColumnOrder(15);
.HasColumnOrder(17);
}
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,41 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Lumina.DataAccess.Common.Migrations
{
/// <inheritdoc />
public partial class AddsLibraryConsumptionSettings : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "CompletionThresholdPercentage",
table: "Libraries",
type: "INTEGER",
nullable: true)
.Annotation("Relational:ColumnOrder", 17);
migrationBuilder.AddColumn<bool>(
name: "ShouldTrackConsumptionProgress",
table: "Libraries",
type: "INTEGER",
nullable: false,
defaultValue: false)
.Annotation("Relational:ColumnOrder", 16);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "CompletionThresholdPercentage",
table: "Libraries");
migrationBuilder.DropColumn(
name: "ShouldTrackConsumptionProgress",
table: "Libraries");
}
}
}
@@ -1402,6 +1402,10 @@ namespace Lumina.DataAccess.Common.Migrations
.HasDefaultValue(true)
.HasColumnOrder(6);
b.Property<int?>("CompletionThresholdPercentage")
.HasColumnType("INTEGER")
.HasColumnOrder(17);
b.Property<string>("CoverImage")
.HasMaxLength(255)
.HasColumnType("TEXT")
@@ -1448,6 +1452,12 @@ namespace Lumina.DataAccess.Common.Migrations
.HasColumnType("INTEGER")
.HasColumnOrder(8);
b.Property<bool>("ShouldTrackConsumptionProgress")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(false)
.HasColumnOrder(16);
b.Property<string>("Title")
.IsRequired()
.HasMaxLength(255)