feat: add Member/FamilyUnit DbSets, audit interceptor registration, EF migration
Registers AuditSaveChangesInterceptor in DI and wires it into AppDbContext. Adds Members and FamilyUnits DbSets with full column/index configuration and applies the AddMemberAndFamilyUnit migration to the ChurchCRM database. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using ROLAC.API.Data;
|
||||
using ROLAC.API.Data.Interceptors;
|
||||
using ROLAC.API.Entities;
|
||||
using ROLAC.API.Services;
|
||||
|
||||
@@ -13,8 +14,11 @@ var config = builder.Configuration;
|
||||
// ---------------------------------------------------------------------------
|
||||
// Database
|
||||
// ---------------------------------------------------------------------------
|
||||
builder.Services.AddDbContext<AppDbContext>(opt =>
|
||||
opt.UseNpgsql(config.GetConnectionString("DefaultConnection")));
|
||||
builder.Services.AddHttpContextAccessor();
|
||||
builder.Services.AddScoped<AuditSaveChangesInterceptor>();
|
||||
builder.Services.AddDbContext<AppDbContext>((sp, opt) =>
|
||||
opt.UseNpgsql(config.GetConnectionString("DefaultConnection"))
|
||||
.AddInterceptors(sp.GetRequiredService<AuditSaveChangesInterceptor>()));
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Identity
|
||||
|
||||
Reference in New Issue
Block a user