559 lines
18 KiB
C#
559 lines
18 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using NostrStreamer.Database;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
|
|
#nullable disable
|
|
|
|
namespace NostrStreamer.Migrations
|
|
{
|
|
[DbContext(typeof(StreamerContext))]
|
|
[Migration("20240821112332_StreamKeys")]
|
|
partial class StreamKeys
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "7.0.8")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
|
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("NostrStreamer.Database.IngestEndpoint", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("App")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<List<string>>("Capabilities")
|
|
.IsRequired()
|
|
.HasColumnType("text[]");
|
|
|
|
b.Property<int>("Cost")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("Forward")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("App")
|
|
.IsUnique();
|
|
|
|
b.ToTable("Endpoints");
|
|
});
|
|
|
|
modelBuilder.Entity("NostrStreamer.Database.Payment", b =>
|
|
{
|
|
b.Property<string>("PaymentHash")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<decimal>("Amount")
|
|
.HasColumnType("numeric(20,0)");
|
|
|
|
b.Property<DateTime>("Created")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<decimal>("Fee")
|
|
.HasColumnType("numeric(20,0)");
|
|
|
|
b.Property<string>("Invoice")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<bool>("IsPaid")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<string>("Nostr")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("PubKey")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int>("Type")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("PaymentHash");
|
|
|
|
b.HasIndex("PubKey");
|
|
|
|
b.ToTable("Payments");
|
|
});
|
|
|
|
modelBuilder.Entity("NostrStreamer.Database.PushSubscription", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("Auth")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<DateTime>("Created")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("Endpoint")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Key")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<DateTime>("LastUsed")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("Pubkey")
|
|
.IsRequired()
|
|
.HasMaxLength(64)
|
|
.HasColumnType("character varying(64)");
|
|
|
|
b.Property<string>("Scope")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("PushSubscriptions");
|
|
});
|
|
|
|
modelBuilder.Entity("NostrStreamer.Database.PushSubscriptionTarget", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("SubscriberPubkey")
|
|
.IsRequired()
|
|
.HasMaxLength(64)
|
|
.HasColumnType("character varying(64)");
|
|
|
|
b.Property<string>("TargetPubkey")
|
|
.IsRequired()
|
|
.HasMaxLength(64)
|
|
.HasColumnType("character varying(64)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("TargetPubkey");
|
|
|
|
b.HasIndex("SubscriberPubkey", "TargetPubkey")
|
|
.IsUnique();
|
|
|
|
b.ToTable("PushSubscriptionTargets");
|
|
});
|
|
|
|
modelBuilder.Entity("NostrStreamer.Database.StreamTickets", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTime>("Created")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<Guid>("Token")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("UserStreamId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("UserStreamId");
|
|
|
|
b.ToTable("StreamTickets");
|
|
});
|
|
|
|
modelBuilder.Entity("NostrStreamer.Database.User", b =>
|
|
{
|
|
b.Property<string>("PubKey")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<long>("Balance")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<string>("ContentWarning")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Goal")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Image")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("StreamKey")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Summary")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Tags")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Title")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<DateTime?>("TosAccepted")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<uint>("Version")
|
|
.IsConcurrencyToken()
|
|
.ValueGeneratedOnAddOrUpdate()
|
|
.HasColumnType("xid")
|
|
.HasColumnName("xmin");
|
|
|
|
b.HasKey("PubKey");
|
|
|
|
b.ToTable("Users");
|
|
});
|
|
|
|
modelBuilder.Entity("NostrStreamer.Database.UserStream", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<decimal?>("AdmissionCost")
|
|
.HasColumnType("numeric");
|
|
|
|
b.Property<string>("EdgeIp")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<Guid>("EndpointId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTime?>("Ends")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("Event")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("ForwardClientId")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<DateTime>("LastSegment")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<decimal>("Length")
|
|
.HasColumnType("numeric");
|
|
|
|
b.Property<decimal>("MilliSatsCollected")
|
|
.HasColumnType("numeric");
|
|
|
|
b.Property<string>("PubKey")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<DateTime>("Starts")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<int>("State")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("StreamId")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Thumbnail")
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("EndpointId");
|
|
|
|
b.HasIndex("PubKey");
|
|
|
|
b.ToTable("Streams");
|
|
});
|
|
|
|
modelBuilder.Entity("NostrStreamer.Database.UserStreamClip", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTime>("Created")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("TakenByPubkey")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Url")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<Guid>("UserStreamId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("UserStreamId");
|
|
|
|
b.ToTable("Clips");
|
|
});
|
|
|
|
modelBuilder.Entity("NostrStreamer.Database.UserStreamForwards", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Target")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("UserPubkey")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("UserPubkey");
|
|
|
|
b.ToTable("Forwards");
|
|
});
|
|
|
|
modelBuilder.Entity("NostrStreamer.Database.UserStreamGuest", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("PubKey")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Relay")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Role")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Sig")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<Guid>("StreamId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<decimal>("ZapSplit")
|
|
.HasColumnType("numeric");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("StreamId", "PubKey")
|
|
.IsUnique();
|
|
|
|
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<Guid>("Key")
|
|
.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")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<double>("Duration")
|
|
.HasColumnType("double precision");
|
|
|
|
b.Property<DateTime>("Timestamp")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("Url")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<Guid>("UserStreamId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("UserStreamId");
|
|
|
|
b.ToTable("Recordings");
|
|
});
|
|
|
|
modelBuilder.Entity("NostrStreamer.Database.Payment", b =>
|
|
{
|
|
b.HasOne("NostrStreamer.Database.User", "User")
|
|
.WithMany("Payments")
|
|
.HasForeignKey("PubKey")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("NostrStreamer.Database.StreamTickets", b =>
|
|
{
|
|
b.HasOne("NostrStreamer.Database.UserStream", "UserStream")
|
|
.WithMany()
|
|
.HasForeignKey("UserStreamId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("UserStream");
|
|
});
|
|
|
|
modelBuilder.Entity("NostrStreamer.Database.UserStream", b =>
|
|
{
|
|
b.HasOne("NostrStreamer.Database.IngestEndpoint", "Endpoint")
|
|
.WithMany()
|
|
.HasForeignKey("EndpointId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("NostrStreamer.Database.User", "User")
|
|
.WithMany("Streams")
|
|
.HasForeignKey("PubKey")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Endpoint");
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("NostrStreamer.Database.UserStreamClip", b =>
|
|
{
|
|
b.HasOne("NostrStreamer.Database.UserStream", "UserStream")
|
|
.WithMany()
|
|
.HasForeignKey("UserStreamId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("UserStream");
|
|
});
|
|
|
|
modelBuilder.Entity("NostrStreamer.Database.UserStreamForwards", b =>
|
|
{
|
|
b.HasOne("NostrStreamer.Database.User", "User")
|
|
.WithMany("Forwards")
|
|
.HasForeignKey("UserPubkey")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("NostrStreamer.Database.UserStreamGuest", b =>
|
|
{
|
|
b.HasOne("NostrStreamer.Database.UserStream", "Stream")
|
|
.WithMany("Guests")
|
|
.HasForeignKey("StreamId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Stream");
|
|
});
|
|
|
|
modelBuilder.Entity("NostrStreamer.Database.UserStreamKey", b =>
|
|
{
|
|
b.HasOne("NostrStreamer.Database.UserStream", "UserStream")
|
|
.WithOne()
|
|
.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")
|
|
.WithMany("Recordings")
|
|
.HasForeignKey("UserStreamId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Stream");
|
|
});
|
|
|
|
modelBuilder.Entity("NostrStreamer.Database.User", b =>
|
|
{
|
|
b.Navigation("Forwards");
|
|
|
|
b.Navigation("Payments");
|
|
|
|
b.Navigation("StreamKeys");
|
|
|
|
b.Navigation("Streams");
|
|
});
|
|
|
|
modelBuilder.Entity("NostrStreamer.Database.UserStream", b =>
|
|
{
|
|
b.Navigation("Guests");
|
|
|
|
b.Navigation("Recordings");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|