DVR
This commit is contained in:
@ -0,0 +1,24 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace NostrStreamer.Database.Configuration;
|
||||
|
||||
public class UserStreamRecordingConfiguration : IEntityTypeConfiguration<UserStreamRecording>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<UserStreamRecording> builder)
|
||||
{
|
||||
builder.HasKey(a => a.Id);
|
||||
builder.Property(a => a.Url)
|
||||
.IsRequired();
|
||||
|
||||
builder.Property(a => a.Timestamp)
|
||||
.IsRequired();
|
||||
|
||||
builder.Property(a => a.Duration)
|
||||
.IsRequired();
|
||||
|
||||
builder.HasOne(a => a.Stream)
|
||||
.WithMany(a => a.Recordings)
|
||||
.HasForeignKey(a => a.UserStreamId);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user