mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 19:54:55 +00:00
Update models Messages
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user