539 lines
21 KiB
C#
539 lines
21 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using DysonNetwork.Sphere;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using NodaTime;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
|
|
#nullable disable
|
|
|
|
namespace DysonNetwork.Sphere.Migrations
|
|
{
|
|
[DbContext(typeof(AppDatabase))]
|
|
partial class AppDatabaseModelSnapshot : ModelSnapshot
|
|
{
|
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "9.0.3")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
|
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("DysonNetwork.Sphere.Account.Account", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint")
|
|
.HasColumnName("id");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
|
|
b.Property<Instant>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created_at");
|
|
|
|
b.Property<Instant?>("DeletedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("deleted_at");
|
|
|
|
b.Property<bool>("IsSuperuser")
|
|
.HasColumnType("boolean")
|
|
.HasColumnName("is_superuser");
|
|
|
|
b.Property<string>("Language")
|
|
.IsRequired()
|
|
.HasMaxLength(32)
|
|
.HasColumnType("character varying(32)")
|
|
.HasColumnName("language");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)")
|
|
.HasColumnName("name");
|
|
|
|
b.Property<string>("Nick")
|
|
.IsRequired()
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)")
|
|
.HasColumnName("nick");
|
|
|
|
b.Property<Instant>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated_at");
|
|
|
|
b.HasKey("Id")
|
|
.HasName("pk_accounts");
|
|
|
|
b.ToTable("accounts", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountAuthFactor", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint")
|
|
.HasColumnName("id");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
|
|
b.Property<long>("AccountId")
|
|
.HasColumnType("bigint")
|
|
.HasColumnName("account_id");
|
|
|
|
b.Property<Instant>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created_at");
|
|
|
|
b.Property<Instant?>("DeletedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("deleted_at");
|
|
|
|
b.Property<string>("Secret")
|
|
.HasColumnType("text")
|
|
.HasColumnName("secret");
|
|
|
|
b.Property<int>("Type")
|
|
.HasColumnType("integer")
|
|
.HasColumnName("type");
|
|
|
|
b.Property<Instant>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated_at");
|
|
|
|
b.HasKey("Id")
|
|
.HasName("pk_account_auth_factors");
|
|
|
|
b.HasIndex("AccountId")
|
|
.HasDatabaseName("ix_account_auth_factors_account_id");
|
|
|
|
b.ToTable("account_auth_factors", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountContact", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint")
|
|
.HasColumnName("id");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
|
|
b.Property<long>("AccountId")
|
|
.HasColumnType("bigint")
|
|
.HasColumnName("account_id");
|
|
|
|
b.Property<string>("Content")
|
|
.IsRequired()
|
|
.HasMaxLength(1024)
|
|
.HasColumnType("character varying(1024)")
|
|
.HasColumnName("content");
|
|
|
|
b.Property<Instant>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created_at");
|
|
|
|
b.Property<Instant?>("DeletedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("deleted_at");
|
|
|
|
b.Property<int>("Type")
|
|
.HasColumnType("integer")
|
|
.HasColumnName("type");
|
|
|
|
b.Property<Instant>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated_at");
|
|
|
|
b.Property<Instant?>("VerifiedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("verified_at");
|
|
|
|
b.HasKey("Id")
|
|
.HasName("pk_account_contacts");
|
|
|
|
b.HasIndex("AccountId")
|
|
.HasDatabaseName("ix_account_contacts_account_id");
|
|
|
|
b.ToTable("account_contacts", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("DysonNetwork.Sphere.Account.Profile", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.HasColumnType("bigint")
|
|
.HasColumnName("id");
|
|
|
|
b.Property<string>("BackgroundId")
|
|
.HasColumnType("text")
|
|
.HasColumnName("background_id");
|
|
|
|
b.Property<string>("Bio")
|
|
.HasMaxLength(4096)
|
|
.HasColumnType("character varying(4096)")
|
|
.HasColumnName("bio");
|
|
|
|
b.Property<Instant>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created_at");
|
|
|
|
b.Property<Instant?>("DeletedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("deleted_at");
|
|
|
|
b.Property<string>("FirstName")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)")
|
|
.HasColumnName("first_name");
|
|
|
|
b.Property<string>("LastName")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)")
|
|
.HasColumnName("last_name");
|
|
|
|
b.Property<string>("MiddleName")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)")
|
|
.HasColumnName("middle_name");
|
|
|
|
b.Property<string>("PictureId")
|
|
.HasColumnType("text")
|
|
.HasColumnName("picture_id");
|
|
|
|
b.Property<Instant>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated_at");
|
|
|
|
b.HasKey("Id")
|
|
.HasName("pk_account_profiles");
|
|
|
|
b.HasIndex("BackgroundId")
|
|
.HasDatabaseName("ix_account_profiles_background_id");
|
|
|
|
b.HasIndex("PictureId")
|
|
.HasDatabaseName("ix_account_profiles_picture_id");
|
|
|
|
b.ToTable("account_profiles", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("DysonNetwork.Sphere.Auth.Challenge", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid")
|
|
.HasColumnName("id");
|
|
|
|
b.Property<long>("AccountId")
|
|
.HasColumnType("bigint")
|
|
.HasColumnName("account_id");
|
|
|
|
b.Property<List<string>>("Audiences")
|
|
.IsRequired()
|
|
.HasColumnType("jsonb")
|
|
.HasColumnName("audiences");
|
|
|
|
b.Property<List<long>>("BlacklistFactors")
|
|
.IsRequired()
|
|
.HasColumnType("jsonb")
|
|
.HasColumnName("blacklist_factors");
|
|
|
|
b.Property<Instant>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created_at");
|
|
|
|
b.Property<Instant?>("DeletedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("deleted_at");
|
|
|
|
b.Property<string>("DeviceId")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)")
|
|
.HasColumnName("device_id");
|
|
|
|
b.Property<Instant?>("ExpiredAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("expired_at");
|
|
|
|
b.Property<string>("IpAddress")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)")
|
|
.HasColumnName("ip_address");
|
|
|
|
b.Property<string>("Nonce")
|
|
.HasMaxLength(1024)
|
|
.HasColumnType("character varying(1024)")
|
|
.HasColumnName("nonce");
|
|
|
|
b.Property<List<string>>("Scopes")
|
|
.IsRequired()
|
|
.HasColumnType("jsonb")
|
|
.HasColumnName("scopes");
|
|
|
|
b.Property<int>("StepRemain")
|
|
.HasColumnType("integer")
|
|
.HasColumnName("step_remain");
|
|
|
|
b.Property<int>("StepTotal")
|
|
.HasColumnType("integer")
|
|
.HasColumnName("step_total");
|
|
|
|
b.Property<Instant>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated_at");
|
|
|
|
b.Property<string>("UserAgent")
|
|
.HasMaxLength(512)
|
|
.HasColumnType("character varying(512)")
|
|
.HasColumnName("user_agent");
|
|
|
|
b.HasKey("Id")
|
|
.HasName("pk_auth_challenges");
|
|
|
|
b.HasIndex("AccountId")
|
|
.HasDatabaseName("ix_auth_challenges_account_id");
|
|
|
|
b.ToTable("auth_challenges", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("DysonNetwork.Sphere.Auth.Session", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid")
|
|
.HasColumnName("id");
|
|
|
|
b.Property<long>("AccountId")
|
|
.HasColumnType("bigint")
|
|
.HasColumnName("account_id");
|
|
|
|
b.Property<Guid>("ChallengeId")
|
|
.HasColumnType("uuid")
|
|
.HasColumnName("challenge_id");
|
|
|
|
b.Property<Instant>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created_at");
|
|
|
|
b.Property<Instant?>("DeletedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("deleted_at");
|
|
|
|
b.Property<Instant?>("ExpiredAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("expired_at");
|
|
|
|
b.Property<Instant?>("LastGrantedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("last_granted_at");
|
|
|
|
b.Property<Instant>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated_at");
|
|
|
|
b.HasKey("Id")
|
|
.HasName("pk_auth_sessions");
|
|
|
|
b.HasIndex("AccountId")
|
|
.HasDatabaseName("ix_auth_sessions_account_id");
|
|
|
|
b.HasIndex("ChallengeId")
|
|
.HasDatabaseName("ix_auth_sessions_challenge_id");
|
|
|
|
b.ToTable("auth_sessions", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("DysonNetwork.Sphere.Storage.CloudFile", b =>
|
|
{
|
|
b.Property<string>("Id")
|
|
.HasColumnType("text")
|
|
.HasColumnName("id");
|
|
|
|
b.Property<long>("AccountId")
|
|
.HasColumnType("bigint")
|
|
.HasColumnName("account_id");
|
|
|
|
b.Property<Instant>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created_at");
|
|
|
|
b.Property<Instant?>("DeletedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("deleted_at");
|
|
|
|
b.Property<string>("Description")
|
|
.HasMaxLength(4096)
|
|
.HasColumnType("character varying(4096)")
|
|
.HasColumnName("description");
|
|
|
|
b.Property<Dictionary<string, object>>("FileMeta")
|
|
.HasColumnType("jsonb")
|
|
.HasColumnName("file_meta");
|
|
|
|
b.Property<string>("Hash")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)")
|
|
.HasColumnName("hash");
|
|
|
|
b.Property<string>("MimeType")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)")
|
|
.HasColumnName("mime_type");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(1024)
|
|
.HasColumnType("character varying(1024)")
|
|
.HasColumnName("name");
|
|
|
|
b.Property<long>("Size")
|
|
.HasColumnType("bigint")
|
|
.HasColumnName("size");
|
|
|
|
b.Property<Instant>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated_at");
|
|
|
|
b.Property<Instant?>("UploadedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("uploaded_at");
|
|
|
|
b.Property<string>("UploadedTo")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)")
|
|
.HasColumnName("uploaded_to");
|
|
|
|
b.Property<int>("UsedCount")
|
|
.HasColumnType("integer")
|
|
.HasColumnName("used_count");
|
|
|
|
b.Property<Dictionary<string, object>>("UserMeta")
|
|
.HasColumnType("jsonb")
|
|
.HasColumnName("user_meta");
|
|
|
|
b.HasKey("Id")
|
|
.HasName("pk_files");
|
|
|
|
b.HasIndex("AccountId")
|
|
.HasDatabaseName("ix_files_account_id");
|
|
|
|
b.ToTable("files", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountAuthFactor", b =>
|
|
{
|
|
b.HasOne("DysonNetwork.Sphere.Account.Account", "Account")
|
|
.WithMany("AuthFactors")
|
|
.HasForeignKey("AccountId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired()
|
|
.HasConstraintName("fk_account_auth_factors_accounts_account_id");
|
|
|
|
b.Navigation("Account");
|
|
});
|
|
|
|
modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountContact", b =>
|
|
{
|
|
b.HasOne("DysonNetwork.Sphere.Account.Account", "Account")
|
|
.WithMany("Contacts")
|
|
.HasForeignKey("AccountId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired()
|
|
.HasConstraintName("fk_account_contacts_accounts_account_id");
|
|
|
|
b.Navigation("Account");
|
|
});
|
|
|
|
modelBuilder.Entity("DysonNetwork.Sphere.Account.Profile", b =>
|
|
{
|
|
b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background")
|
|
.WithMany()
|
|
.HasForeignKey("BackgroundId")
|
|
.HasConstraintName("fk_account_profiles_files_background_id");
|
|
|
|
b.HasOne("DysonNetwork.Sphere.Account.Account", "Account")
|
|
.WithOne("Profile")
|
|
.HasForeignKey("DysonNetwork.Sphere.Account.Profile", "Id")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired()
|
|
.HasConstraintName("fk_account_profiles_accounts_id");
|
|
|
|
b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture")
|
|
.WithMany()
|
|
.HasForeignKey("PictureId")
|
|
.HasConstraintName("fk_account_profiles_files_picture_id");
|
|
|
|
b.Navigation("Account");
|
|
|
|
b.Navigation("Background");
|
|
|
|
b.Navigation("Picture");
|
|
});
|
|
|
|
modelBuilder.Entity("DysonNetwork.Sphere.Auth.Challenge", b =>
|
|
{
|
|
b.HasOne("DysonNetwork.Sphere.Account.Account", "Account")
|
|
.WithMany("Challenges")
|
|
.HasForeignKey("AccountId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired()
|
|
.HasConstraintName("fk_auth_challenges_accounts_account_id");
|
|
|
|
b.Navigation("Account");
|
|
});
|
|
|
|
modelBuilder.Entity("DysonNetwork.Sphere.Auth.Session", b =>
|
|
{
|
|
b.HasOne("DysonNetwork.Sphere.Account.Account", "Account")
|
|
.WithMany("Sessions")
|
|
.HasForeignKey("AccountId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired()
|
|
.HasConstraintName("fk_auth_sessions_accounts_account_id");
|
|
|
|
b.HasOne("DysonNetwork.Sphere.Auth.Challenge", "Challenge")
|
|
.WithMany()
|
|
.HasForeignKey("ChallengeId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired()
|
|
.HasConstraintName("fk_auth_sessions_auth_challenges_challenge_id");
|
|
|
|
b.Navigation("Account");
|
|
|
|
b.Navigation("Challenge");
|
|
});
|
|
|
|
modelBuilder.Entity("DysonNetwork.Sphere.Storage.CloudFile", b =>
|
|
{
|
|
b.HasOne("DysonNetwork.Sphere.Account.Account", "Account")
|
|
.WithMany()
|
|
.HasForeignKey("AccountId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired()
|
|
.HasConstraintName("fk_files_accounts_account_id");
|
|
|
|
b.Navigation("Account");
|
|
});
|
|
|
|
modelBuilder.Entity("DysonNetwork.Sphere.Account.Account", b =>
|
|
{
|
|
b.Navigation("AuthFactors");
|
|
|
|
b.Navigation("Challenges");
|
|
|
|
b.Navigation("Contacts");
|
|
|
|
b.Navigation("Profile")
|
|
.IsRequired();
|
|
|
|
b.Navigation("Sessions");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|