mirror of
https://github.com/C9Glax/tranga.git
synced 2025-10-17 02:40:45 +02:00
This commit is contained in:
22
API/Schema/ActionsContext/ActionsContext.cs
Normal file
22
API/Schema/ActionsContext/ActionsContext.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using API.Schema.ActionsContext.Actions;
|
||||
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>(ChapterDownloadedActionRecord.ChapterDownloadedAction)
|
||||
.HasValue<CoverDownloadedActionRecord>(CoverDownloadedActionRecord.CoverDownloadedAction)
|
||||
.HasValue<ChaptersRetrievedActionRecord>(ChaptersRetrievedActionRecord.ChaptersRetrievedAction)
|
||||
.HasValue<MetadataUpdatedActionRecord>(MetadataUpdatedActionRecord.MetadataUpdatedAction)
|
||||
.HasValue<DataMovedActionRecord>(DataMovedActionRecord.DataMovedAction)
|
||||
.HasValue<LibraryMovedActionRecord>(LibraryMovedActionRecord.LibraryMovedAction)
|
||||
.HasValue<StartupActionRecord>(StartupActionRecord.StartupAction);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user