using System.Reflection; using Microsoft.EntityFrameworkCore; using ColaFlow.Modules.ProjectManagement.Domain.Aggregates.ProjectAggregate; namespace ColaFlow.Modules.ProjectManagement.Infrastructure.Persistence; /// /// Project Management Module DbContext /// public class PMDbContext(DbContextOptions options) : DbContext(options) { public DbSet Projects => Set(); public DbSet Epics => Set(); public DbSet Stories => Set(); public DbSet Tasks => Set(); protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); // Set default schema for this module (must be before configurations) modelBuilder.HasDefaultSchema("project_management"); // Apply all entity configurations from this assembly modelBuilder.ApplyConfigurationsFromAssembly(Assembly.GetExecutingAssembly()); } }