366 lines
14 KiB
C#
366 lines
14 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using DysonNetwork.Sphere;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using NodaTime;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
|
|
#nullable disable
|
|
|
|
namespace DysonNetwork.Sphere.Migrations
|
|
{
|
|
[DbContext(typeof(AppDatabase))]
|
|
[Migration("20250410161354_AddSuperUser")]
|
|
partial class AddSuperUser
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void BuildTargetModel(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.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.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.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.Account.Account", b =>
|
|
{
|
|
b.Navigation("AuthFactors");
|
|
|
|
b.Navigation("Challenges");
|
|
|
|
b.Navigation("Contacts");
|
|
|
|
b.Navigation("Sessions");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|