feat: stream tickets
This commit is contained in:
@ -0,0 +1,22 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace NostrStreamer.Database.Configuration;
|
||||
|
||||
public class StreamTicketsConfiguration : IEntityTypeConfiguration<StreamTickets>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<StreamTickets> builder)
|
||||
{
|
||||
builder.HasKey(a => a.Id);
|
||||
|
||||
builder.Property(a => a.Created)
|
||||
.IsRequired();
|
||||
|
||||
builder.Property(a => a.Token)
|
||||
.IsRequired();
|
||||
|
||||
builder.HasOne(a => a.UserStream)
|
||||
.WithMany()
|
||||
.HasForeignKey(a => a.UserStreamId);
|
||||
}
|
||||
}
|
@ -32,7 +32,9 @@ public class UserStreamConfiguration : IEntityTypeConfiguration<UserStream>
|
||||
|
||||
builder.Property(a => a.LastSegment)
|
||||
.IsRequired();
|
||||
|
||||
|
||||
builder.Property(a => a.AdmissionCost);
|
||||
|
||||
builder.HasOne(a => a.Endpoint)
|
||||
.WithMany()
|
||||
.HasForeignKey(a => a.EndpointId);
|
||||
@ -41,4 +43,4 @@ public class UserStreamConfiguration : IEntityTypeConfiguration<UserStream>
|
||||
.WithMany(a => a.Streams)
|
||||
.HasForeignKey(a => a.PubKey);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user