//
using System;
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("20230704123736_PaymentSetup")]
partial class PaymentSetup
{
///
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.Payment", b =>
{
b.Property("PaymentHash")
.HasColumnType("text");
b.Property("Amount")
.HasColumnType("numeric(20,0)");
b.Property("Created")
.HasColumnType("timestamp with time zone");
b.Property("Invoice")
.IsRequired()
.HasColumnType("text");
b.Property("IsPaid")
.HasColumnType("boolean");
b.Property("PubKey")
.IsRequired()
.HasColumnType("text");
b.HasKey("PaymentHash");
b.HasIndex("PubKey");
b.ToTable("Payments");
});
modelBuilder.Entity("NostrStreamer.Database.User", b =>
{
b.Property("PubKey")
.HasColumnType("text");
b.Property("Balance")
.HasColumnType("bigint");
b.Property("Event")
.HasColumnType("text");
b.Property("Image")
.HasColumnType("text");
b.Property("StreamKey")
.IsRequired()
.HasColumnType("text");
b.Property("Summary")
.HasColumnType("text");
b.Property("Tags")
.HasColumnType("text");
b.Property("Title")
.HasColumnType("text");
b.Property("Version")
.IsConcurrencyToken()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("xid")
.HasColumnName("xmin");
b.HasKey("PubKey");
b.ToTable("Users");
});
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.User", b =>
{
b.Navigation("Payments");
});
#pragma warning restore 612, 618
}
}
}