using Deal.Infrastructure.Persistence.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Deal.Infrastructure.Persistence;
using Deal.Infrastructure.Persistence.Configurations;
namespace Deal.Infrastructure.Persistence.Configurations;
///
/// EF-конфигурация превью-сообщений: таблица TgMessages (модель без схемы; Ruling 7, db.py L67–74).
///
public sealed class TgMessageConfiguration : IEntityTypeConfiguration
{
public void Configure(EntityTypeBuilder builder)
{
builder.ToTable("TgMessages");
builder.HasKey(x => x.Id);
// Фолбэк превью диалога читается по диалогу в порядке времени (idx_messages_dialog db.py L74).
builder.HasIndex(x => new { x.DialogId, x.MsgAt });
}
}