jamie-mh_estimmo-api/Estimmo.Data/Migrations/20230312153924_Init.Designer.cs
// <auto-generated />
using System;
using Estimmo.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using NetTopologySuite.Geometries;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;

#nullable disable

namespace Estimmo.Data.Migrations
{
    [DbContext(typeof(EstimmoContext))]
    [Migration("20230312153924_Init")]
    partial class Init
    {
        /// <inheritdoc />
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "7.0.3")
                .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "pg_trgm");
            NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "postgis");
            NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "tdigest");
            NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "unaccent");
            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("Estimmo.Data.Entities.Address", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("text")
                        .HasColumnName("id");

                    b.Property<Point>("Coordinates")
                        .IsRequired()
                        .HasColumnType("geometry")
                        .HasColumnName("coordinates");

                    b.Property<int?>("Number")
                        .HasColumnType("integer")
                        .HasColumnName("number");

                    b.Property<string>("PostCode")
                        .IsRequired()
                        .HasColumnType("text")
                        .HasColumnName("post_code");

                    b.Property<string>("StreetId")
                        .IsRequired()
                        .HasColumnType("text")
                        .HasColumnName("street_id");

                    b.Property<string>("Suffix")
                        .HasColumnType("text")
                        .HasColumnName("suffix");

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

                    b.HasIndex("Coordinates")
                        .HasDatabaseName("ix_address_coordinates");

                    NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex("Coordinates"), "gist");

                    b.HasIndex("StreetId")
                        .HasDatabaseName("ix_address_street_id");

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

            modelBuilder.Entity("Estimmo.Data.Entities.Department", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("text")
                        .HasColumnName("id");

                    b.Property<Geometry>("Geometry")
                        .IsRequired()
                        .HasColumnType("geography")
                        .HasColumnName("geometry");

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

                    b.Property<string>("RegionId")
                        .IsRequired()
                        .HasColumnType("text")
                        .HasColumnName("region_id");

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

                    b.HasIndex("Geometry")
                        .HasDatabaseName("ix_department_geometry");

                    NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex("Geometry"), "gist");

                    b.HasIndex("RegionId")
                        .HasDatabaseName("ix_department_region_id");

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

            modelBuilder.Entity("Estimmo.Data.Entities.DepartmentValueStats", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("text")
                        .HasColumnName("id");

                    b.Property<int>("Type")
                        .HasColumnType("integer")
                        .HasColumnName("type");

                    b.Property<double>("Average")
                        .HasColumnType("double precision")
                        .HasColumnName("average");

                    b.Property<double>("Median")
                        .HasColumnType("double precision")
                        .HasColumnName("median");

                    b.Property<string>("RegionId")
                        .HasColumnType("text")
                        .HasColumnName("region_id");

                    b.Property<double?>("StandardDeviation")
                        .HasColumnType("double precision")
                        .HasColumnName("standard_deviation");

                    b.HasKey("Id", "Type")
                        .HasName("pk_department_value_stats");

                    b.HasIndex("RegionId")
                        .HasDatabaseName("ix_department_value_stats_region_id");

                    b.ToTable((string)null);

                    b.ToView("department_value_stats", (string)null);
                });

            modelBuilder.Entity("Estimmo.Data.Entities.DepartmentValueStatsByYear", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("text")
                        .HasColumnName("id");

                    b.Property<int>("Type")
                        .HasColumnType("integer")
                        .HasColumnName("type");

                    b.Property<short>("Year")
                        .HasColumnType("smallint")
                        .HasColumnName("year");

                    b.Property<double>("Average")
                        .HasColumnType("double precision")
                        .HasColumnName("average");

                    b.Property<double>("Median")
                        .HasColumnType("double precision")
                        .HasColumnName("median");

                    b.Property<string>("RegionId")
                        .HasColumnType("text")
                        .HasColumnName("region_id");

                    b.Property<double?>("StandardDeviation")
                        .HasColumnType("double precision")
                        .HasColumnName("standard_deviation");

                    b.HasKey("Id", "Type", "Year")
                        .HasName("pk_department_value_stats_by_year");

                    b.HasIndex("RegionId")
                        .HasDatabaseName("ix_department_value_stats_by_year_region_id");

                    b.ToTable((string)null);

                    b.ToView("department_value_stats_by_year", (string)null);
                });

            modelBuilder.Entity("Estimmo.Data.Entities.FranceValueStats", b =>
                {
                    b.Property<int>("Type")
                        .HasColumnType("integer")
                        .HasColumnName("type");

                    b.Property<double>("Average")
                        .HasColumnType("double precision")
                        .HasColumnName("average");

                    b.Property<double>("Median")
                        .HasColumnType("double precision")
                        .HasColumnName("median");

                    b.Property<double?>("StandardDeviation")
                        .HasColumnType("double precision")
                        .HasColumnName("standard_deviation");

                    b.HasKey("Type")
                        .HasName("pk_france_value_stats");

                    b.ToTable((string)null);

                    b.ToView("france_value_stats", (string)null);
                });

            modelBuilder.Entity("Estimmo.Data.Entities.FranceValueStatsByYear", b =>
                {
                    b.Property<int>("Type")
                        .HasColumnType("integer")
                        .HasColumnName("type");

                    b.Property<short>("Year")
                        .HasColumnType("smallint")
                        .HasColumnName("year");

                    b.Property<double>("Average")
                        .HasColumnType("double precision")
                        .HasColumnName("average");

                    b.Property<double>("Median")
                        .HasColumnType("double precision")
                        .HasColumnName("median");

                    b.Property<double?>("StandardDeviation")
                        .HasColumnType("double precision")
                        .HasColumnName("standard_deviation");

                    b.HasKey("Type", "Year")
                        .HasName("pk_france_value_stats_by_year");

                    b.ToTable((string)null);

                    b.ToView("france_value_stats_by_year", (string)null);
                });

            modelBuilder.Entity("Estimmo.Data.Entities.Place", b =>
                {
                    b.Property<int>("Type")
                        .HasColumnType("integer")
                        .HasColumnName("type");

                    b.Property<string>("Id")
                        .HasColumnType("text")
                        .HasColumnName("id");

                    b.Property<Geometry>("Geometry")
                        .HasColumnType("geometry")
                        .HasColumnName("geometry");

                    b.Property<bool>("IsSearchable")
                        .HasColumnType("boolean")
                        .HasColumnName("is_searchable");

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

                    b.Property<string>("ParentId")
                        .HasColumnType("text")
                        .HasColumnName("parent_id");

                    b.Property<int?>("ParentType")
                        .HasColumnType("integer")
                        .HasColumnName("parent_type");

                    b.Property<string>("PostCode")
                        .HasColumnType("text")
                        .HasColumnName("post_code");

                    b.Property<string>("SearchName")
                        .HasColumnType("text")
                        .HasColumnName("search_name");

                    b.Property<string>("ShortName")
                        .HasColumnType("text")
                        .HasColumnName("short_name");

                    b.HasKey("Type", "Id")
                        .HasName("pk_places");

                    b.HasIndex("ParentType", "ParentId")
                        .HasDatabaseName("ix_places_parent_type_parent_id");

                    b.ToTable((string)null);

                    b.ToView("place", (string)null);
                });

            modelBuilder.Entity("Estimmo.Data.Entities.PropertySale", b =>
                {
                    b.Property<string>("Hash")
                        .HasColumnType("text")
                        .HasColumnName("hash");

                    b.Property<int>("BuildingSurfaceArea")
                        .HasColumnType("integer")
                        .HasColumnName("building_surface_area");

                    b.Property<Point>("Coordinates")
                        .IsRequired()
                        .HasColumnType("geography")
                        .HasColumnName("coordinates");

                    b.Property<DateTime>("Date")
                        .HasColumnType("date")
                        .HasColumnName("date");

                    b.Property<int>("LandSurfaceArea")
                        .HasColumnType("integer")
                        .HasColumnName("land_surface_area");

                    b.Property<string>("PostCode")
                        .HasColumnType("text")
                        .HasColumnName("post_code");

                    b.Property<short>("RoomCount")
                        .HasColumnType("smallint")
                        .HasColumnName("room_count");

                    b.Property<string>("SectionId")
                        .IsRequired()
                        .HasColumnType("text")
                        .HasColumnName("section_id");

                    b.Property<string>("StreetName")
                        .IsRequired()
                        .HasColumnType("text")
                        .HasColumnName("street_name");

                    b.Property<short?>("StreetNumber")
                        .HasColumnType("smallint")
                        .HasColumnName("street_number");

                    b.Property<string>("StreetNumberSuffix")
                        .HasColumnType("text")
                        .HasColumnName("street_number_suffix");

                    b.Property<int>("Type")
                        .HasColumnType("integer")
                        .HasColumnName("type");

                    b.Property<decimal>("Value")
                        .HasColumnType("money")
                        .HasColumnName("value");

                    b.HasKey("Hash")
                        .HasName("pk_property_sale");

                    b.HasIndex("Coordinates")
                        .HasDatabaseName("ix_property_sale_coordinates");

                    NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex("Coordinates"), "gist");

                    b.HasIndex("SectionId")
                        .HasDatabaseName("ix_property_sale_section_id");

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

            modelBuilder.Entity("Estimmo.Data.Entities.Region", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("text")
                        .HasColumnName("id");

                    b.Property<Geometry>("Geometry")
                        .IsRequired()
                        .HasColumnType("geography")
                        .HasColumnName("geometry");

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

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

                    b.HasIndex("Geometry")
                        .HasDatabaseName("ix_region_geometry");

                    NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex("Geometry"), "gist");

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

            modelBuilder.Entity("Estimmo.Data.Entities.RegionValueStats", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("text")
                        .HasColumnName("id");

                    b.Property<int>("Type")
                        .HasColumnType("integer")
                        .HasColumnName("type");

                    b.Property<double>("Average")
                        .HasColumnType("double precision")
                        .HasColumnName("average");

                    b.Property<double>("Median")
                        .HasColumnType("double precision")
                        .HasColumnName("median");

                    b.Property<double?>("StandardDeviation")
                        .HasColumnType("double precision")
                        .HasColumnName("standard_deviation");

                    b.HasKey("Id", "Type")
                        .HasName("pk_region_value_stats");

                    b.ToTable((string)null);

                    b.ToView("region_value_stats", (string)null);
                });

            modelBuilder.Entity("Estimmo.Data.Entities.RegionValueStatsByYear", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("text")
                        .HasColumnName("id");

                    b.Property<int>("Type")
                        .HasColumnType("integer")
                        .HasColumnName("type");

                    b.Property<short>("Year")
                        .HasColumnType("smallint")
                        .HasColumnName("year");

                    b.Property<double>("Average")
                        .HasColumnType("double precision")
                        .HasColumnName("average");

                    b.Property<double>("Median")
                        .HasColumnType("double precision")
                        .HasColumnName("median");

                    b.Property<double?>("StandardDeviation")
                        .HasColumnType("double precision")
                        .HasColumnName("standard_deviation");

                    b.HasKey("Id", "Type", "Year")
                        .HasName("pk_region_value_stats_by_year");

                    b.ToTable((string)null);

                    b.ToView("region_value_stats_by_year", (string)null);
                });

            modelBuilder.Entity("Estimmo.Data.Entities.SaidPlace", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("text")
                        .HasColumnName("id");

                    b.Property<Point>("Coordinates")
                        .IsRequired()
                        .HasColumnType("geometry")
                        .HasColumnName("coordinates");

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

                    b.Property<string>("PostCode")
                        .IsRequired()
                        .HasColumnType("text")
                        .HasColumnName("post_code");

                    b.Property<string>("TownId")
                        .IsRequired()
                        .HasColumnType("text")
                        .HasColumnName("town_id");

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

                    b.HasIndex("Coordinates")
                        .HasDatabaseName("ix_said_place_coordinates");

                    NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex("Coordinates"), "gist");

                    b.HasIndex("TownId")
                        .HasDatabaseName("ix_said_place_town_id");

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

            modelBuilder.Entity("Estimmo.Data.Entities.Section", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("text")
                        .HasColumnName("id");

                    b.Property<string>("Code")
                        .IsRequired()
                        .HasColumnType("text")
                        .HasColumnName("code");

                    b.Property<Geometry>("Geometry")
                        .IsRequired()
                        .HasColumnType("geography")
                        .HasColumnName("geometry");

                    b.Property<string>("Prefix")
                        .IsRequired()
                        .HasColumnType("text")
                        .HasColumnName("prefix");

                    b.Property<string>("TownId")
                        .IsRequired()
                        .HasColumnType("text")
                        .HasColumnName("town_id");

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

                    b.HasIndex("Geometry")
                        .HasDatabaseName("ix_section_geometry");

                    NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex("Geometry"), "gist");

                    b.HasIndex("TownId")
                        .HasDatabaseName("ix_section_town_id");

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

            modelBuilder.Entity("Estimmo.Data.Entities.SectionValueStats", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("text")
                        .HasColumnName("id");

                    b.Property<int>("Type")
                        .HasColumnType("integer")
                        .HasColumnName("type");

                    b.Property<double>("Average")
                        .HasColumnType("double precision")
                        .HasColumnName("average");

                    b.Property<double>("Median")
                        .HasColumnType("double precision")
                        .HasColumnName("median");

                    b.Property<double?>("StandardDeviation")
                        .HasColumnType("double precision")
                        .HasColumnName("standard_deviation");

                    b.Property<string>("TownId")
                        .HasColumnType("text")
                        .HasColumnName("town_id");

                    b.HasKey("Id", "Type")
                        .HasName("pk_section_value_stats");

                    b.HasIndex("TownId")
                        .HasDatabaseName("ix_section_value_stats_town_id");

                    b.ToTable((string)null);

                    b.ToView("section_value_stats", (string)null);
                });

            modelBuilder.Entity("Estimmo.Data.Entities.SectionValueStatsByYear", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("text")
                        .HasColumnName("id");

                    b.Property<int>("Type")
                        .HasColumnType("integer")
                        .HasColumnName("type");

                    b.Property<short>("Year")
                        .HasColumnType("smallint")
                        .HasColumnName("year");

                    b.Property<double>("Average")
                        .HasColumnType("double precision")
                        .HasColumnName("average");

                    b.Property<double>("Median")
                        .HasColumnType("double precision")
                        .HasColumnName("median");

                    b.Property<double?>("StandardDeviation")
                        .HasColumnType("double precision")
                        .HasColumnName("standard_deviation");

                    b.Property<string>("TownId")
                        .HasColumnType("text")
                        .HasColumnName("town_id");

                    b.HasKey("Id", "Type", "Year")
                        .HasName("pk_section_value_stats_by_year");

                    b.HasIndex("TownId")
                        .HasDatabaseName("ix_section_value_stats_by_year_town_id");

                    b.ToTable((string)null);

                    b.ToView("section_value_stats_by_year", (string)null);
                });

            modelBuilder.Entity("Estimmo.Data.Entities.Street", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("text")
                        .HasColumnName("id");

                    b.Property<Point>("Coordinates")
                        .HasColumnType("geometry")
                        .HasColumnName("coordinates");

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

                    b.Property<string>("TownId")
                        .IsRequired()
                        .HasColumnType("text")
                        .HasColumnName("town_id");

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

                    b.HasIndex("TownId")
                        .HasDatabaseName("ix_street_town_id");

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

            modelBuilder.Entity("Estimmo.Data.Entities.Town", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("text")
                        .HasColumnName("id");

                    b.Property<string>("DepartmentId")
                        .IsRequired()
                        .HasColumnType("text")
                        .HasColumnName("department_id");

                    b.Property<Geometry>("Geometry")
                        .IsRequired()
                        .HasColumnType("geography")
                        .HasColumnName("geometry");

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

                    b.Property<string>("PostCode")
                        .HasColumnType("text")
                        .HasColumnName("post_code");

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

                    b.HasIndex("DepartmentId")
                        .HasDatabaseName("ix_town_department_id");

                    b.HasIndex("Geometry")
                        .HasDatabaseName("ix_town_geometry");

                    NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex("Geometry"), "gist");

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

            modelBuilder.Entity("Estimmo.Data.Entities.TownValueStats", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("text")
                        .HasColumnName("id");

                    b.Property<int>("Type")
                        .HasColumnType("integer")
                        .HasColumnName("type");

                    b.Property<double>("Average")
                        .HasColumnType("double precision")
                        .HasColumnName("average");

                    b.Property<string>("DepartmentId")
                        .HasColumnType("text")
                        .HasColumnName("department_id");

                    b.Property<double>("Median")
                        .HasColumnType("double precision")
                        .HasColumnName("median");

                    b.Property<double?>("StandardDeviation")
                        .HasColumnType("double precision")
                        .HasColumnName("standard_deviation");

                    b.HasKey("Id", "Type")
                        .HasName("pk_town_value_stats");

                    b.HasIndex("DepartmentId")
                        .HasDatabaseName("ix_town_value_stats_department_id");

                    b.ToTable((string)null);

                    b.ToView("town_value_stats", (string)null);
                });

            modelBuilder.Entity("Estimmo.Data.Entities.TownValueStatsByYear", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("text")
                        .HasColumnName("id");

                    b.Property<int>("Type")
                        .HasColumnType("integer")
                        .HasColumnName("type");

                    b.Property<short>("Year")
                        .HasColumnType("smallint")
                        .HasColumnName("year");

                    b.Property<double>("Average")
                        .HasColumnType("double precision")
                        .HasColumnName("average");

                    b.Property<string>("DepartmentId")
                        .HasColumnType("text")
                        .HasColumnName("department_id");

                    b.Property<double>("Median")
                        .HasColumnType("double precision")
                        .HasColumnName("median");

                    b.Property<double?>("StandardDeviation")
                        .HasColumnType("double precision")
                        .HasColumnName("standard_deviation");

                    b.HasKey("Id", "Type", "Year")
                        .HasName("pk_town_value_stats_by_year");

                    b.HasIndex("DepartmentId")
                        .HasDatabaseName("ix_town_value_stats_by_year_department_id");

                    b.ToTable((string)null);

                    b.ToView("town_value_stats_by_year", (string)null);
                });

            modelBuilder.Entity("Estimmo.Data.Entities.Address", b =>
                {
                    b.HasOne("Estimmo.Data.Entities.Street", "Street")
                        .WithMany("Addresses")
                        .HasForeignKey("StreetId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_address_streets_street_id");

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

            modelBuilder.Entity("Estimmo.Data.Entities.Department", b =>
                {
                    b.HasOne("Estimmo.Data.Entities.Region", "Region")
                        .WithMany("Departments")
                        .HasForeignKey("RegionId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_department_region_region_id");

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

            modelBuilder.Entity("Estimmo.Data.Entities.DepartmentValueStats", b =>
                {
                    b.HasOne("Estimmo.Data.Entities.Department", "Department")
                        .WithMany("ValueStats")
                        .HasForeignKey("Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_department_value_stats_departments_department_id");

                    b.HasOne("Estimmo.Data.Entities.Region", "Region")
                        .WithMany("DepartmentValueStats")
                        .HasForeignKey("RegionId")
                        .HasConstraintName("fk_department_value_stats_regions_region_id");

                    b.Navigation("Department");

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

            modelBuilder.Entity("Estimmo.Data.Entities.DepartmentValueStatsByYear", b =>
                {
                    b.HasOne("Estimmo.Data.Entities.Department", "Department")
                        .WithMany("ValueStatsByYear")
                        .HasForeignKey("Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_department_value_stats_by_year_departments_department_id");

                    b.HasOne("Estimmo.Data.Entities.Region", "Region")
                        .WithMany("DepartmentValueStatsByYear")
                        .HasForeignKey("RegionId")
                        .HasConstraintName("fk_department_value_stats_by_year_regions_region_id");

                    b.Navigation("Department");

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

            modelBuilder.Entity("Estimmo.Data.Entities.Place", b =>
                {
                    b.HasOne("Estimmo.Data.Entities.Place", "Parent")
                        .WithMany()
                        .HasForeignKey("ParentType", "ParentId")
                        .HasConstraintName("fk_places_places_parent_type_parent_id");

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

            modelBuilder.Entity("Estimmo.Data.Entities.PropertySale", b =>
                {
                    b.HasOne("Estimmo.Data.Entities.Section", "Section")
                        .WithMany("PropertySales")
                        .HasForeignKey("SectionId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_property_sale_section_section_id");

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

            modelBuilder.Entity("Estimmo.Data.Entities.RegionValueStats", b =>
                {
                    b.HasOne("Estimmo.Data.Entities.Region", "Region")
                        .WithMany("ValueStats")
                        .HasForeignKey("Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_region_value_stats_regions_region_id");

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

            modelBuilder.Entity("Estimmo.Data.Entities.RegionValueStatsByYear", b =>
                {
                    b.HasOne("Estimmo.Data.Entities.Region", "Region")
                        .WithMany("ValueStatsByYear")
                        .HasForeignKey("Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_region_value_stats_by_year_regions_region_id");

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

            modelBuilder.Entity("Estimmo.Data.Entities.SaidPlace", b =>
                {
                    b.HasOne("Estimmo.Data.Entities.Town", "Town")
                        .WithMany()
                        .HasForeignKey("TownId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_said_place_town_town_id");

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

            modelBuilder.Entity("Estimmo.Data.Entities.Section", b =>
                {
                    b.HasOne("Estimmo.Data.Entities.Town", "Town")
                        .WithMany("Sections")
                        .HasForeignKey("TownId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_section_town_town_id");

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

            modelBuilder.Entity("Estimmo.Data.Entities.SectionValueStats", b =>
                {
                    b.HasOne("Estimmo.Data.Entities.Section", "Section")
                        .WithMany("ValueStats")
                        .HasForeignKey("Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_section_value_stats_sections_section_id");

                    b.HasOne("Estimmo.Data.Entities.Town", "Town")
                        .WithMany("SectionValueStats")
                        .HasForeignKey("TownId")
                        .HasConstraintName("fk_section_value_stats_towns_town_id");

                    b.Navigation("Section");

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

            modelBuilder.Entity("Estimmo.Data.Entities.SectionValueStatsByYear", b =>
                {
                    b.HasOne("Estimmo.Data.Entities.Section", "Section")
                        .WithMany("ValueStatsByYear")
                        .HasForeignKey("Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_section_value_stats_by_year_sections_section_id");

                    b.HasOne("Estimmo.Data.Entities.Town", "Town")
                        .WithMany("SectionValueStatsByYear")
                        .HasForeignKey("TownId")
                        .HasConstraintName("fk_section_value_stats_by_year_towns_town_id");

                    b.Navigation("Section");

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

            modelBuilder.Entity("Estimmo.Data.Entities.Street", b =>
                {
                    b.HasOne("Estimmo.Data.Entities.Town", "Town")
                        .WithMany("Streets")
                        .HasForeignKey("TownId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_street_town_town_id");

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

            modelBuilder.Entity("Estimmo.Data.Entities.Town", b =>
                {
                    b.HasOne("Estimmo.Data.Entities.Department", "Department")
                        .WithMany("Towns")
                        .HasForeignKey("DepartmentId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_town_department_department_id");

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

            modelBuilder.Entity("Estimmo.Data.Entities.TownValueStats", b =>
                {
                    b.HasOne("Estimmo.Data.Entities.Department", "Department")
                        .WithMany("TownValueStats")
                        .HasForeignKey("DepartmentId")
                        .HasConstraintName("fk_town_value_stats_departments_department_id");

                    b.HasOne("Estimmo.Data.Entities.Town", "Town")
                        .WithMany("ValueStats")
                        .HasForeignKey("Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_town_value_stats_towns_town_id");

                    b.Navigation("Department");

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

            modelBuilder.Entity("Estimmo.Data.Entities.TownValueStatsByYear", b =>
                {
                    b.HasOne("Estimmo.Data.Entities.Department", "Department")
                        .WithMany("TownValueStatsByYear")
                        .HasForeignKey("DepartmentId")
                        .HasConstraintName("fk_town_value_stats_by_year_departments_department_id");

                    b.HasOne("Estimmo.Data.Entities.Town", "Town")
                        .WithMany("ValueStatsByYear")
                        .HasForeignKey("Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_town_value_stats_by_year_towns_town_id");

                    b.Navigation("Department");

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

            modelBuilder.Entity("Estimmo.Data.Entities.Department", b =>
                {
                    b.Navigation("TownValueStats");

                    b.Navigation("TownValueStatsByYear");

                    b.Navigation("Towns");

                    b.Navigation("ValueStats");

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

            modelBuilder.Entity("Estimmo.Data.Entities.Region", b =>
                {
                    b.Navigation("DepartmentValueStats");

                    b.Navigation("DepartmentValueStatsByYear");

                    b.Navigation("Departments");

                    b.Navigation("ValueStats");

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

            modelBuilder.Entity("Estimmo.Data.Entities.Section", b =>
                {
                    b.Navigation("PropertySales");

                    b.Navigation("ValueStats");

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

            modelBuilder.Entity("Estimmo.Data.Entities.Street", b =>
                {
                    b.Navigation("Addresses");
                });

            modelBuilder.Entity("Estimmo.Data.Entities.Town", b =>
                {
                    b.Navigation("SectionValueStats");

                    b.Navigation("SectionValueStatsByYear");

                    b.Navigation("Sections");

                    b.Navigation("Streets");

                    b.Navigation("ValueStats");

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