post reactions
This commit is contained in:
parent
d1687f276b
commit
8e8e4e2258
10 changed files with 124 additions and 8 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue