28 lines
991 B
C#
28 lines
991 B
C#
using System.Reflection;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using ColaFlow.Modules.ProjectManagement.Domain.Aggregates.ProjectAggregate;
|
|
|
|
namespace ColaFlow.Modules.ProjectManagement.Infrastructure.Persistence;
|
|
|
|
/// <summary>
|
|
/// Project Management Module DbContext
|
|
/// </summary>
|
|
public class PMDbContext(DbContextOptions<PMDbContext> options) : DbContext(options)
|
|
{
|
|
public DbSet<Project> Projects => Set<Project>();
|
|
public DbSet<Epic> Epics => Set<Epic>();
|
|
public DbSet<Story> Stories => Set<Story>();
|
|
public DbSet<WorkTask> Tasks => Set<WorkTask>();
|
|
|
|
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());
|
|
}
|
|
}
|