Update models Messages

This commit is contained in:
Artemy
2025-06-22 11:45:25 +07:00
parent c9aad0c466
commit a6e8ba1a65
13 changed files with 794 additions and 6 deletions
@@ -0,0 +1,26 @@
using Govor.Core.Models;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace Govor.Data.Configurations;
public class MediaAttachmentsConfiguration : IEntityTypeConfiguration<MediaAttachments>
{
public void Configure(EntityTypeBuilder<MediaAttachments> builder)
{
builder.HasKey(ma => ma.Id);
builder.Property(ma => ma.FilePath)
.IsRequired();
builder.Property(ma => ma.MimeType)
.IsRequired();
builder.Property(ma => ma.EncryptedKey)
.HasMaxLength(512); // зависит от шифра
builder.Property(ma => ma.Type)
.HasConversion<string>() // enum as string (e.g., "Image")
.IsRequired();
}
}