post reactions

This commit is contained in:
john 2025-05-28 22:05:20 +02:00
parent d1687f276b
commit 8e8e4e2258
10 changed files with 124 additions and 8 deletions

View file

@ -10,10 +10,21 @@ internal class PostConfiguration : IEntityTypeConfiguration<Post>
{
table.ToTable("post");
table.OwnsMany(post => post.Media).WithOwner();
table.OwnsMany(post => post.Reactions).WithOwner();
table.Property<string>("PossibleReactionsJson")
.HasColumnName("possible_reactions");
table.OwnsMany(
post => post.Reactions,
reactions =>
{
reactions.WithOwner().HasForeignKey(r => r.PostId);
reactions.HasKey(r => new
{
r.PostId,
r.AuthorId,
r.Emoji,
});
}
);
table.Property<string>("PossibleReactionsJson").HasColumnName("possible_reactions");
table.Ignore(e => e.PossibleReactions);
}