﻿// <auto-generated />
using System;
using System.Text.Json;
using FilterLists.Directory.Domain.Aggregates;
using FilterLists.Directory.Infrastructure.Persistence.Queries.Context;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;

#nullable disable

namespace FilterLists.Directory.Infrastructure.Migrations.Migrations
{
    [DbContext(typeof(QueryDbContext))]
    [Migration("20211205175314_Initial")]
    partial class Initial
    {
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "6.0.0")
                .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "aggregate_type", new[] { "filter_list", "language", "license", "maintainer", "software", "syntax", "tag" });
            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.HasSequence("EntityFrameworkHiLoSequence-FilterListViewUrl")
                .StartsAt(3000L)
                .IncrementsBy(3);

            modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Change", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint")
                        .HasColumnName("id");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));

                    b.Property<JsonDocument>("After")
                        .HasColumnType("jsonb")
                        .HasColumnName("after");

                    b.Property<AggregateType>("AggregateType")
                        .HasColumnType("aggregate_type")
                        .HasColumnName("aggregate_type");

                    b.Property<DateTime?>("ApprovedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("approved_at");

                    b.Property<JsonDocument>("Before")
                        .HasColumnType("jsonb")
                        .HasColumnName("before");

                    b.Property<long?>("FilterListId")
                        .HasColumnType("bigint")
                        .HasColumnName("filter_list_id");

                    b.Property<long?>("LanguageId")
                        .HasColumnType("bigint")
                        .HasColumnName("language_id");

                    b.Property<long?>("LicenseId")
                        .HasColumnType("bigint")
                        .HasColumnName("license_id");

                    b.Property<long?>("MaintainerId")
                        .HasColumnType("bigint")
                        .HasColumnName("maintainer_id");

                    b.Property<string>("Reason")
                        .HasColumnType("text")
                        .HasColumnName("reason");

                    b.Property<DateTime?>("RejectedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("rejected_at");

                    b.Property<string>("RejectedReason")
                        .HasColumnType("text")
                        .HasColumnName("rejected_reason");

                    b.Property<long?>("SoftwareId")
                        .HasColumnType("bigint")
                        .HasColumnName("software_id");

                    b.Property<DateTime>("SubmittedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("submitted_at")
                        .HasDefaultValueSql("CURRENT_TIMESTAMP");

                    b.Property<long?>("SyntaxId")
                        .HasColumnType("bigint")
                        .HasColumnName("syntax_id");

                    b.Property<long?>("TagId")
                        .HasColumnType("bigint")
                        .HasColumnName("tag_id");

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

                    b.HasIndex("FilterListId")
                        .HasDatabaseName("ix_changes_filter_list_id");

                    b.HasIndex("LanguageId")
                        .HasDatabaseName("ix_changes_language_id");

                    b.HasIndex("LicenseId")
                        .HasDatabaseName("ix_changes_license_id");

                    b.HasIndex("MaintainerId")
                        .HasDatabaseName("ix_changes_maintainer_id");

                    b.HasIndex("SoftwareId")
                        .HasDatabaseName("ix_changes_software_id");

                    b.HasIndex("SyntaxId")
                        .HasDatabaseName("ix_changes_syntax_id");

                    b.HasIndex("TagId")
                        .HasDatabaseName("ix_changes_tag_id");

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

            modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Dependent", b =>
                {
                    b.Property<long>("DependencyFilterListId")
                        .HasColumnType("bigint")
                        .HasColumnName("dependency_filter_list_id");

                    b.Property<long>("DependentFilterListId")
                        .HasColumnType("bigint")
                        .HasColumnName("dependent_filter_list_id");

                    b.HasKey("DependencyFilterListId", "DependentFilterListId")
                        .HasName("pk_dependents");

                    b.HasIndex("DependentFilterListId")
                        .HasDatabaseName("ix_dependents_dependent_filter_list_id");

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

            modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterList", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint")
                        .HasColumnName("id");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));

                    b.Property<string>("ChatUrl")
                        .HasColumnType("text")
                        .HasColumnName("chat_url");

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

                    b.Property<string>("DonateUrl")
                        .HasColumnType("text")
                        .HasColumnName("donate_url");

                    b.Property<string>("EmailAddress")
                        .HasColumnType("text")
                        .HasColumnName("email_address");

                    b.Property<string>("ForumUrl")
                        .HasColumnType("text")
                        .HasColumnName("forum_url");

                    b.Property<string>("HomeUrl")
                        .HasColumnType("text")
                        .HasColumnName("home_url");

                    b.Property<bool>("IsApproved")
                        .HasColumnType("boolean")
                        .HasColumnName("is_approved");

                    b.Property<string>("IssuesUrl")
                        .HasColumnType("text")
                        .HasColumnName("issues_url");

                    b.Property<long>("LicenseId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint")
                        .HasDefaultValue(5L)
                        .HasColumnName("license_id");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("text")
                        .HasColumnName("name");

                    b.Property<string>("OnionUrl")
                        .HasColumnType("text")
                        .HasColumnName("onion_url");

                    b.Property<string>("PolicyUrl")
                        .HasColumnType("text")
                        .HasColumnName("policy_url");

                    b.Property<string>("SubmissionUrl")
                        .HasColumnType("text")
                        .HasColumnName("submission_url");

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

                    b.HasIndex("LicenseId")
                        .HasDatabaseName("ix_filter_lists_license_id");

                    b.HasIndex("Name")
                        .IsUnique()
                        .HasDatabaseName("ix_filter_lists_name");

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

            modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterListLanguage", b =>
                {
                    b.Property<long>("FilterListId")
                        .HasColumnType("bigint")
                        .HasColumnName("filter_list_id");

                    b.Property<long>("LanguageId")
                        .HasColumnType("bigint")
                        .HasColumnName("language_id");

                    b.HasKey("FilterListId", "LanguageId")
                        .HasName("pk_filter_list_languages");

                    b.HasIndex("LanguageId")
                        .HasDatabaseName("ix_filter_list_languages_language_id");

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

            modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterListMaintainer", b =>
                {
                    b.Property<long>("FilterListId")
                        .HasColumnType("bigint")
                        .HasColumnName("filter_list_id");

                    b.Property<long>("MaintainerId")
                        .HasColumnType("bigint")
                        .HasColumnName("maintainer_id");

                    b.HasKey("FilterListId", "MaintainerId")
                        .HasName("pk_filter_list_maintainers");

                    b.HasIndex("MaintainerId")
                        .HasDatabaseName("ix_filter_list_maintainers_maintainer_id");

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

            modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterListSyntax", b =>
                {
                    b.Property<long>("FilterListId")
                        .HasColumnType("bigint")
                        .HasColumnName("filter_list_id");

                    b.Property<long>("SyntaxId")
                        .HasColumnType("bigint")
                        .HasColumnName("syntax_id");

                    b.HasKey("FilterListId", "SyntaxId")
                        .HasName("pk_filter_list_syntaxes");

                    b.HasIndex("SyntaxId")
                        .HasDatabaseName("ix_filter_list_syntaxes_syntax_id");

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

            modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterListTag", b =>
                {
                    b.Property<long>("FilterListId")
                        .HasColumnType("bigint")
                        .HasColumnName("filter_list_id");

                    b.Property<long>("TagId")
                        .HasColumnType("bigint")
                        .HasColumnName("tag_id");

                    b.HasKey("FilterListId", "TagId")
                        .HasName("pk_filter_list_tags");

                    b.HasIndex("TagId")
                        .HasDatabaseName("ix_filter_list_tags_tag_id");

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

            modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Fork", b =>
                {
                    b.Property<long>("UpstreamFilterListId")
                        .HasColumnType("bigint")
                        .HasColumnName("upstream_filter_list_id");

                    b.Property<long>("ForkFilterListId")
                        .HasColumnType("bigint")
                        .HasColumnName("fork_filter_list_id");

                    b.HasKey("UpstreamFilterListId", "ForkFilterListId")
                        .HasName("pk_forks");

                    b.HasIndex("ForkFilterListId")
                        .HasDatabaseName("ix_forks_fork_filter_list_id");

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

            modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Language", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint")
                        .HasColumnName("id");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));

                    b.Property<bool>("IsApproved")
                        .HasColumnType("boolean")
                        .HasColumnName("is_approved");

                    b.Property<string>("Iso6391")
                        .IsRequired()
                        .HasMaxLength(2)
                        .HasColumnType("character(2)")
                        .HasColumnName("iso6391")
                        .IsFixedLength();

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("text")
                        .HasColumnName("name");

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

                    b.HasIndex("Iso6391")
                        .IsUnique()
                        .HasDatabaseName("ix_languages_iso6391");

                    b.HasIndex("Name")
                        .IsUnique()
                        .HasDatabaseName("ix_languages_name");

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

            modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.License", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint")
                        .HasColumnName("id");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));

                    b.Property<bool>("IsApproved")
                        .HasColumnType("boolean")
                        .HasColumnName("is_approved");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("text")
                        .HasColumnName("name");

                    b.Property<bool>("PermitsCommercialUse")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("boolean")
                        .HasDefaultValue(false)
                        .HasColumnName("permits_commercial_use");

                    b.Property<bool>("PermitsDistribution")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("boolean")
                        .HasDefaultValue(false)
                        .HasColumnName("permits_distribution");

                    b.Property<bool>("PermitsModification")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("boolean")
                        .HasDefaultValue(false)
                        .HasColumnName("permits_modification");

                    b.Property<string>("Url")
                        .HasColumnType("text")
                        .HasColumnName("url");

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

                    b.HasIndex("Name")
                        .IsUnique()
                        .HasDatabaseName("ix_licenses_name");

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

            modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Maintainer", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint")
                        .HasColumnName("id");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));

                    b.Property<string>("EmailAddress")
                        .HasColumnType("text")
                        .HasColumnName("email_address");

                    b.Property<bool>("IsApproved")
                        .HasColumnType("boolean")
                        .HasColumnName("is_approved");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("text")
                        .HasColumnName("name");

                    b.Property<string>("TwitterHandle")
                        .HasColumnType("text")
                        .HasColumnName("twitter_handle");

                    b.Property<string>("Url")
                        .HasColumnType("text")
                        .HasColumnName("url");

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

                    b.HasIndex("Name")
                        .IsUnique()
                        .HasDatabaseName("ix_maintainers_name");

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

            modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Merge", b =>
                {
                    b.Property<long>("IncludedInFilterListId")
                        .HasColumnType("bigint")
                        .HasColumnName("included_in_filter_list_id");

                    b.Property<long>("IncludesFilterListId")
                        .HasColumnType("bigint")
                        .HasColumnName("includes_filter_list_id");

                    b.HasKey("IncludedInFilterListId", "IncludesFilterListId")
                        .HasName("pk_merges");

                    b.HasIndex("IncludesFilterListId")
                        .HasDatabaseName("ix_merges_includes_filter_list_id");

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

            modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Software", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint")
                        .HasColumnName("id");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));

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

                    b.Property<string>("DownloadUrl")
                        .HasColumnType("text")
                        .HasColumnName("download_url");

                    b.Property<string>("HomeUrl")
                        .HasColumnType("text")
                        .HasColumnName("home_url");

                    b.Property<bool>("IsApproved")
                        .HasColumnType("boolean")
                        .HasColumnName("is_approved");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("text")
                        .HasColumnName("name");

                    b.Property<bool>("SupportsAbpUrlScheme")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("boolean")
                        .HasDefaultValue(false)
                        .HasColumnName("supports_abp_url_scheme");

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

                    b.HasIndex("Name")
                        .IsUnique()
                        .HasDatabaseName("ix_software_name");

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

            modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.SoftwareSyntax", b =>
                {
                    b.Property<long>("SoftwareId")
                        .HasColumnType("bigint")
                        .HasColumnName("software_id");

                    b.Property<long>("SyntaxId")
                        .HasColumnType("bigint")
                        .HasColumnName("syntax_id");

                    b.HasKey("SoftwareId", "SyntaxId")
                        .HasName("pk_software_syntaxes");

                    b.HasIndex("SyntaxId")
                        .HasDatabaseName("ix_software_syntaxes_syntax_id");

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

            modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Syntax", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint")
                        .HasColumnName("id");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));

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

                    b.Property<bool>("IsApproved")
                        .HasColumnType("boolean")
                        .HasColumnName("is_approved");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("text")
                        .HasColumnName("name");

                    b.Property<string>("Url")
                        .HasColumnType("text")
                        .HasColumnName("url");

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

                    b.HasIndex("Name")
                        .IsUnique()
                        .HasDatabaseName("ix_syntaxes_name");

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

            modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Tag", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint")
                        .HasColumnName("id");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));

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

                    b.Property<bool>("IsApproved")
                        .HasColumnType("boolean")
                        .HasColumnName("is_approved");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("text")
                        .HasColumnName("name");

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

                    b.HasIndex("Name")
                        .IsUnique()
                        .HasDatabaseName("ix_tags_name");

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

            modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Change", b =>
                {
                    b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterList", null)
                        .WithMany("Changes")
                        .HasForeignKey("FilterListId")
                        .HasConstraintName("fk_changes_filter_lists_filter_list_id");

                    b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Language", null)
                        .WithMany("Changes")
                        .HasForeignKey("LanguageId")
                        .HasConstraintName("fk_changes_languages_language_id");

                    b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.License", null)
                        .WithMany("Changes")
                        .HasForeignKey("LicenseId")
                        .HasConstraintName("fk_changes_licenses_license_id");

                    b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Maintainer", null)
                        .WithMany("Changes")
                        .HasForeignKey("MaintainerId")
                        .HasConstraintName("fk_changes_maintainers_maintainer_id");

                    b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Software", null)
                        .WithMany("Changes")
                        .HasForeignKey("SoftwareId")
                        .HasConstraintName("fk_changes_software_software_id");

                    b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Syntax", null)
                        .WithMany("Changes")
                        .HasForeignKey("SyntaxId")
                        .HasConstraintName("fk_changes_syntaxes_syntax_id");

                    b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Tag", null)
                        .WithMany("Changes")
                        .HasForeignKey("TagId")
                        .HasConstraintName("fk_changes_tags_tag_id");
                });

            modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Dependent", b =>
                {
                    b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterList", "DependencyFilterList")
                        .WithMany("DependentFilterLists")
                        .HasForeignKey("DependencyFilterListId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_dependents_filter_lists_dependency_filter_list_id");

                    b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterList", "DependentFilterList")
                        .WithMany("DependencyFilterLists")
                        .HasForeignKey("DependentFilterListId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_dependents_filter_lists_dependent_filter_list_id");

                    b.Navigation("DependencyFilterList");

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

            modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterList", b =>
                {
                    b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.License", "License")
                        .WithMany("FilterLists")
                        .HasForeignKey("LicenseId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired()
                        .HasConstraintName("fk_filter_lists_licenses_license_id");

                    b.OwnsMany("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterListViewUrl", "ViewUrls", b1 =>
                        {
                            b1.Property<long>("FilterListId")
                                .HasColumnType("bigint")
                                .HasColumnName("filter_list_id");

                            b1.Property<long>("Id")
                                .ValueGeneratedOnAdd()
                                .HasColumnType("bigint")
                                .HasColumnName("id");

                            NpgsqlPropertyBuilderExtensions.UseHiLo(b1.Property<long>("Id"), "EntityFrameworkHiLoSequence-FilterListViewUrl");

                            b1.Property<short>("Primariness")
                                .ValueGeneratedOnAdd()
                                .HasColumnType("smallint")
                                .HasDefaultValue((short)1)
                                .HasColumnName("primariness");

                            b1.Property<short>("SegmentNumber")
                                .ValueGeneratedOnAdd()
                                .HasColumnType("smallint")
                                .HasDefaultValue((short)1)
                                .HasColumnName("segment_number");

                            b1.Property<string>("Url")
                                .IsRequired()
                                .HasColumnType("text")
                                .HasColumnName("url");

                            b1.HasKey("FilterListId", "Id")
                                .HasName("pk_filter_list_view_urls");

                            b1.HasIndex("FilterListId", "SegmentNumber", "Primariness")
                                .IsUnique()
                                .HasDatabaseName("ix_filter_list_view_urls_filter_list_id_segment_number_primari");

                            b1.ToTable("filter_list_view_urls", (string)null);

                            b1.WithOwner("FilterList")
                                .HasForeignKey("FilterListId")
                                .HasConstraintName("fk_filter_list_view_urls_filter_lists_filter_list_id");

                            b1.Navigation("FilterList");
                        });

                    b.Navigation("License");

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

            modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterListLanguage", b =>
                {
                    b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterList", "FilterList")
                        .WithMany("FilterListLanguages")
                        .HasForeignKey("FilterListId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_filter_list_languages_filter_lists_filter_list_id");

                    b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Language", "Language")
                        .WithMany("FilterListLanguages")
                        .HasForeignKey("LanguageId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_filter_list_languages_languages_language_id");

                    b.Navigation("FilterList");

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

            modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterListMaintainer", b =>
                {
                    b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterList", "FilterList")
                        .WithMany("FilterListMaintainers")
                        .HasForeignKey("FilterListId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_filter_list_maintainers_filter_lists_filter_list_id");

                    b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Maintainer", "Maintainer")
                        .WithMany("FilterListMaintainers")
                        .HasForeignKey("MaintainerId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_filter_list_maintainers_maintainers_maintainer_id");

                    b.Navigation("FilterList");

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

            modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterListSyntax", b =>
                {
                    b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterList", "FilterList")
                        .WithMany("FilterListSyntaxes")
                        .HasForeignKey("FilterListId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_filter_list_syntaxes_filter_lists_filter_list_id");

                    b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Syntax", "Syntax")
                        .WithMany("FilterListSyntaxes")
                        .HasForeignKey("SyntaxId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_filter_list_syntaxes_syntaxes_syntax_id");

                    b.Navigation("FilterList");

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

            modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterListTag", b =>
                {
                    b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterList", "FilterList")
                        .WithMany("FilterListTags")
                        .HasForeignKey("FilterListId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_filter_list_tags_filter_lists_filter_list_id");

                    b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Tag", "Tag")
                        .WithMany("FilterListTags")
                        .HasForeignKey("TagId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_filter_list_tags_tags_tag_id");

                    b.Navigation("FilterList");

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

            modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Fork", b =>
                {
                    b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterList", "ForkFilterList")
                        .WithMany("UpstreamFilterLists")
                        .HasForeignKey("ForkFilterListId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_forks_filter_lists_fork_filter_list_id");

                    b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterList", "UpstreamFilterList")
                        .WithMany("ForkFilterLists")
                        .HasForeignKey("UpstreamFilterListId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_forks_filter_lists_upstream_filter_list_id");

                    b.Navigation("ForkFilterList");

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

            modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Merge", b =>
                {
                    b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterList", "IncludedInFilterList")
                        .WithMany("IncludesFilterLists")
                        .HasForeignKey("IncludedInFilterListId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_merges_filter_lists_included_in_filter_list_id");

                    b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterList", "IncludesFilterList")
                        .WithMany("IncludedInFilterLists")
                        .HasForeignKey("IncludesFilterListId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_merges_filter_lists_includes_filter_list_id");

                    b.Navigation("IncludedInFilterList");

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

            modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.SoftwareSyntax", b =>
                {
                    b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Software", "Software")
                        .WithMany("SoftwareSyntaxes")
                        .HasForeignKey("SoftwareId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_software_syntaxes_software_software_id");

                    b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Syntax", "Syntax")
                        .WithMany("SoftwareSyntaxes")
                        .HasForeignKey("SyntaxId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_software_syntaxes_syntaxes_syntax_id");

                    b.Navigation("Software");

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

            modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterList", b =>
                {
                    b.Navigation("Changes");

                    b.Navigation("DependencyFilterLists");

                    b.Navigation("DependentFilterLists");

                    b.Navigation("FilterListLanguages");

                    b.Navigation("FilterListMaintainers");

                    b.Navigation("FilterListSyntaxes");

                    b.Navigation("FilterListTags");

                    b.Navigation("ForkFilterLists");

                    b.Navigation("IncludedInFilterLists");

                    b.Navigation("IncludesFilterLists");

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

            modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Language", b =>
                {
                    b.Navigation("Changes");

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

            modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.License", b =>
                {
                    b.Navigation("Changes");

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

            modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Maintainer", b =>
                {
                    b.Navigation("Changes");

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

            modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Software", b =>
                {
                    b.Navigation("Changes");

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

            modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Syntax", b =>
                {
                    b.Navigation("Changes");

                    b.Navigation("FilterListSyntaxes");

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

            modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Tag", b =>
                {
                    b.Navigation("Changes");

                    b.Navigation("FilterListTags");
                });
#pragma warning restore 612, 618
        }
    }
}
