2024-05-27 15:53:54 +02:00
|
|
|
|
// <auto-generated />
|
2024-07-08 19:03:04 +02:00
|
|
|
|
using System;
|
2024-08-22 15:13:46 +02:00
|
|
|
|
using System.Collections.Generic;
|
2024-05-27 15:53:54 +02:00
|
|
|
|
using Foxnouns.Backend.Database;
|
2024-08-22 15:13:46 +02:00
|
|
|
|
using Foxnouns.Backend.Database.Models;
|
2024-05-27 15:53:54 +02:00
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
|
|
|
using NodaTime;
|
|
|
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
|
|
|
|
|
|
|
|
#nullable disable
|
|
|
|
|
|
|
|
|
|
namespace Foxnouns.Backend.Database.Migrations
|
|
|
|
|
{
|
|
|
|
|
[DbContext(typeof(DatabaseContext))]
|
|
|
|
|
partial class DatabaseContextModelSnapshot : ModelSnapshot
|
|
|
|
|
{
|
|
|
|
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
|
|
|
|
{
|
|
|
|
|
#pragma warning disable 612, 618
|
|
|
|
|
modelBuilder
|
2024-08-22 15:13:46 +02:00
|
|
|
|
.HasAnnotation("ProductVersion", "8.0.7")
|
2024-05-27 15:53:54 +02:00
|
|
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
|
|
|
|
|
|
|
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
|
|
|
|
2024-05-28 15:29:18 +02:00
|
|
|
|
modelBuilder.Entity("Foxnouns.Backend.Database.Models.Application", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<long>("Id")
|
|
|
|
|
.HasColumnType("bigint")
|
|
|
|
|
.HasColumnName("id");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("ClientId")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("text")
|
|
|
|
|
.HasColumnName("client_id");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("ClientSecret")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("text")
|
|
|
|
|
.HasColumnName("client_secret");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Name")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("text")
|
|
|
|
|
.HasColumnName("name");
|
|
|
|
|
|
|
|
|
|
b.Property<string[]>("RedirectUris")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("text[]")
|
|
|
|
|
.HasColumnName("redirect_uris");
|
|
|
|
|
|
|
|
|
|
b.Property<string[]>("Scopes")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("text[]")
|
|
|
|
|
.HasColumnName("scopes");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id")
|
|
|
|
|
.HasName("pk_applications");
|
|
|
|
|
|
|
|
|
|
b.ToTable("applications", (string)null);
|
|
|
|
|
});
|
|
|
|
|
|
2024-05-27 15:53:54 +02:00
|
|
|
|
modelBuilder.Entity("Foxnouns.Backend.Database.Models.AuthMethod", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<long>("Id")
|
|
|
|
|
.HasColumnType("bigint")
|
|
|
|
|
.HasColumnName("id");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("AuthType")
|
|
|
|
|
.HasColumnType("integer")
|
|
|
|
|
.HasColumnName("auth_type");
|
|
|
|
|
|
|
|
|
|
b.Property<long?>("FediverseApplicationId")
|
|
|
|
|
.HasColumnType("bigint")
|
|
|
|
|
.HasColumnName("fediverse_application_id");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("RemoteId")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("text")
|
|
|
|
|
.HasColumnName("remote_id");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("RemoteUsername")
|
|
|
|
|
.HasColumnType("text")
|
|
|
|
|
.HasColumnName("remote_username");
|
|
|
|
|
|
|
|
|
|
b.Property<long>("UserId")
|
|
|
|
|
.HasColumnType("bigint")
|
|
|
|
|
.HasColumnName("user_id");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id")
|
|
|
|
|
.HasName("pk_auth_methods");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("FediverseApplicationId")
|
|
|
|
|
.HasDatabaseName("ix_auth_methods_fediverse_application_id");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("UserId")
|
|
|
|
|
.HasDatabaseName("ix_auth_methods_user_id");
|
|
|
|
|
|
|
|
|
|
b.ToTable("auth_methods", (string)null);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("Foxnouns.Backend.Database.Models.FediverseApplication", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<long>("Id")
|
|
|
|
|
.HasColumnType("bigint")
|
|
|
|
|
.HasColumnName("id");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("ClientId")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("text")
|
|
|
|
|
.HasColumnName("client_id");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("ClientSecret")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("text")
|
|
|
|
|
.HasColumnName("client_secret");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Domain")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("text")
|
|
|
|
|
.HasColumnName("domain");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("InstanceType")
|
|
|
|
|
.HasColumnType("integer")
|
|
|
|
|
.HasColumnName("instance_type");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id")
|
|
|
|
|
.HasName("pk_fediverse_applications");
|
|
|
|
|
|
|
|
|
|
b.ToTable("fediverse_applications", (string)null);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("Foxnouns.Backend.Database.Models.Member", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<long>("Id")
|
|
|
|
|
.HasColumnType("bigint")
|
|
|
|
|
.HasColumnName("id");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Avatar")
|
|
|
|
|
.HasColumnType("text")
|
|
|
|
|
.HasColumnName("avatar");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Bio")
|
|
|
|
|
.HasColumnType("text")
|
|
|
|
|
.HasColumnName("bio");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("DisplayName")
|
|
|
|
|
.HasColumnType("text")
|
|
|
|
|
.HasColumnName("display_name");
|
|
|
|
|
|
2024-09-05 22:17:10 +02:00
|
|
|
|
b.Property<List<Field>>("Fields")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("jsonb")
|
|
|
|
|
.HasColumnName("fields");
|
|
|
|
|
|
2024-05-27 15:53:54 +02:00
|
|
|
|
b.Property<string[]>("Links")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("text[]")
|
|
|
|
|
.HasColumnName("links");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Name")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("text")
|
|
|
|
|
.HasColumnName("name");
|
|
|
|
|
|
2024-09-05 22:17:10 +02:00
|
|
|
|
b.Property<List<FieldEntry>>("Names")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("jsonb")
|
|
|
|
|
.HasColumnName("names");
|
|
|
|
|
|
|
|
|
|
b.Property<List<Pronoun>>("Pronouns")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("jsonb")
|
|
|
|
|
.HasColumnName("pronouns");
|
|
|
|
|
|
2024-05-27 15:53:54 +02:00
|
|
|
|
b.Property<bool>("Unlisted")
|
|
|
|
|
.HasColumnType("boolean")
|
|
|
|
|
.HasColumnName("unlisted");
|
|
|
|
|
|
|
|
|
|
b.Property<long>("UserId")
|
|
|
|
|
.HasColumnType("bigint")
|
|
|
|
|
.HasColumnName("user_id");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id")
|
|
|
|
|
.HasName("pk_members");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("UserId", "Name")
|
|
|
|
|
.IsUnique()
|
|
|
|
|
.HasDatabaseName("ix_members_user_id_name");
|
|
|
|
|
|
|
|
|
|
b.ToTable("members", (string)null);
|
|
|
|
|
});
|
|
|
|
|
|
2024-06-12 03:47:20 +02:00
|
|
|
|
modelBuilder.Entity("Foxnouns.Backend.Database.Models.TemporaryKey", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<long>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("bigint")
|
|
|
|
|
.HasColumnName("id");
|
|
|
|
|
|
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
|
|
|
|
|
|
|
|
b.Property<Instant>("Expires")
|
|
|
|
|
.HasColumnType("timestamp with time zone")
|
|
|
|
|
.HasColumnName("expires");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Key")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("text")
|
|
|
|
|
.HasColumnName("key");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Value")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("text")
|
|
|
|
|
.HasColumnName("value");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id")
|
|
|
|
|
.HasName("pk_temporary_keys");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("Key")
|
|
|
|
|
.IsUnique()
|
|
|
|
|
.HasDatabaseName("ix_temporary_keys_key");
|
|
|
|
|
|
|
|
|
|
b.ToTable("temporary_keys", (string)null);
|
|
|
|
|
});
|
|
|
|
|
|
2024-05-27 15:53:54 +02:00
|
|
|
|
modelBuilder.Entity("Foxnouns.Backend.Database.Models.Token", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<long>("Id")
|
|
|
|
|
.HasColumnType("bigint")
|
|
|
|
|
.HasColumnName("id");
|
|
|
|
|
|
2024-05-28 15:29:18 +02:00
|
|
|
|
b.Property<long>("ApplicationId")
|
|
|
|
|
.HasColumnType("bigint")
|
|
|
|
|
.HasColumnName("application_id");
|
|
|
|
|
|
2024-05-27 15:53:54 +02:00
|
|
|
|
b.Property<Instant>("ExpiresAt")
|
|
|
|
|
.HasColumnType("timestamp with time zone")
|
|
|
|
|
.HasColumnName("expires_at");
|
|
|
|
|
|
2024-05-28 15:29:18 +02:00
|
|
|
|
b.Property<byte[]>("Hash")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("bytea")
|
|
|
|
|
.HasColumnName("hash");
|
|
|
|
|
|
2024-05-27 15:53:54 +02:00
|
|
|
|
b.Property<bool>("ManuallyExpired")
|
|
|
|
|
.HasColumnType("boolean")
|
|
|
|
|
.HasColumnName("manually_expired");
|
|
|
|
|
|
|
|
|
|
b.Property<string[]>("Scopes")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("text[]")
|
|
|
|
|
.HasColumnName("scopes");
|
|
|
|
|
|
|
|
|
|
b.Property<long>("UserId")
|
|
|
|
|
.HasColumnType("bigint")
|
|
|
|
|
.HasColumnName("user_id");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id")
|
|
|
|
|
.HasName("pk_tokens");
|
|
|
|
|
|
2024-05-28 15:29:18 +02:00
|
|
|
|
b.HasIndex("ApplicationId")
|
|
|
|
|
.HasDatabaseName("ix_tokens_application_id");
|
|
|
|
|
|
2024-05-27 15:53:54 +02:00
|
|
|
|
b.HasIndex("UserId")
|
|
|
|
|
.HasDatabaseName("ix_tokens_user_id");
|
|
|
|
|
|
|
|
|
|
b.ToTable("tokens", (string)null);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("Foxnouns.Backend.Database.Models.User", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<long>("Id")
|
|
|
|
|
.HasColumnType("bigint")
|
|
|
|
|
.HasColumnName("id");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Avatar")
|
|
|
|
|
.HasColumnType("text")
|
|
|
|
|
.HasColumnName("avatar");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Bio")
|
|
|
|
|
.HasColumnType("text")
|
|
|
|
|
.HasColumnName("bio");
|
|
|
|
|
|
2024-09-05 22:17:10 +02:00
|
|
|
|
b.Property<Dictionary<Snowflake, User.CustomPreference>>("CustomPreferences")
|
2024-08-22 15:13:46 +02:00
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("jsonb")
|
|
|
|
|
.HasColumnName("custom_preferences");
|
|
|
|
|
|
2024-07-13 03:09:00 +02:00
|
|
|
|
b.Property<bool>("Deleted")
|
|
|
|
|
.HasColumnType("boolean")
|
|
|
|
|
.HasColumnName("deleted");
|
|
|
|
|
|
|
|
|
|
b.Property<Instant?>("DeletedAt")
|
|
|
|
|
.HasColumnType("timestamp with time zone")
|
|
|
|
|
.HasColumnName("deleted_at");
|
|
|
|
|
|
|
|
|
|
b.Property<long?>("DeletedBy")
|
|
|
|
|
.HasColumnType("bigint")
|
|
|
|
|
.HasColumnName("deleted_by");
|
|
|
|
|
|
2024-05-27 15:53:54 +02:00
|
|
|
|
b.Property<string>("DisplayName")
|
|
|
|
|
.HasColumnType("text")
|
|
|
|
|
.HasColumnName("display_name");
|
|
|
|
|
|
2024-09-05 22:17:10 +02:00
|
|
|
|
b.Property<List<Field>>("Fields")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("jsonb")
|
|
|
|
|
.HasColumnName("fields");
|
|
|
|
|
|
2024-07-13 03:09:00 +02:00
|
|
|
|
b.Property<Instant>("LastActive")
|
|
|
|
|
.HasColumnType("timestamp with time zone")
|
|
|
|
|
.HasColumnName("last_active");
|
|
|
|
|
|
2024-05-27 15:53:54 +02:00
|
|
|
|
b.Property<string[]>("Links")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("text[]")
|
|
|
|
|
.HasColumnName("links");
|
|
|
|
|
|
2024-05-28 17:09:50 +02:00
|
|
|
|
b.Property<bool>("ListHidden")
|
|
|
|
|
.HasColumnType("boolean")
|
|
|
|
|
.HasColumnName("list_hidden");
|
|
|
|
|
|
2024-05-27 15:53:54 +02:00
|
|
|
|
b.Property<string>("MemberTitle")
|
|
|
|
|
.HasColumnType("text")
|
|
|
|
|
.HasColumnName("member_title");
|
|
|
|
|
|
2024-09-05 22:17:10 +02:00
|
|
|
|
b.Property<List<FieldEntry>>("Names")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("jsonb")
|
|
|
|
|
.HasColumnName("names");
|
|
|
|
|
|
2024-06-04 17:38:59 +02:00
|
|
|
|
b.Property<string>("Password")
|
|
|
|
|
.HasColumnType("text")
|
|
|
|
|
.HasColumnName("password");
|
|
|
|
|
|
2024-09-05 22:17:10 +02:00
|
|
|
|
b.Property<List<Pronoun>>("Pronouns")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("jsonb")
|
|
|
|
|
.HasColumnName("pronouns");
|
|
|
|
|
|
2024-05-27 15:53:54 +02:00
|
|
|
|
b.Property<int>("Role")
|
|
|
|
|
.HasColumnType("integer")
|
|
|
|
|
.HasColumnName("role");
|
|
|
|
|
|
2024-09-05 22:17:10 +02:00
|
|
|
|
b.Property<UserSettings>("Settings")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("jsonb")
|
|
|
|
|
.HasColumnName("settings");
|
|
|
|
|
|
2024-05-27 15:53:54 +02:00
|
|
|
|
b.Property<string>("Username")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("text")
|
|
|
|
|
.HasColumnName("username");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id")
|
|
|
|
|
.HasName("pk_users");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("Username")
|
|
|
|
|
.IsUnique()
|
|
|
|
|
.HasDatabaseName("ix_users_username");
|
|
|
|
|
|
|
|
|
|
b.ToTable("users", (string)null);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("Foxnouns.Backend.Database.Models.AuthMethod", b =>
|
|
|
|
|
{
|
|
|
|
|
b.HasOne("Foxnouns.Backend.Database.Models.FediverseApplication", "FediverseApplication")
|
|
|
|
|
.WithMany()
|
|
|
|
|
.HasForeignKey("FediverseApplicationId")
|
|
|
|
|
.HasConstraintName("fk_auth_methods_fediverse_applications_fediverse_application_id");
|
|
|
|
|
|
|
|
|
|
b.HasOne("Foxnouns.Backend.Database.Models.User", "User")
|
|
|
|
|
.WithMany("AuthMethods")
|
|
|
|
|
.HasForeignKey("UserId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasConstraintName("fk_auth_methods_users_user_id");
|
|
|
|
|
|
|
|
|
|
b.Navigation("FediverseApplication");
|
|
|
|
|
|
|
|
|
|
b.Navigation("User");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("Foxnouns.Backend.Database.Models.Member", b =>
|
|
|
|
|
{
|
|
|
|
|
b.HasOne("Foxnouns.Backend.Database.Models.User", "User")
|
|
|
|
|
.WithMany("Members")
|
|
|
|
|
.HasForeignKey("UserId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasConstraintName("fk_members_users_user_id");
|
|
|
|
|
|
|
|
|
|
b.Navigation("User");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("Foxnouns.Backend.Database.Models.Token", b =>
|
|
|
|
|
{
|
2024-05-28 15:29:18 +02:00
|
|
|
|
b.HasOne("Foxnouns.Backend.Database.Models.Application", "Application")
|
|
|
|
|
.WithMany()
|
|
|
|
|
.HasForeignKey("ApplicationId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasConstraintName("fk_tokens_applications_application_id");
|
|
|
|
|
|
2024-05-27 15:53:54 +02:00
|
|
|
|
b.HasOne("Foxnouns.Backend.Database.Models.User", "User")
|
|
|
|
|
.WithMany()
|
|
|
|
|
.HasForeignKey("UserId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasConstraintName("fk_tokens_users_user_id");
|
|
|
|
|
|
2024-05-28 15:29:18 +02:00
|
|
|
|
b.Navigation("Application");
|
|
|
|
|
|
2024-05-27 15:53:54 +02:00
|
|
|
|
b.Navigation("User");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("Foxnouns.Backend.Database.Models.User", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Navigation("AuthMethods");
|
|
|
|
|
|
|
|
|
|
b.Navigation("Members");
|
|
|
|
|
});
|
|
|
|
|
#pragma warning restore 612, 618
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|