merged develop into main
This commit is contained in:
commit
c0cbcb581c
5 changed files with 103 additions and 0 deletions
|
@ -9,6 +9,7 @@ using API.Entities.Enums;
|
|||
using API.Services;
|
||||
using Kavita.Common;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace API.Data
|
||||
{
|
||||
|
@ -70,5 +71,21 @@ namespace API.Data
|
|||
await context.SaveChangesAsync();
|
||||
|
||||
}
|
||||
|
||||
public static async Task SeedSeriesMetadata(DataContext context)
|
||||
{
|
||||
await context.Database.EnsureCreatedAsync();
|
||||
|
||||
context.Database.EnsureCreated();
|
||||
var series = await context.Series
|
||||
.Include(s => s.Metadata).ToListAsync();
|
||||
|
||||
foreach (var s in series)
|
||||
{
|
||||
s.Metadata ??= new SeriesMetadata();
|
||||
}
|
||||
|
||||
await context.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue