This commit is contained in:
2023-12-08 14:50:02 +00:00
parent cef1b845bc
commit 865747fbae
13 changed files with 676 additions and 6 deletions

View File

@ -0,0 +1,25 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace NostrStreamer.Database.Configuration;
public class UserStreamClipConfiguration : IEntityTypeConfiguration<UserStreamClip>
{
public void Configure(EntityTypeBuilder<UserStreamClip> builder)
{
builder.HasKey(a => a.Id);
builder.Property(a => a.Created)
.IsRequired();
builder.Property(a => a.TakenByPubkey)
.IsRequired();
builder.Property(a => a.Url)
.IsRequired();
builder.HasOne(a => a.UserStream)
.WithMany()
.HasForeignKey(a => a.UserStreamId)
.HasPrincipalKey(a => a.Id);
}
}