[FA-misc] Saga seems to work, fixed a UserNovelDataService bug
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
using FictionArchive.Service.NovelService.Models;
|
||||
using FictionArchive.Service.NovelService.Models.Images;
|
||||
using FictionArchive.Service.NovelService.Models.Localization;
|
||||
using FictionArchive.Service.NovelService.Models.Novels;
|
||||
using FictionArchive.Service.NovelService.Sagas;
|
||||
using FictionArchive.Service.Shared.Services.Database;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
@@ -18,6 +20,8 @@ public class NovelServiceDbContext(DbContextOptions options, ILogger<NovelServic
|
||||
public DbSet<LocalizationKey> LocalizationKeys { get; set; }
|
||||
public DbSet<LocalizationRequest> LocalizationRequests { get; set; }
|
||||
public DbSet<Image> Images { get; set; }
|
||||
public DbSet<ActiveImport> ActiveImports { get; set; }
|
||||
public DbSet<NovelImportSagaState> NovelImportSagaStates { get; set; }
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
@@ -36,5 +40,18 @@ public class NovelServiceDbContext(DbContextOptions options, ILogger<NovelServic
|
||||
modelBuilder.Entity<Chapter>()
|
||||
.HasIndex("VolumeId", "Order")
|
||||
.IsUnique();
|
||||
|
||||
modelBuilder.Entity<ActiveImport>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.ImportId);
|
||||
entity.HasIndex(e => e.NovelUrl).IsUnique();
|
||||
});
|
||||
|
||||
modelBuilder.Entity<NovelImportSagaState>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.CorrelationId);
|
||||
entity.HasIndex(e => e.NovelUrl);
|
||||
entity.HasIndex(e => e.CurrentState);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user