mirror of
https://github.com/C9Glax/tranga.git
synced 2025-10-17 10:50:45 +02:00
Include all Data in ActionRecord return Add endpoints for returning actions related to manga and chapter Fix wrong syncs for ActionsContext
23 lines
1.0 KiB
C#
23 lines
1.0 KiB
C#
using API.Schema.ActionsContext.Actions;
|
|
using API.Schema.ActionsContext.Actions.Generic;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace API.Schema.ActionsContext;
|
|
|
|
public class ActionsContext(DbContextOptions<ActionsContext> options) : TrangaBaseContext<ActionsContext>(options)
|
|
{
|
|
public DbSet<ActionRecord> Actions { get; set; }
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
modelBuilder.Entity<ActionRecord>()
|
|
.HasDiscriminator(a => a.Action)
|
|
.HasValue<ChapterDownloadedActionRecord>(ActionsEnum.ChapterDownloaded)
|
|
.HasValue<CoverDownloadedActionRecord>(ActionsEnum.CoverDownloaded)
|
|
.HasValue<ChaptersRetrievedActionRecord>(ActionsEnum.ChaptersRetrieved)
|
|
.HasValue<MetadataUpdatedActionRecord>(ActionsEnum.MetadataUpdated)
|
|
.HasValue<DataMovedActionRecord>(ActionsEnum.DataMoved)
|
|
.HasValue<LibraryMovedActionRecord>(ActionsEnum.LibraryMoved)
|
|
.HasValue<StartupActionRecord>(ActionsEnum.Startup);
|
|
}
|
|
} |