Stream forwarding
This commit is contained in:
@ -0,0 +1,19 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace NostrStreamer.Database.Configuration;
|
||||
|
||||
public class UserStreamForwardsConfiguration : IEntityTypeConfiguration<UserStreamForwards>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<UserStreamForwards> builder)
|
||||
{
|
||||
builder.HasKey(a => a.Id);
|
||||
builder.Property(a => a.Name);
|
||||
builder.Property(a => a.Target);
|
||||
|
||||
builder.HasOne(a => a.User)
|
||||
.WithMany(a => a.Forwards)
|
||||
.HasForeignKey(a => a.UserPubkey)
|
||||
.HasPrincipalKey(a => a.PubKey);
|
||||
}
|
||||
}
|
@ -29,4 +29,6 @@ public class StreamerContext : DbContext
|
||||
public DbSet<IngestEndpoint> Endpoints => Set<IngestEndpoint>();
|
||||
|
||||
public DbSet<UserStreamRecording> Recordings => Set<UserStreamRecording>();
|
||||
|
||||
public DbSet<UserStreamForwards> Forwards => Set<UserStreamForwards>();
|
||||
}
|
||||
|
@ -56,4 +56,5 @@ public class User
|
||||
|
||||
public List<Payment> Payments { get; init; } = new();
|
||||
public List<UserStream> Streams { get; init; } = new();
|
||||
public List<UserStreamForwards> Forwards { get; init; } = new();
|
||||
}
|
||||
|
13
NostrStreamer/Database/UserStreamForwards.cs
Normal file
13
NostrStreamer/Database/UserStreamForwards.cs
Normal file
@ -0,0 +1,13 @@
|
||||
namespace NostrStreamer.Database;
|
||||
|
||||
public class UserStreamForwards
|
||||
{
|
||||
public Guid Id { get; init; } = Guid.NewGuid();
|
||||
|
||||
public string UserPubkey { get; init; } = null!;
|
||||
public User User { get; init; } = null!;
|
||||
|
||||
public string Name { get; init; } = null!;
|
||||
|
||||
public string Target { get; init; } = null!;
|
||||
}
|
Reference in New Issue
Block a user