feat: stream-keys

This commit is contained in:
2024-08-28 10:02:49 +01:00
parent 015b75f894
commit 97e43c8cbd
27 changed files with 1723 additions and 87 deletions

View File

@ -238,6 +238,9 @@ namespace NostrStreamer.Migrations
b.Property<decimal?>("AdmissionCost")
.HasColumnType("numeric");
b.Property<string>("ContentWarning")
.HasColumnType("text");
b.Property<string>("EdgeIp")
.IsRequired()
.HasColumnType("text");
@ -256,6 +259,12 @@ namespace NostrStreamer.Migrations
.IsRequired()
.HasColumnType("text");
b.Property<string>("Goal")
.HasColumnType("text");
b.Property<string>("Image")
.HasColumnType("text");
b.Property<DateTime>("LastSegment")
.HasColumnType("timestamp with time zone");
@ -275,13 +284,18 @@ namespace NostrStreamer.Migrations
b.Property<int>("State")
.HasColumnType("integer");
b.Property<string>("StreamId")
.IsRequired()
b.Property<string>("Summary")
.HasColumnType("text");
b.Property<string>("Tags")
.HasColumnType("text");
b.Property<string>("Thumbnail")
.HasColumnType("text");
b.Property<string>("Title")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("EndpointId");
@ -376,6 +390,39 @@ namespace NostrStreamer.Migrations
b.ToTable("Guests");
});
modelBuilder.Entity("NostrStreamer.Database.UserStreamKey", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTime>("Created")
.HasColumnType("timestamp with time zone");
b.Property<DateTime?>("Expires")
.HasColumnType("timestamp with time zone");
b.Property<string>("Key")
.IsRequired()
.HasColumnType("text");
b.Property<Guid>("StreamId")
.HasColumnType("uuid");
b.Property<string>("UserPubkey")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("StreamId")
.IsUnique();
b.HasIndex("UserPubkey");
b.ToTable("StreamKeys");
});
modelBuilder.Entity("NostrStreamer.Database.UserStreamRecording", b =>
{
b.Property<Guid>("Id")
@ -476,6 +523,25 @@ namespace NostrStreamer.Migrations
b.Navigation("Stream");
});
modelBuilder.Entity("NostrStreamer.Database.UserStreamKey", b =>
{
b.HasOne("NostrStreamer.Database.UserStream", "UserStream")
.WithOne("StreamKey")
.HasForeignKey("NostrStreamer.Database.UserStreamKey", "StreamId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("NostrStreamer.Database.User", "User")
.WithMany("StreamKeys")
.HasForeignKey("UserPubkey")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
b.Navigation("UserStream");
});
modelBuilder.Entity("NostrStreamer.Database.UserStreamRecording", b =>
{
b.HasOne("NostrStreamer.Database.UserStream", "Stream")
@ -493,6 +559,8 @@ namespace NostrStreamer.Migrations
b.Navigation("Payments");
b.Navigation("StreamKeys");
b.Navigation("Streams");
});
@ -501,6 +569,8 @@ namespace NostrStreamer.Migrations
b.Navigation("Guests");
b.Navigation("Recordings");
b.Navigation("StreamKey");
});
#pragma warning restore 612, 618
}