feat(notify): add FinlyticNotify push notification microservice and test suite
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
using FinlyticCore.Database;
|
||||
using FinlyticCore.Entities.Settings;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace FinlyticNotify.Database;
|
||||
|
||||
/// <summary>
|
||||
/// Entity Framework DbContext used by FinlyticNotify exclusively for its own database (finlytic_notify)
|
||||
/// and dynamic settings.
|
||||
/// </summary>
|
||||
public class NotifyDbContext : DbContext, ISettingsDbContext
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="NotifyDbContext"/> class.
|
||||
/// </summary>
|
||||
public NotifyDbContext(DbContextOptions<NotifyDbContext> options) : base(options)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Dynamic settings table for FinlyticNotify.</summary>
|
||||
public DbSet<SettingEntity> DynamicSettings => Set<SettingEntity>();
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
base.OnModelCreating(modelBuilder);
|
||||
|
||||
modelBuilder.Entity<SettingEntity>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.Id);
|
||||
entity.HasIndex(e => e.Key).IsUnique();
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user