73b506992c
- Fix EmailEmailTemplateEntityConfiguration -> EmailTemplateEntityConfiguration - Rename tables to match domain: templates->email_templates, providers->email_channels, provider_usage->email_channel_usage - Add NotificationDbContextFactory for design-time migrations tooling - Add InitialCreate migration: email_templates, email_channels, email_channel_usage Ref: IT-628 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
16 lines
577 B
C#
16 lines
577 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Design;
|
|
|
|
namespace HrynCo.NotificationService.DAL.EF;
|
|
|
|
internal sealed class NotificationDbContextFactory : IDesignTimeDbContextFactory<NotificationDbContext>
|
|
{
|
|
public NotificationDbContext CreateDbContext(string[] args)
|
|
{
|
|
var options = new DbContextOptionsBuilder<NotificationDbContext>()
|
|
.UseNpgsql("Host=localhost;Port=5432;Database=notification_service;Username=postgres;Password=postgres")
|
|
.Options;
|
|
|
|
return new NotificationDbContext(options);
|
|
}
|
|
} |