Skip to content

Commit

Permalink
Fixed: Initialize databases after app folder migrations
Browse files Browse the repository at this point in the history
Co-authored-by: Mark McDowall <mark@mcdowall.ca>
  • Loading branch information
mynameisbogdan and markus101 committed May 4, 2024
1 parent 9660ec3 commit 4d28d3f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/NzbDrone.Host/Bootstrap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using System.Text;
using DryIoc;
using DryIoc.Microsoft.DependencyInjection;
using Lidarr.Http.ClientSchema;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
Expand Down Expand Up @@ -151,8 +150,6 @@ public static IHostBuilder CreateConsoleHostBuilder(string[] args, StartupContex
.AddNzbDroneLogger()
.AddDatabase()
.AddStartupContext(context);
SchemaBuilder.Initialize(c);
})
.ConfigureServices(services =>
{
Expand Down
4 changes: 4 additions & 0 deletions src/NzbDrone.Host/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using System;
using System.Collections.Generic;
using System.IO;
using DryIoc;
using Lidarr.Api.V1.System;
using Lidarr.Http;
using Lidarr.Http.Authentication;
using Lidarr.Http.ClientSchema;
using Lidarr.Http.ErrorManagement;
using Lidarr.Http.Frontend;
using Lidarr.Http.Middleware;
Expand Down Expand Up @@ -209,6 +211,7 @@ public void ConfigureServices(IServiceCollection services)
}

public void Configure(IApplicationBuilder app,
IContainer container,
IStartupContext startupContext,
Lazy<IMainDatabase> mainDatabaseFactory,
Lazy<ILogDatabase> logDatabaseFactory,
Expand Down Expand Up @@ -239,6 +242,7 @@ public void ConfigureServices(IServiceCollection services)
_ = logDatabaseFactory.Value;

dbTarget.Register();
SchemaBuilder.Initialize(container);

if (OsInfo.IsNotWindows)
{
Expand Down

0 comments on commit 4d28d3f

Please sign in to comment.