// 
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("20250807133702_InitialMigration")]
    partial class InitialMigration
    {
        /// 
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "9.0.7")
                .HasAnnotation("Relational:MaxIdentifierLength", 63);
            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
            modelBuilder.Entity("DysonNetwork.Develop.Identity.CustomApp", b =>
                {
                    b.Property("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");
                    b.Property("Background")
                        .HasColumnType("jsonb")
                        .HasColumnName("background");
                    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("DeveloperId")
                        .HasColumnType("uuid")
                        .HasColumnName("developer_id");
                    b.Property("Links")
                        .HasColumnType("jsonb")
                        .HasColumnName("links");
                    b.Property("Name")
                        .IsRequired()
                        .HasMaxLength(1024)
                        .HasColumnType("character varying(1024)")
                        .HasColumnName("name");
                    b.Property("OauthConfig")
                        .HasColumnType("jsonb")
                        .HasColumnName("oauth_config");
                    b.Property("Picture")
                        .HasColumnType("jsonb")
                        .HasColumnName("picture");
                    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("Verification")
                        .HasColumnType("jsonb")
                        .HasColumnName("verification");
                    b.HasKey("Id")
                        .HasName("pk_custom_apps");
                    b.HasIndex("DeveloperId")
                        .HasDatabaseName("ix_custom_apps_developer_id");
                    b.ToTable("custom_apps", (string)null);
                });
            modelBuilder.Entity("DysonNetwork.Develop.Identity.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("Description")
                        .HasMaxLength(4096)
                        .HasColumnType("character varying(4096)")
                        .HasColumnName("description");
                    b.Property("ExpiredAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("expired_at");
                    b.Property("IsOidc")
                        .HasColumnType("boolean")
                        .HasColumnName("is_oidc");
                    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.Develop.Identity.Developer", b =>
                {
                    b.Property("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");
                    b.Property("PublisherId")
                        .HasColumnType("uuid")
                        .HasColumnName("publisher_id");
                    b.HasKey("Id")
                        .HasName("pk_developers");
                    b.ToTable("developers", (string)null);
                });
            modelBuilder.Entity("DysonNetwork.Develop.Identity.CustomApp", b =>
                {
                    b.HasOne("DysonNetwork.Develop.Identity.Developer", "Developer")
                        .WithMany()
                        .HasForeignKey("DeveloperId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_custom_apps_developers_developer_id");
                    b.Navigation("Developer");
                });
            modelBuilder.Entity("DysonNetwork.Develop.Identity.CustomAppSecret", b =>
                {
                    b.HasOne("DysonNetwork.Develop.Identity.CustomApp", "App")
                        .WithMany("Secrets")
                        .HasForeignKey("AppId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_custom_app_secrets_custom_apps_app_id");
                    b.Navigation("App");
                });
            modelBuilder.Entity("DysonNetwork.Develop.Identity.CustomApp", b =>
                {
                    b.Navigation("Secrets");
                });
#pragma warning restore 612, 618
        }
    }
}