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 1, 2024
1 parent ae79d45 commit 440618f
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
Expand Up @@ -24,7 +24,6 @@
using NzbDrone.Common.Instrumentation.Extensions;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Datastore.Extensions;
using Prowlarr.Http.ClientSchema;
using PostgresOptions = NzbDrone.Core.Datastore.PostgresOptions;

namespace NzbDrone.Host
Expand Down Expand Up @@ -148,8 +147,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
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using DryIoc;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.DataProtection;
Expand All @@ -26,6 +27,7 @@
using Prowlarr.Api.V1.System;
using Prowlarr.Http;
using Prowlarr.Http.Authentication;
using Prowlarr.Http.ClientSchema;
using Prowlarr.Http.ErrorManagement;
using Prowlarr.Http.Frontend;
using Prowlarr.Http.Middleware;
Expand Down Expand Up @@ -208,6 +210,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 @@ -238,6 +241,7 @@ public void ConfigureServices(IServiceCollection services)
_ = logDatabaseFactory.Value;

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

if (OsInfo.IsNotWindows)
{
Expand Down

0 comments on commit 440618f

Please sign in to comment.