aba4173827
Share template keys across email and push with independent editors and revisions. Render localized actions and preserve version-one delivery. Ref: IT-1627
22 lines
991 B
C#
22 lines
991 B
C#
using HrynCo.NotificationService.DAL.EF.Entities;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
namespace HrynCo.NotificationService.DAL.EF.Configurations;
|
|
|
|
internal sealed class TemplateEntityConfiguration : IEntityTypeConfiguration<TemplateEntity>
|
|
{
|
|
public void Configure(EntityTypeBuilder<TemplateEntity> builder)
|
|
{
|
|
builder.ToTable("templates");
|
|
builder.HasKey(x => x.Id);
|
|
builder.Property(x => x.Id).HasColumnName("id");
|
|
builder.Property(x => x.ServiceId).HasColumnName("service_id");
|
|
builder.Property(x => x.Key).HasColumnName("key").HasMaxLength(100).IsRequired();
|
|
builder.HasAlternateKey(x => new { x.ServiceId, x.Key });
|
|
builder.HasOne(x => x.Service).WithMany().HasForeignKey(x => x.ServiceId).OnDelete(DeleteBehavior.Restrict);
|
|
builder.Property(x => x.Created).HasColumnName("created");
|
|
builder.Property(x => x.Updated).HasColumnName("updated");
|
|
}
|
|
}
|