Add Device, DeviceConfig, SystemSettings entities and seed defaults
This commit is contained in:
+8
-1
@@ -15,8 +15,15 @@ var app = builder.Build();
|
||||
using (var scope = app.Services.CreateScope())
|
||||
{
|
||||
var sp = scope.ServiceProvider;
|
||||
sp.GetRequiredService<AppDbContext>().Database.Migrate();
|
||||
var db = sp.GetRequiredService<AppDbContext>();
|
||||
db.Database.Migrate();
|
||||
await IdentitySetup.SeedRolesAsync(sp);
|
||||
|
||||
if (!db.SystemSettings.Any())
|
||||
{
|
||||
db.SystemSettings.Add(new backend.Settings.SystemSettings());
|
||||
await db.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
|
||||
app.UseAuthentication();
|
||||
|
||||
Reference in New Issue
Block a user