// <auto-generated />
using System;
using DysonNetwork.Develop;
using DysonNetwork.Shared.Models;
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.Develop.Migrations
{
    [DbContext(typeof(AppDatabase))]
    [Migration("20260117175714_AddMiniApp")]
    partial class AddMiniApp
    {
        /// <inheritdoc />
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "10.0.1")
                .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("DysonNetwork.Shared.Models.SnBotAccount", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("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>("IsActive")
                        .HasColumnType("boolean")
                        .HasColumnName("is_active");

                    b.Property<Guid>("ProjectId")
                        .HasColumnType("uuid")
                        .HasColumnName("project_id");

                    b.Property<string>("Slug")
                        .IsRequired()
                        .HasMaxLength(1024)
                        .HasColumnType("character varying(1024)")
                        .HasColumnName("slug");

                    b.Property<Instant>("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");

                    b.HasKey("Id")
                        .HasName("pk_bot_accounts");

                    b.HasIndex("ProjectId")
                        .HasDatabaseName("ix_bot_accounts_project_id");

                    b.ToTable("bot_accounts", (string)null);
                });

            modelBuilder.Entity("DysonNetwork.Shared.Models.SnCustomApp", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<SnCloudFileReferenceObject>("Background")
                        .HasColumnType("jsonb")
                        .HasColumnName("background");

                    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<SnCustomAppLinks>("Links")
                        .HasColumnType("jsonb")
                        .HasColumnName("links");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(1024)
                        .HasColumnType("character varying(1024)")
                        .HasColumnName("name");

                    b.Property<SnCustomAppOauthConfig>("OauthConfig")
                        .HasColumnType("jsonb")
                        .HasColumnName("oauth_config");

                    b.Property<SnCloudFileReferenceObject>("Picture")
                        .HasColumnType("jsonb")
                        .HasColumnName("picture");

                    b.Property<Guid>("ProjectId")
                        .HasColumnType("uuid")
                        .HasColumnName("project_id");

                    b.Property<string>("Slug")
                        .IsRequired()
                        .HasMaxLength(1024)
                        .HasColumnType("character varying(1024)")
                        .HasColumnName("slug");

                    b.Property<int>("Status")
                        .HasColumnType("integer")
                        .HasColumnName("status");

                    b.Property<Instant>("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");

                    b.Property<SnVerificationMark>("Verification")
                        .HasColumnType("jsonb")
                        .HasColumnName("verification");

                    b.HasKey("Id")
                        .HasName("pk_custom_apps");

                    b.HasIndex("ProjectId")
                        .HasDatabaseName("ix_custom_apps_project_id");

                    b.ToTable("custom_apps", (string)null);
                });

            modelBuilder.Entity("DysonNetwork.Shared.Models.SnCustomAppSecret", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<Guid>("AppId")
                        .HasColumnType("uuid")
                        .HasColumnName("app_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<Instant?>("ExpiredAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("expired_at");

                    b.Property<bool>("IsOidc")
                        .HasColumnType("boolean")
                        .HasColumnName("is_oidc");

                    b.Property<string>("Secret")
                        .IsRequired()
                        .HasMaxLength(1024)
                        .HasColumnType("character varying(1024)")
                        .HasColumnName("secret");

                    b.Property<Instant>("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.Shared.Models.SnDevProject", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("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")
                        .IsRequired()
                        .HasMaxLength(4096)
                        .HasColumnType("character varying(4096)")
                        .HasColumnName("description");

                    b.Property<Guid>("DeveloperId")
                        .HasColumnType("uuid")
                        .HasColumnName("developer_id");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(1024)
                        .HasColumnType("character varying(1024)")
                        .HasColumnName("name");

                    b.Property<string>("Slug")
                        .IsRequired()
                        .HasMaxLength(1024)
                        .HasColumnType("character varying(1024)")
                        .HasColumnName("slug");

                    b.Property<Instant>("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");

                    b.HasKey("Id")
                        .HasName("pk_dev_projects");

                    b.HasIndex("DeveloperId")
                        .HasDatabaseName("ix_dev_projects_developer_id");

                    b.ToTable("dev_projects", (string)null);
                });

            modelBuilder.Entity("DysonNetwork.Shared.Models.SnDeveloper", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<Guid>("PublisherId")
                        .HasColumnType("uuid")
                        .HasColumnName("publisher_id");

                    b.HasKey("Id")
                        .HasName("pk_developers");

                    b.ToTable("developers", (string)null);
                });

            modelBuilder.Entity("DysonNetwork.Shared.Models.SnMiniApp", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("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<MiniAppManifest>("Manifest")
                        .IsRequired()
                        .HasColumnType("jsonb")
                        .HasColumnName("manifest");

                    b.Property<Guid>("ProjectId")
                        .HasColumnType("uuid")
                        .HasColumnName("project_id");

                    b.Property<string>("Slug")
                        .IsRequired()
                        .HasMaxLength(1024)
                        .HasColumnType("character varying(1024)")
                        .HasColumnName("slug");

                    b.Property<int>("Stage")
                        .HasColumnType("integer")
                        .HasColumnName("stage");

                    b.Property<Instant>("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");

                    b.HasKey("Id")
                        .HasName("pk_mini_apps");

                    b.HasIndex("ProjectId")
                        .HasDatabaseName("ix_mini_apps_project_id");

                    b.ToTable("mini_apps", (string)null);
                });

            modelBuilder.Entity("DysonNetwork.Shared.Models.SnBotAccount", b =>
                {
                    b.HasOne("DysonNetwork.Shared.Models.SnDevProject", "Project")
                        .WithMany()
                        .HasForeignKey("ProjectId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_bot_accounts_dev_projects_project_id");

                    b.Navigation("Project");
                });

            modelBuilder.Entity("DysonNetwork.Shared.Models.SnCustomApp", b =>
                {
                    b.HasOne("DysonNetwork.Shared.Models.SnDevProject", "Project")
                        .WithMany()
                        .HasForeignKey("ProjectId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_custom_apps_dev_projects_project_id");

                    b.Navigation("Project");
                });

            modelBuilder.Entity("DysonNetwork.Shared.Models.SnCustomAppSecret", b =>
                {
                    b.HasOne("DysonNetwork.Shared.Models.SnCustomApp", "App")
                        .WithMany("Secrets")
                        .HasForeignKey("AppId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_custom_app_secrets_custom_apps_app_id");

                    b.Navigation("App");
                });

            modelBuilder.Entity("DysonNetwork.Shared.Models.SnDevProject", b =>
                {
                    b.HasOne("DysonNetwork.Shared.Models.SnDeveloper", "Developer")
                        .WithMany("Projects")
                        .HasForeignKey("DeveloperId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_dev_projects_developers_developer_id");

                    b.Navigation("Developer");
                });

            modelBuilder.Entity("DysonNetwork.Shared.Models.SnMiniApp", b =>
                {
                    b.HasOne("DysonNetwork.Shared.Models.SnDevProject", "Project")
                        .WithMany()
                        .HasForeignKey("ProjectId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_mini_apps_dev_projects_project_id");

                    b.Navigation("Project");
                });

            modelBuilder.Entity("DysonNetwork.Shared.Models.SnCustomApp", b =>
                {
                    b.Navigation("Secrets");
                });

            modelBuilder.Entity("DysonNetwork.Shared.Models.SnDeveloper", b =>
                {
                    b.Navigation("Projects");
                });
#pragma warning restore 612, 618
        }
    }
}
