mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-05 18:48:41 +00:00
453 lines
14 KiB
C#
453 lines
14 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using SharpbinV3.Server.Data;
|
|
|
|
#nullable disable
|
|
|
|
namespace SharpbinV3.Server.Migrations
|
|
{
|
|
[DbContext(typeof(AppDbContext))]
|
|
partial class AppDbContextModelSnapshot : ModelSnapshot
|
|
{
|
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder.HasAnnotation("ProductVersion", "10.0.3");
|
|
|
|
modelBuilder.Entity("SharpbinV3.Server.Data.Enums.ApiKey", b =>
|
|
{
|
|
b.Property<Guid>("UUID")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<long>("CreatedAt")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("KeyHash")
|
|
.IsRequired()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<long?>("LastUsedAt")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<Guid>("UserUUID")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.HasKey("UUID");
|
|
|
|
b.HasIndex("UserUUID");
|
|
|
|
b.ToTable("ApiKeys");
|
|
});
|
|
|
|
modelBuilder.Entity("SharpbinV3.Server.Data.Enums.EmailVerificationToken", b =>
|
|
{
|
|
b.Property<Guid>("UUID")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<long>("CreatedAt")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<long>("ExpiresAt")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("TokenHash")
|
|
.IsRequired()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<int>("Type")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<bool>("Used")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<Guid>("UserUUID")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.HasKey("UUID");
|
|
|
|
b.HasIndex("UserUUID");
|
|
|
|
b.ToTable("EmailVerificationTokens");
|
|
});
|
|
|
|
modelBuilder.Entity("SharpbinV3.Server.Data.Enums.Paste", b =>
|
|
{
|
|
b.Property<int>("PID")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<Guid?>("AuthorUUID")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<byte[]>("Content")
|
|
.IsRequired()
|
|
.HasColumnType("BLOB");
|
|
|
|
b.Property<long>("CreatedAt")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<long?>("EditedAt")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<long>("ExpiresAt")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("ID")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<bool>("IsCompressed")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<long>("Size")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("Syntax")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Title")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<long>("TrueSize")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<Guid>("UUID")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<int>("Views")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<int>("Visibility")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.HasKey("PID");
|
|
|
|
b.HasIndex("AuthorUUID");
|
|
|
|
b.HasIndex("ExpiresAt");
|
|
|
|
b.HasIndex("ID")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("PID")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("Size");
|
|
|
|
b.HasIndex("Syntax");
|
|
|
|
b.HasIndex("UUID")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("Views");
|
|
|
|
b.HasIndex("Visibility");
|
|
|
|
b.ToTable("Pastes");
|
|
});
|
|
|
|
modelBuilder.Entity("SharpbinV3.Server.Data.Enums.PasteView", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<int>("PastePID")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<long>("ViewedAt")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("ViewerHash")
|
|
.IsRequired()
|
|
.HasMaxLength(64)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("PastePID", "ViewerHash")
|
|
.IsUnique();
|
|
|
|
b.ToTable("PasteViews");
|
|
});
|
|
|
|
modelBuilder.Entity("SharpbinV3.Server.Data.Enums.RefreshToken", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTimeOffset>("ExpiresAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("JwtId")
|
|
.IsRequired()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("ReplacedByToken")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<bool>("Revoked")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<byte[]>("RowVersion")
|
|
.IsRequired()
|
|
.HasColumnType("BLOB");
|
|
|
|
b.Property<string>("TokenHash")
|
|
.IsRequired()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<bool>("Used")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<Guid>("UserUUID")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("TokenHash")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("UserUUID");
|
|
|
|
b.ToTable("RefreshTokens");
|
|
});
|
|
|
|
modelBuilder.Entity("SharpbinV3.Server.Data.Enums.Report", b =>
|
|
{
|
|
b.Property<int>("ReportID")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<long>("CreatedAt")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("Description")
|
|
.HasMaxLength(1000)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<int?>("PastePID")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<Guid>("ReporterUUID")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<int>("Status")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<int>("TargetType")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<int>("Type")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<long?>("UpdatedAt")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<Guid?>("UserUUID")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.HasKey("ReportID");
|
|
|
|
b.HasIndex("PastePID");
|
|
|
|
b.HasIndex("ReportID")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("ReporterUUID");
|
|
|
|
b.HasIndex("TargetType");
|
|
|
|
b.HasIndex("UserUUID");
|
|
|
|
b.ToTable("Reports");
|
|
});
|
|
|
|
modelBuilder.Entity("SharpbinV3.Server.Data.Enums.User", b =>
|
|
{
|
|
b.Property<Guid>("UUID")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<long>("CreatedAt")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("DisplayName")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Email")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<bool>("EmailVerified")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<bool>("IsBanned")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<long?>("LastLogin")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("PasswordHash")
|
|
.IsRequired()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<int>("Roles")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<int?>("UID")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("Username")
|
|
.IsRequired()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<int>("Visibility")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.HasKey("UUID");
|
|
|
|
b.HasIndex("UID");
|
|
|
|
b.HasIndex("UUID")
|
|
.IsUnique();
|
|
|
|
b.ToTable("Users");
|
|
});
|
|
|
|
modelBuilder.Entity("SharpbinV3.Server.Data.Enums.UserTotp", b =>
|
|
{
|
|
b.Property<Guid>("UserUUID")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<long>("CreatedAt")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<byte[]>("EncryptedSecret")
|
|
.IsRequired()
|
|
.HasColumnType("BLOB");
|
|
|
|
b.HasKey("UserUUID");
|
|
|
|
b.ToTable("UserTotps");
|
|
});
|
|
|
|
modelBuilder.Entity("SharpbinV3.Server.Data.Enums.ApiKey", b =>
|
|
{
|
|
b.HasOne("SharpbinV3.Server.Data.Enums.User", "User")
|
|
.WithMany("ApiKeys")
|
|
.HasForeignKey("UserUUID")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("SharpbinV3.Server.Data.Enums.EmailVerificationToken", b =>
|
|
{
|
|
b.HasOne("SharpbinV3.Server.Data.Enums.User", "User")
|
|
.WithMany("EmailVerificationTokens")
|
|
.HasForeignKey("UserUUID")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("SharpbinV3.Server.Data.Enums.Paste", b =>
|
|
{
|
|
b.HasOne("SharpbinV3.Server.Data.Enums.User", "User")
|
|
.WithMany("Pastes")
|
|
.HasForeignKey("AuthorUUID")
|
|
.OnDelete(DeleteBehavior.Cascade);
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("SharpbinV3.Server.Data.Enums.PasteView", b =>
|
|
{
|
|
b.HasOne("SharpbinV3.Server.Data.Enums.Paste", "Paste")
|
|
.WithMany("PasteViews")
|
|
.HasForeignKey("PastePID")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Paste");
|
|
});
|
|
|
|
modelBuilder.Entity("SharpbinV3.Server.Data.Enums.RefreshToken", b =>
|
|
{
|
|
b.HasOne("SharpbinV3.Server.Data.Enums.User", "User")
|
|
.WithMany("RefreshTokens")
|
|
.HasForeignKey("UserUUID")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("SharpbinV3.Server.Data.Enums.Report", b =>
|
|
{
|
|
b.HasOne("SharpbinV3.Server.Data.Enums.Paste", "Paste")
|
|
.WithMany("Reports")
|
|
.HasForeignKey("PastePID")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.HasOne("SharpbinV3.Server.Data.Enums.User", "User")
|
|
.WithMany("Reports")
|
|
.HasForeignKey("UserUUID")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.Navigation("Paste");
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("SharpbinV3.Server.Data.Enums.UserTotp", b =>
|
|
{
|
|
b.HasOne("SharpbinV3.Server.Data.Enums.User", "User")
|
|
.WithOne("Totp")
|
|
.HasForeignKey("SharpbinV3.Server.Data.Enums.UserTotp", "UserUUID")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("SharpbinV3.Server.Data.Enums.Paste", b =>
|
|
{
|
|
b.Navigation("PasteViews");
|
|
|
|
b.Navigation("Reports");
|
|
});
|
|
|
|
modelBuilder.Entity("SharpbinV3.Server.Data.Enums.User", b =>
|
|
{
|
|
b.Navigation("ApiKeys");
|
|
|
|
b.Navigation("EmailVerificationTokens");
|
|
|
|
b.Navigation("Pastes");
|
|
|
|
b.Navigation("RefreshTokens");
|
|
|
|
b.Navigation("Reports");
|
|
|
|
b.Navigation("Totp");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|