forked from SoDOff-Project/sodoff
Compare commits
2 Commits
9f149cedb3
...
28adf1b3f1
Author | SHA1 | Date | |
---|---|---|---|
28adf1b3f1 | |||
aee7f7ff15 |
@ -7,6 +7,7 @@ using sodoff.Services;
|
||||
using sodoff.Utils;
|
||||
using System.Xml;
|
||||
using System.Net;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
@ -64,6 +65,13 @@ using var scope = app.Services.CreateScope();
|
||||
|
||||
scope.ServiceProvider.GetRequiredService<DBContext>().Database.EnsureCreated();
|
||||
|
||||
// ensure any new migrations are applied
|
||||
var migrations = scope.ServiceProvider.GetRequiredService<DBContext>().Database.GetPendingMigrations();
|
||||
|
||||
if (migrations != null)
|
||||
// apply them
|
||||
await scope.ServiceProvider.GetRequiredService<DBContext>().Database.MigrateAsync();
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
|
||||
if (assetServer)
|
||||
|
Loading…
x
Reference in New Issue
Block a user