// <auto-generated />
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using vassago.Models;

#nullable disable

namespace vassago.Migrations
{
#pragma warning disable 612, 618, 8981
    [DbContext(typeof(ChattingContext))]
    [Migration("20250605145513_datamemos-more-data")]
    partial class datamemosmoredata
    {
        /// <inheritdoc />
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
            modelBuilder
                .HasAnnotation("ProductVersion", "7.0.5")
                .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "hstore");
            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("AccountUAC", b =>
                {
                    b.Property<Guid>("AccountInChannelsId")
                        .HasColumnType("uuid");

                    b.Property<Guid>("UACsId")
                        .HasColumnType("uuid");

                    b.HasKey("AccountInChannelsId", "UACsId");

                    b.HasIndex("UACsId");

                    b.ToTable("AccountUAC");
                });

            modelBuilder.Entity("ChannelUAC", b =>
                {
                    b.Property<Guid>("ChannelsId")
                        .HasColumnType("uuid");

                    b.Property<Guid>("UACsId")
                        .HasColumnType("uuid");

                    b.HasKey("ChannelsId", "UACsId");

                    b.HasIndex("UACsId");

                    b.ToTable("ChannelUAC");
                });

            modelBuilder.Entity("UACUser", b =>
                {
                    b.Property<Guid>("UACsId")
                        .HasColumnType("uuid");

                    b.Property<Guid>("UsersId")
                        .HasColumnType("uuid");

                    b.HasKey("UACsId", "UsersId");

                    b.HasIndex("UsersId");

                    b.ToTable("UACUser");
                });

