// 
using System;
using System.Collections.Generic;
using System.Text.Json;
using DysonNetwork.Sphere;
using DysonNetwork.Sphere.Storage;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using NetTopologySuite.Geometries;
using NodaTime;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using NpgsqlTypes;
#nullable disable
namespace DysonNetwork.Sphere.Migrations
{
    [DbContext(typeof(AppDatabase))]
    [Migration("20250602144445_FixPushNotificationIndex")]
    partial class FixPushNotificationIndex
    {
        /// 
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "9.0.3")
                .HasAnnotation("Relational:MaxIdentifierLength", 63);
            NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "postgis");
            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
            modelBuilder.Entity("DysonNetwork.Sphere.Account.Account", b =>
                {
                    b.Property("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");
                    b.Property("ActivatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("activated_at");
                    b.Property("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");
                    b.Property("DeletedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("deleted_at");
                    b.Property("IsSuperuser")
                        .HasColumnType("boolean")
                        .HasColumnName("is_superuser");
                    b.Property("Language")
                        .IsRequired()
                        .HasMaxLength(32)
                        .HasColumnType("character varying(32)")
                        .HasColumnName("language");
                    b.Property("Name")
                        .IsRequired()
                        .HasMaxLength(256)
                        .HasColumnType("character varying(256)")
                        .HasColumnName("name");
                    b.Property("Nick")
                        .IsRequired()
                        .HasMaxLength(256)
                        .HasColumnType("character varying(256)")
                        .HasColumnName("nick");
                    b.Property("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");
                    b.HasKey("Id")
                        .HasName("pk_accounts");
                    b.HasIndex("Name")
                        .IsUnique()
                        .HasDatabaseName("ix_accounts_name");
                    b.ToTable("accounts", (string)null);
                });
            modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountAuthFactor", b =>
                {
                    b.Property("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");
                    b.Property("AccountId")
                        .HasColumnType("uuid")
                        .HasColumnName("account_id");
                    b.Property("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");
                    b.Property("DeletedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("deleted_at");
                    b.Property("Secret")
                        .HasMaxLength(8196)
                        .HasColumnType("character varying(8196)")
                        .HasColumnName("secret");
                    b.Property("Type")
                        .HasColumnType("integer")
                        .HasColumnName("type");
                    b.Property("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("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");
                    b.Property("AccountId")
                        .HasColumnType("uuid")
                        .HasColumnName("account_id");
                    b.Property("Content")
                        .IsRequired()
                        .HasMaxLength(1024)
                        .HasColumnType("character varying(1024)")
                        .HasColumnName("content");
                    b.Property("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");
                    b.Property("DeletedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("deleted_at");
                    b.Property("Type")
                        .HasColumnType("integer")
                        .HasColumnName("type");
                    b.Property("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");
                    b.Property("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.ActionLog", b =>
                {
                    b.Property("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");
                    b.Property("AccountId")
                        .HasColumnType("uuid")
                        .HasColumnName("account_id");
                    b.Property("Action")
                        .IsRequired()
                        .HasMaxLength(4096)
                        .HasColumnType("character varying(4096)")
                        .HasColumnName("action");
                    b.Property("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");
                    b.Property("DeletedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("deleted_at");
                    b.Property("IpAddress")
                        .HasMaxLength(128)
                        .HasColumnType("character varying(128)")
                        .HasColumnName("ip_address");
                    b.Property("Location")
                        .HasColumnType("geometry")
                        .HasColumnName("location");
                    b.Property>("Meta")
                        .IsRequired()
                        .HasColumnType("jsonb")
                        .HasColumnName("meta");
                    b.Property("SessionId")
                        .HasColumnType("uuid")
                        .HasColumnName("session_id");
                    b.Property("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");
                    b.Property("UserAgent")
                        .HasMaxLength(512)
                        .HasColumnType("character varying(512)")
                        .HasColumnName("user_agent");
                    b.HasKey("Id")
                        .HasName("pk_action_logs");
                    b.HasIndex("AccountId")
                        .HasDatabaseName("ix_action_logs_account_id");
                    b.HasIndex("SessionId")
                        .HasDatabaseName("ix_action_logs_session_id");
                    b.ToTable("action_logs", (string)null);
                });
            modelBuilder.Entity("DysonNetwork.Sphere.Account.Badge", b =>
                {
                    b.Property("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");
                    b.Property("AccountId")
                        .HasColumnType("uuid")
                        .HasColumnName("account_id");
                    b.Property("Caption")
                        .HasMaxLength(4096)
                        .HasColumnType("character varying(4096)")
                        .HasColumnName("caption");
                    b.Property("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");
                    b.Property("DeletedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("deleted_at");
                    b.Property("ExpiredAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("expired_at");
                    b.Property("Label")
                        .HasMaxLength(1024)
                        .HasColumnType("character varying(1024)")
                        .HasColumnName("label");
                    b.Property>("Meta")
                        .IsRequired()
                        .HasColumnType("jsonb")
                        .HasColumnName("meta");
                    b.Property("Type")
                        .IsRequired()
                        .HasMaxLength(1024)
                        .HasColumnType("character varying(1024)")
                        .HasColumnName("type");
                    b.Property("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");
                    b.HasKey("Id")
                        .HasName("pk_badges");
                    b.HasIndex("AccountId")
                        .HasDatabaseName("ix_badges_account_id");
                    b.ToTable("badges", (string)null);
                });
            modelBuilder.Entity("DysonNetwork.Sphere.Account.CheckInResult", b =>
                {
                    b.Property("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");
                    b.Property("AccountId")
                        .HasColumnType("uuid")
                        .HasColumnName("account_id");
                    b.Property("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");
                    b.Property("DeletedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("deleted_at");
                    b.Property("Level")
                        .HasColumnType("integer")
                        .HasColumnName("level");
                    b.Property("RewardExperience")
                        .HasColumnType("integer")
                        .HasColumnName("reward_experience");
                    b.Property("RewardPoints")
                        .HasColumnType("numeric")
                        .HasColumnName("reward_points");
                    b.Property>("Tips")
                        .IsRequired()
                        .HasColumnType("jsonb")
                        .HasColumnName("tips");
                    b.Property("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");
                    b.HasKey("Id")
                        .HasName("pk_account_check_in_results");
                    b.HasIndex("AccountId")
                        .HasDatabaseName("ix_account_check_in_results_account_id");
                    b.ToTable("account_check_in_results", (string)null);
                });
            modelBuilder.Entity("DysonNetwork.Sphere.Account.MagicSpell", b =>
                {
                    b.Property("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");
                    b.Property("AccountId")
                        .HasColumnType("uuid")
                        .HasColumnName("account_id");
                    b.Property("AffectedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("affected_at");
                    b.Property("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");
                    b.Property("DeletedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("deleted_at");
                    b.Property("ExpiresAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("expires_at");
                    b.Property>("Meta")
                        .IsRequired()
                        .HasColumnType("jsonb")
                        .HasColumnName("meta");
                    b.Property("Spell")
                        .IsRequired()
                        .HasMaxLength(1024)
                        .HasColumnType("character varying(1024)")
                        .HasColumnName("spell");
                    b.Property("Type")
                        .HasColumnType("integer")
                        .HasColumnName("type");
                    b.Property("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");
                    b.HasKey("Id")
                        .HasName("pk_magic_spells");
                    b.HasIndex("AccountId")
                        .HasDatabaseName("ix_magic_spells_account_id");
                    b.HasIndex("Spell")
                        .IsUnique()
                        .HasDatabaseName("ix_magic_spells_spell");
                    b.ToTable("magic_spells", (string)null);
                });
            modelBuilder.Entity("DysonNetwork.Sphere.Account.Notification", b =>
                {
                    b.Property("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");
                    b.Property("AccountId")
                        .HasColumnType("uuid")
                        .HasColumnName("account_id");
                    b.Property("Content")
                        .HasMaxLength(4096)
                        .HasColumnType("character varying(4096)")
                        .HasColumnName("content");
                    b.Property("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");
                    b.Property("DeletedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("deleted_at");
                    b.Property>("Meta")
                        .HasColumnType("jsonb")
                        .HasColumnName("meta");
                    b.Property("Priority")
                        .HasColumnType("integer")
                        .HasColumnName("priority");
                    b.Property("Subtitle")
                        .HasMaxLength(2048)
                        .HasColumnType("character varying(2048)")
                        .HasColumnName("subtitle");
                    b.Property("Title")
                        .HasMaxLength(1024)
                        .HasColumnType("character varying(1024)")
                        .HasColumnName("title");
                    b.Property("Topic")
                        .IsRequired()
                        .HasMaxLength(1024)
                        .HasColumnType("character varying(1024)")
                        .HasColumnName("topic");
                    b.Property("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");
                    b.Property("ViewedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("viewed_at");
                    b.HasKey("Id")
                        .HasName("pk_notifications");
                    b.HasIndex("AccountId")
                        .HasDatabaseName("ix_notifications_account_id");
                    b.ToTable("notifications", (string)null);
                });
            modelBuilder.Entity("DysonNetwork.Sphere.Account.NotificationPushSubscription", b =>
                {
                    b.Property("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");
                    b.Property("AccountId")
                        .HasColumnType("uuid")
                        .HasColumnName("account_id");
                    b.Property("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");
                    b.Property("DeletedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("deleted_at");
                    b.Property("DeviceId")
                        .IsRequired()
                        .HasMaxLength(4096)
                        .HasColumnType("character varying(4096)")
                        .HasColumnName("device_id");
                    b.Property("DeviceToken")
                        .IsRequired()
                        .HasMaxLength(4096)
                        .HasColumnType("character varying(4096)")
                        .HasColumnName("device_token");
                    b.Property("LastUsedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("last_used_at");
                    b.Property("Provider")
                        .HasColumnType("integer")
                        .HasColumnName("provider");
                    b.Property("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");
                    b.HasKey("Id")
                        .HasName("pk_notification_push_subscriptions");
                    b.HasIndex("AccountId")
                        .HasDatabaseName("ix_notification_push_subscriptions_account_id");
                    b.HasIndex("DeviceToken", "DeviceId", "AccountId")
                        .IsUnique()
                        .HasDatabaseName("ix_notification_push_subscriptions_device_token_device_id_acco");
                    b.ToTable("notification_push_subscriptions", (string)null);
                });
            modelBuilder.Entity("DysonNetwork.Sphere.Account.Profile", b =>
                {
                    b.Property("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");
                    b.Property("AccountId")
                        .HasColumnType("uuid")
                        .HasColumnName("account_id");
                    b.Property("Background")
                        .HasColumnType("jsonb")
                        .HasColumnName("background");
                    b.Property("BackgroundId")
                        .HasMaxLength(32)
                        .HasColumnType("character varying(32)")
                        .HasColumnName("background_id");
                    b.Property("Bio")
                        .HasMaxLength(4096)
                        .HasColumnType("character varying(4096)")
                        .HasColumnName("bio");
                    b.Property("Birthday")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("birthday");
                    b.Property("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");
                    b.Property("DeletedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("deleted_at");
                    b.Property("Experience")
                        .HasColumnType("integer")
                        .HasColumnName("experience");
                    b.Property("FirstName")
                        .HasMaxLength(256)
                        .HasColumnType("character varying(256)")
                        .HasColumnName("first_name");
                    b.Property("Gender")
                        .HasMaxLength(1024)
                        .HasColumnType("character varying(1024)")
                        .HasColumnName("gender");
                    b.Property("LastName")
                        .HasMaxLength(256)
                        .HasColumnType("character varying(256)")
                        .HasColumnName("last_name");
                    b.Property("LastSeenAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("last_seen_at");
                    b.Property("MiddleName")
                        .HasMaxLength(256)
                        .HasColumnType("character varying(256)")
                        .HasColumnName("middle_name");
                    b.Property("Picture")
                        .HasColumnType("jsonb")
                        .HasColumnName("picture");
                    b.Property("PictureId")
                        .HasMaxLength(32)
                        .HasColumnType("character varying(32)")
                        .HasColumnName("picture_id");
                    b.Property("Pronouns")
                        .HasMaxLength(1024)
                        .HasColumnType("character varying(1024)")
                        .HasColumnName("pronouns");
                    b.Property("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");
                    b.HasKey("Id")
                        .HasName("pk_account_profiles");
                    b.HasIndex("AccountId")
                        .IsUnique()
                        .HasDatabaseName("ix_account_profiles_account_id");
                    b.ToTable("account_profiles", (string)null);
                });
            modelBuilder.Entity("DysonNetwork.Sphere.Account.Relationship", b =>
                {
                    b.Property("AccountId")
                        .HasColumnType("uuid")
                        .HasColumnName("account_id");
                    b.Property("RelatedId")
                        .HasColumnType("uuid")
                        .HasColumnName("related_id");
                    b.Property("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");
                    b.Property("DeletedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("deleted_at");
                    b.Property("ExpiredAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("expired_at");
                    b.Property("Status")
                        .HasColumnType("smallint")
                        .HasColumnName("status");
                    b.Property("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");
                    b.HasKey("AccountId", "RelatedId")
                        .HasName("pk_account_relationships");
                    b.HasIndex("RelatedId")
                        .HasDatabaseName("ix_account_relationships_related_id");
                    b.ToTable("account_relationships", (string)null);
                });
            modelBuilder.Entity("DysonNetwork.Sphere.Account.Status", b =>
                {
                    b.Property("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");
                    b.Property("AccountId")
                        .HasColumnType("uuid")
                        .HasColumnName("account_id");
                    b.Property("Attitude")
                        .HasColumnType("integer")
                        .HasColumnName("attitude");
                    b.Property("ClearedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("cleared_at");
                    b.Property("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");
                    b.Property("DeletedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("deleted_at");
                    b.Property("IsInvisible")
                        .HasColumnType("boolean")
                        .HasColumnName("is_invisible");
                    b.Property("IsNotDisturb")
                        .HasColumnType("boolean")
                        .HasColumnName("is_not_disturb");
                    b.Property("Label")
                        .HasMaxLength(1024)
                        .HasColumnType("character varying(1024)")
                        .HasColumnName("label");
                    b.Property("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");
                    b.HasKey("Id")
                        .HasName("pk_account_statuses");
                    b.HasIndex("AccountId")
                        .HasDatabaseName("ix_account_statuses_account_id");
                    b.ToTable("account_statuses", (string)null);
                });
            modelBuilder.Entity("DysonNetwork.Sphere.Activity.Activity", b =>
                {
                    b.Property("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");
                    b.Property("AccountId")
                        .HasColumnType("uuid")
                        .HasColumnName("account_id");
                    b.Property("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");
                    b.Property("DeletedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("deleted_at");
                    b.Property>("Meta")
                        .IsRequired()
                        .HasColumnType("jsonb")
                        .HasColumnName("meta");
                    b.Property("ResourceIdentifier")
                        .IsRequired()
                        .HasMaxLength(4096)
                        .HasColumnType("character varying(4096)")
                        .HasColumnName("resource_identifier");
                    b.Property("Type")
                        .IsRequired()
                        .HasMaxLength(1024)
                        .HasColumnType("character varying(1024)")
                        .HasColumnName("type");
                    b.Property("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");
                    b.Property>("UsersVisible")
                        .IsRequired()
                        .HasColumnType("jsonb")
                        .HasColumnName("users_visible");
                    b.Property("Visibility")
                        .HasColumnType("integer")
                        .HasColumnName("visibility");
                    b.HasKey("Id")
                        .HasName("pk_activities");
                    b.HasIndex("AccountId")
                        .HasDatabaseName("ix_activities_account_id");
                    b.ToTable("activities", (string)null);
                });
            modelBuilder.Entity("DysonNetwork.Sphere.Auth.Challenge", b =>
                {
                    b.Property("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");
                    b.Property("AccountId")
                        .HasColumnType("uuid")
                        .HasColumnName("account_id");
                    b.Property>("Audiences")
                        .IsRequired()
                        .HasColumnType("jsonb")
                        .HasColumnName("audiences");
                    b.Property>("BlacklistFactors")
                        .IsRequired()
                        .HasColumnType("jsonb")
                        .HasColumnName("blacklist_factors");
                    b.Property("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");
                    b.Property("DeletedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("deleted_at");
                    b.Property("DeviceId")
                        .HasMaxLength(256)
                        .HasColumnType("character varying(256)")
                        .HasColumnName("device_id");
                    b.Property("ExpiredAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("expired_at");
                    b.Property("FailedAttempts")
                        .HasColumnType("integer")
                        .HasColumnName("failed_attempts");
                    b.Property("IpAddress")
                        .HasMaxLength(128)
                        .HasColumnType("character varying(128)")
                        .HasColumnName("ip_address");
                    b.Property("Location")
                        .HasColumnType("geometry")
                        .HasColumnName("location");
                    b.Property("Nonce")
                        .HasMaxLength(1024)
                        .HasColumnType("character varying(1024)")
                        .HasColumnName("nonce");
                    b.Property("Platform")
                        .HasColumnType("integer")
                        .HasColumnName("platform");
                    b.Property>("Scopes")
                        .IsRequired()
                        .HasColumnType("jsonb")
                        .HasColumnName("scopes");
                    b.Property("StepRemain")
                        .HasColumnType("integer")
                        .HasColumnName("step_remain");
                    b.Property("StepTotal")
                        .HasColumnType("integer")
                        .HasColumnName("step_total");
                    b.Property("Type")
                        .HasColumnType("integer")
                        .HasColumnName("type");
                    b.Property("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");
                    b.Property("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("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");
                    b.Property("AccountId")
                        .HasColumnType("uuid")
                        .HasColumnName("account_id");
                    b.Property("ChallengeId")
                        .HasColumnType("uuid")
                        .HasColumnName("challenge_id");
                    b.Property("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");
                    b.Property("DeletedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("deleted_at");
                    b.Property("ExpiredAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("expired_at");
                    b.Property("Label")
                        .HasMaxLength(1024)
                        .HasColumnType("character varying(1024)")
                        .HasColumnName("label");
                    b.Property("LastGrantedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("last_granted_at");
                    b.Property("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.Chat.ChatMember", b =>
                {
                    b.Property("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");
                    b.Property("AccountId")
                        .HasColumnType("uuid")
                        .HasColumnName("account_id");
                    b.Property("ChatRoomId")
                        .HasColumnType("uuid")
                        .HasColumnName("chat_room_id");
                    b.Property("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");
                    b.Property("DeletedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("deleted_at");
                    b.Property("IsBot")
                        .HasColumnType("boolean")
                        .HasColumnName("is_bot");
                    b.Property("JoinedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("joined_at");
                    b.Property("LastReadAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("last_read_at");
                    b.Property("LeaveAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("leave_at");
                    b.Property("Nick")
                        .HasMaxLength(1024)
                        .HasColumnType("character varying(1024)")
                        .HasColumnName("nick");
                    b.Property("Notify")
                        .HasColumnType("integer")
                        .HasColumnName("notify");
                    b.Property("Role")
                        .HasColumnType("integer")
                        .HasColumnName("role");
                    b.Property("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");
                    b.HasKey("Id")
                        .HasName("pk_chat_members");
                    b.HasAlternateKey("ChatRoomId", "AccountId")
                        .HasName("ak_chat_members_chat_room_id_account_id");
                    b.HasIndex("AccountId")
                        .HasDatabaseName("ix_chat_members_account_id");
                    b.ToTable("chat_members", (string)null);
                });
            modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b =>
                {
                    b.Property("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");
                    b.Property("Background")
                        .HasColumnType("jsonb")
                        .HasColumnName("background");
                    b.Property("BackgroundId")
                        .HasMaxLength(32)
                        .HasColumnType("character varying(32)")
                        .HasColumnName("background_id");
                    b.Property("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");
                    b.Property("DeletedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("deleted_at");
                    b.Property("Description")
                        .HasMaxLength(4096)
                        .HasColumnType("character varying(4096)")
                        .HasColumnName("description");
                    b.Property("IsCommunity")
                        .HasColumnType("boolean")
                        .HasColumnName("is_community");
                    b.Property("IsPublic")
                        .HasColumnType("boolean")
                        .HasColumnName("is_public");
                    b.Property("Name")
                        .HasMaxLength(1024)
                        .HasColumnType("character varying(1024)")
                        .HasColumnName("name");
                    b.Property("Picture")
                        .HasColumnType("jsonb")
                        .HasColumnName("picture");
                    b.Property("PictureId")
                        .HasMaxLength(32)
                        .HasColumnType("character varying(32)")
                        .HasColumnName("picture_id");
                    b.Property("RealmId")
                        .HasColumnType("uuid")
                        .HasColumnName("realm_id");
                    b.Property("Type")
                        .HasColumnType("integer")
                        .HasColumnName("type");
                    b.Property("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");
                    b.HasKey("Id")
                        .HasName("pk_chat_rooms");
                    b.HasIndex("RealmId")
                        .HasDatabaseName("ix_chat_rooms_realm_id");
                    b.ToTable("chat_rooms", (string)null);
                });
            modelBuilder.Entity("DysonNetwork.Sphere.Chat.Message", b =>
                {
                    b.Property("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");
                    b.Property>("Attachments")
                        .IsRequired()
                        .HasColumnType("jsonb")
                        .HasColumnName("attachments");
                    b.Property("ChatRoomId")
                        .HasColumnType("uuid")
                        .HasColumnName("chat_room_id");
                    b.Property("Content")
                        .HasMaxLength(4096)
                        .HasColumnType("character varying(4096)")
                        .HasColumnName("content");
                    b.Property("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");
                    b.Property("DeletedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("deleted_at");
                    b.Property("EditedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("edited_at");
                    b.Property("ForwardedMessageId")
                        .HasColumnType("uuid")
                        .HasColumnName("forwarded_message_id");
                    b.Property>("MembersMentioned")
                        .HasColumnType("jsonb")
                        .HasColumnName("members_mentioned");
                    b.Property>("Meta")
                        .HasColumnType("jsonb")
                        .HasColumnName("meta");
                    b.Property("Nonce")
                        .IsRequired()
                        .HasMaxLength(36)
                        .HasColumnType("character varying(36)")
                        .HasColumnName("nonce");
                    b.Property("RepliedMessageId")
                        .HasColumnType("uuid")
                        .HasColumnName("replied_message_id");
                    b.Property("SenderId")
                        .HasColumnType("uuid")
                        .HasColumnName("sender_id");
                    b.Property("Type")
                        .IsRequired()
                        .HasMaxLength(1024)
                        .HasColumnType("character varying(1024)")
                        .HasColumnName("type");
                    b.Property("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");
                    b.HasKey("Id")
                        .HasName("pk_chat_messages");
                    b.HasIndex("ChatRoomId")
                        .HasDatabaseName("ix_chat_messages_chat_room_id");
                    b.HasIndex("ForwardedMessageId")
                        .HasDatabaseName("ix_chat_messages_forwarded_message_id");
                    b.HasIndex("RepliedMessageId")
                        .HasDatabaseName("ix_chat_messages_replied_message_id");
                    b.HasIndex("SenderId")
                        .HasDatabaseName("ix_chat_messages_sender_id");
                    b.ToTable("chat_messages", (string)null);
                });
            modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageReaction", b =>
                {
                    b.Property("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");
                    b.Property("Attitude")
                        .HasColumnType("integer")
                        .HasColumnName("attitude");
                    b.Property("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");
                    b.Property("DeletedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("deleted_at");
                    b.Property("MessageId")
                        .HasColumnType("uuid")
                        .HasColumnName("message_id");
                    b.Property("SenderId")
                        .HasColumnType("uuid")
                        .HasColumnName("sender_id");
                    b.Property("Symbol")
                        .IsRequired()
                        .HasMaxLength(256)
                        .HasColumnType("character varying(256)")
                        .HasColumnName("symbol");
                    b.Property("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");
                    b.HasKey("Id")
                        .HasName("pk_chat_reactions");
                    b.HasIndex("MessageId")
                        .HasDatabaseName("ix_chat_reactions_message_id");
                    b.HasIndex("SenderId")
                        .HasDatabaseName("ix_chat_reactions_sender_id");
                    b.ToTable("chat_reactions", (string)null);
                });
            modelBuilder.Entity("DysonNetwork.Sphere.Chat.RealtimeCall", b =>
                {
                    b.Property("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");
                    b.Property("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");
                    b.Property("DeletedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("deleted_at");
                    b.Property("EndedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("ended_at");
                    b.Property("ProviderName")
                        .HasColumnType("text")
                        .HasColumnName("provider_name");
                    b.Property("RoomId")
                        .HasColumnType("uuid")
                        .HasColumnName("room_id");
                    b.Property("SenderId")
                        .HasColumnType("uuid")
                        .HasColumnName("sender_id");
                    b.Property("SessionId")
                        .HasColumnType("text")
                        .HasColumnName("session_id");
                    b.Property("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");
                    b.Property("UpstreamConfigJson")
                        .HasColumnType("jsonb")
                        .HasColumnName("upstream");
                    b.HasKey("Id")
                        .HasName("pk_chat_realtime_call");
                    b.HasIndex("RoomId")
                        .HasDatabaseName("ix_chat_realtime_call_room_id");
                    b.HasIndex("SenderId")
                        .HasDatabaseName("ix_chat_realtime_call_sender_id");
                    b.ToTable("chat_realtime_call", (string)null);
                });
            modelBuilder.Entity("DysonNetwork.Sphere.Developer.CustomApp", b =>
                {
                    b.Property("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");
                    b.Property("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");
                    b.Property("DeletedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("deleted_at");
                    b.Property("Name")
                        .IsRequired()
                        .HasMaxLength(1024)
                        .HasColumnType("character varying(1024)")
                        .HasColumnName("name");
                    b.Property("PublisherId")
                        .HasColumnType("uuid")
                        .HasColumnName("publisher_id");
                    b.Property("Slug")
                        .IsRequired()
                        .HasMaxLength(1024)
                        .HasColumnType("character varying(1024)")
                        .HasColumnName("slug");
                    b.Property("Status")
                        .HasColumnType("integer")
                        .HasColumnName("status");
                    b.Property("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");
                    b.Property("VerifiedAs")
                        .HasMaxLength(4096)
                        .HasColumnType("character varying(4096)")
                        .HasColumnName("verified_as");
                    b.Property("VerifiedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("verified_at");
                    b.HasKey("Id")
                        .HasName("pk_custom_apps");
                    b.HasIndex("PublisherId")
                        .HasDatabaseName("ix_custom_apps_publisher_id");
                    b.ToTable("custom_apps", (string)null);
                });
            modelBuilder.Entity("DysonNetwork.Sphere.Developer.CustomAppSecret", b =>
                {
                    b.Property("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");
                    b.Property("AppId")
                        .HasColumnType("uuid")
                        .HasColumnName("app_id");
                    b.Property("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");
                    b.Property("DeletedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("deleted_at");
                    b.Property("ExpiredAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("expired_at");
                    b.Property("Remarks")
                        .HasMaxLength(4096)
                        .HasColumnType("character varying(4096)")
                        .HasColumnName("remarks");
                    b.Property("Secret")
                        .IsRequired()
                        .HasMaxLength(1024)
                        .HasColumnType("character varying(1024)")
                        .HasColumnName("secret");
                    b.Property("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");
                    b.HasKey("Id")
                        .HasName("pk_custom_app_secrets");
                    b.HasIndex("AppId")
                        .HasDatabaseName("ix_custom_app_secrets_app_id");
                    b.ToTable("custom_app_secrets", (string)null);
                });
            modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroup", b =>
                {
                    b.Property("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");
                    b.Property("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");
                    b.Property("DeletedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("deleted_at");
                    b.Property("Key")
                        .IsRequired()
                        .HasMaxLength(1024)
                        .HasColumnType("character varying(1024)")
                        .HasColumnName("key");
                    b.Property("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");
                    b.HasKey("Id")
                        .HasName("pk_permission_groups");
                    b.ToTable("permission_groups", (string)null);
                });
            modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroupMember", b =>
                {
                    b.Property("GroupId")
                        .HasColumnType("uuid")
                        .HasColumnName("group_id");
                    b.Property("Actor")
                        .HasMaxLength(1024)
                        .HasColumnType("character varying(1024)")
                        .HasColumnName("actor");
                    b.Property("AffectedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("affected_at");
                    b.Property("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");
                    b.Property("DeletedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("deleted_at");
                    b.Property("ExpiredAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("expired_at");
                    b.Property("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");
                    b.HasKey("GroupId", "Actor")
                        .HasName("pk_permission_group_members");
                    b.ToTable("permission_group_members", (string)null);
                });
            modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionNode", b =>
                {
                    b.Property("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");
                    b.Property("Actor")
                        .IsRequired()
                        .HasMaxLength(1024)
                        .HasColumnType("character varying(1024)")
                        .HasColumnName("actor");
                    b.Property("AffectedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("affected_at");
                    b.Property("Area")
                        .IsRequired()
                        .HasMaxLength(1024)
                        .HasColumnType("character varying(1024)")
                        .HasColumnName("area");
                    b.Property("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");
                    b.Property("DeletedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("deleted_at");
                    b.Property