mirror of
https://github.com/aliasvault/aliasvault.git
synced 2026-05-07 14:56:02 -04:00
Add migrate on SmtpServer startup (#111)
This commit is contained in:
@@ -120,6 +120,14 @@ builder.Services.AddSingleton(
|
||||
);
|
||||
|
||||
builder.Services.AddHostedService<Worker>();
|
||||
|
||||
var host = builder.Build();
|
||||
|
||||
using (var scope = host.Services.CreateScope())
|
||||
{
|
||||
var container = scope.ServiceProvider;
|
||||
var db = container.GetRequiredService<AliasServerDbContext>();
|
||||
|
||||
await db.Database.MigrateAsync();
|
||||
}
|
||||
|
||||
await host.RunAsync();
|
||||
|
||||
Reference in New Issue
Block a user