            modelBuilder.Entity("vassago.Models.Account", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid");

                    b.Property<string>("DisplayName")
                        .HasColumnType("text");

                    b.Property<string>("ExternalId")
                        .HasColumnType("text");

                    b.Property<bool>("IsBot")
                        .HasColumnType("boolean");

                    b.Property<Guid?>("IsUserId")
                        .HasColumnType("uuid");

                    b.Property<string>("Protocol")
                        .HasColumnType("text");

                    b.Property<Guid?>("SeenInChannelId")
                        .HasColumnType("uuid");

                    b.Property<string>("Username")
                        .HasColumnType("text");

                    b.HasKey("Id");

                    b.HasIndex("IsUserId");

                    b.HasIndex("SeenInChannelId");

                    b.ToTable("Accounts");
                });

            modelBuilder.Entity("vassago.Models.Attachment", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid");

                    b.Property<byte[]>("Content")
                        .HasColumnType("bytea");

                    b.Property<string>("ContentType")
                        .HasColumnType("text");

                    b.Property<string>("Description")
                        .HasColumnType("text");

                    b.Property<decimal?>("ExternalId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<string>("Filename")
                        .HasColumnType("text");

                    b.Property<Guid?>("MessageId")
                        .HasColumnType("uuid");

                    b.Property<int>("Size")
                        .HasColumnType("integer");

                    b.Property<string>("Source")
                        .HasColumnType("text");

                    b.HasKey("Id");

                    b.HasIndex("MessageId");

                    b.ToTable("Attachments");
                });

            modelBuilder.Entity("vassago.Models.Channel", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid");

                    b.Property<int>("ChannelType")
                        .HasColumnType("integer");

                    b.Property<string>("DisplayName")
                        .HasColumnType("text");

                    b.Property<string>("ExternalId")
                        .HasColumnType("text");

                    b.Property<int?>("LewdnessFilterLevel")
                        .HasColumnType("integer");

                    b.Property<bool?>("LinksAllowed")
                        .HasColumnType("boolean");

                    b.Property<decimal?>("MaxAttachmentBytes")
                        .HasColumnType("numeric(20,0)");

                    b.Property<long?>("MaxTextChars")
                        .HasColumnType("bigint");

                    b.Property<int?>("MeannessFilterLevel")
                        .HasColumnType("integer");

                    b.Property<Guid?>("ParentChannelId")
                        .HasColumnType("uuid");

                    b.Property<string>("Protocol")
                        .HasColumnType("text");

                    b.Property<bool?>("ReactionsPossible")
                        .HasColumnType("boolean");

                    b.HasKey("Id");

                    b.HasIndex("ParentChannelId");

                    b.ToTable("Channels");
                });

            modelBuilder.Entity("vassago.Models.Message", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid");

                    b.Property<bool>("ActedOn")
                        .HasColumnType("boolean");

                    b.Property<Guid?>("AuthorId")
                        .HasColumnType("uuid");

                    b.Property<Guid?>("ChannelId")
                        .HasColumnType("uuid");

                    b.Property<string>("Content")
                        .HasColumnType("text");

                    b.Property<string>("ExternalId")
                        .HasColumnType("text");

                    b.Property<bool>("MentionsMe")
                        .HasColumnType("boolean");

                    b.Property<string>("Protocol")
                        .HasColumnType("text");

                    b.Property<DateTimeOffset>("Timestamp")
                        .HasColumnType("timestamp with time zone");

                    b.HasKey("Id");

                    b.HasIndex("AuthorId");

                    b.HasIndex("ChannelId");

                    b.ToTable("Messages");
                });

            modelBuilder.Entity("vassago.Models.UAC", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid");

                    b.Property<Dictionary<string, string>>("CommandAliases")
                        .HasColumnType("hstore");

                    b.Property<string>("Description")
                        .HasColumnType("text");

                    b.Property<string>("DisplayName")
                        .HasColumnType("text");

                    b.Property<Dictionary<string, string>>("Localization")
                        .HasColumnType("hstore");

                    b.Property<Guid>("OwnerId")
                        .HasColumnType("uuid");

                    b.HasKey("Id");

                    b.ToTable("UACs");
                });

            modelBuilder.Entity("vassago.Models.User", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid");

                    b.HasKey("Id");

                    b.ToTable("Users");
                });

            modelBuilder.Entity("AccountUAC", b =>
                {
                    b.HasOne("vassago.Models.Account", null)
                        .WithMany()
                        .HasForeignKey("AccountInChannelsId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("vassago.Models.UAC", null)
                        .WithMany()
                        .HasForeignKey("UACsId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("ChannelUAC", b =>
                {
                    b.HasOne("vassago.Models.Channel", null)
                        .WithMany()
                        .HasForeignKey("ChannelsId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("vassago.Models.UAC", null)
                        .WithMany()
                        .HasForeignKey("UACsId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("UACUser", b =>
                {
                    b.HasOne("vassago.Models.UAC", null)
                        .WithMany()
                        .HasForeignKey("UACsId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("vassago.Models.User", null)
                        .WithMany()
                        .HasForeignKey("UsersId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("vassago.Models.Account", b =>
                {
                    b.HasOne("vassago.Models.User", "IsUser")
                        .WithMany("Accounts")
                        .HasForeignKey("IsUserId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("vassago.Models.Channel", "SeenInChannel")
                        .WithMany("Users")
                        .HasForeignKey("SeenInChannelId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.Navigation("IsUser");

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

            modelBuilder.Entity("vassago.Models.Attachment", b =>
                {
                    b.HasOne("vassago.Models.Message", "Message")
                        .WithMany("Attachments")
                        .HasForeignKey("MessageId")
                        .OnDelete(DeleteBehavior.Cascade);

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

            modelBuilder.Entity("vassago.Models.Channel", b =>
                {
                    b.HasOne("vassago.Models.Channel", "ParentChannel")
                        .WithMany("SubChannels")
                        .HasForeignKey("ParentChannelId")
                        .OnDelete(DeleteBehavior.Cascade);

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

            modelBuilder.Entity("vassago.Models.Message", b =>
                {
                    b.HasOne("vassago.Models.Account", "Author")
                        .WithMany()
                        .HasForeignKey("AuthorId");

                    b.HasOne("vassago.Models.Channel", "Channel")
                        .WithMany("Messages")
                        .HasForeignKey("ChannelId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.Navigation("Author");

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

            modelBuilder.Entity("vassago.Models.Channel", b =>
                {
                    b.Navigation("Messages");

                    b.Navigation("SubChannels");

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

            modelBuilder.Entity("vassago.Models.Message", b =>
                {
                    b.Navigation("Attachments");
                });

            modelBuilder.Entity("vassago.Models.User", b =>
                {
                    b.Navigation("Accounts");
                });
#pragma warning restore 612, 618, 8981
        }
    }
}
