feat: add EF migrations and design-time factory
- 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>
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user