Add دندانپزشک + پرستار سالمندان roles (idempotent ensure on startup)
Roles were only seeded on a fresh DB, so existing deployments never got new ones. Introduced a canonical role list + EnsureRolesAsync that runs on every startup and inserts any missing role — so production picks up the two new roles without a manual step. Original 7 keep their order/ids; the two new roles are appended (sort 8-9). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -94,7 +94,8 @@ using (var scope = app.Services.CreateScope())
|
||||
{
|
||||
var db = scope.ServiceProvider.GetRequiredService<AppDbContext>();
|
||||
db.Database.Migrate();
|
||||
await SeedData.SeedReferenceAsync(db); // cities/roles/districts always
|
||||
await SeedData.SeedReferenceAsync(db); // cities/districts on first run
|
||||
await SeedData.EnsureRolesAsync(db); // add any missing roles (idempotent, existing DBs too)
|
||||
// Demo board in Development, or whenever the admin has turned Demo Mode on.
|
||||
var st = await scope.ServiceProvider
|
||||
.GetRequiredService<JobsMedical.Web.Services.Scraping.SettingsService>().GetAsync();
|
||||
|
||||
Reference in New Issue
Block a user