// <auto-generated />
using System;
using Marechai.Database.Models;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;

namespace Marechai.Database.Migrations
{
    [DbContext(typeof(MarechaiContext))]
    [Migration("20200610233739_AddLogicalPartitions")]
    partial class AddLogicalPartitions
    {
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "3.1.4")
                .HasAnnotation("Relational:MaxIdentifierLength", 64);

            modelBuilder.Entity("Marechai.Database.Models.ApplicationRole", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<string>("ConcurrencyStamp")
                        .IsConcurrencyToken()
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<DateTime>("Created")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Description")
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<string>("Name")
                        .HasColumnType("varchar(256) CHARACTER SET utf8mb4")
                        .HasMaxLength(256);

                    b.Property<string>("NormalizedName")
                        .HasColumnType("varchar(256) CHARACTER SET utf8mb4")
                        .HasMaxLength(256);

                    b.HasKey("Id");

                    b.HasIndex("NormalizedName")
                        .IsUnique()
                        .HasName("RoleNameIndex");

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

            modelBuilder.Entity("Marechai.Database.Models.ApplicationUser", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<int>("AccessFailedCount")
                        .HasColumnType("int");

                    b.Property<string>("ConcurrencyStamp")
                        .IsConcurrencyToken()
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<string>("Email")
                        .HasColumnType("varchar(256) CHARACTER SET utf8mb4")
                        .HasMaxLength(256);

                    b.Property<bool>("EmailConfirmed")
                        .HasColumnType("bit(1)");

                    b.Property<bool>("LockoutEnabled")
                        .HasColumnType("bit(1)");

                    b.Property<DateTimeOffset?>("LockoutEnd")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("NormalizedEmail")
                        .HasColumnType("varchar(256) CHARACTER SET utf8mb4")
                        .HasMaxLength(256);

                    b.Property<string>("NormalizedUserName")
                        .HasColumnType("varchar(256) CHARACTER SET utf8mb4")
                        .HasMaxLength(256);

                    b.Property<string>("PasswordHash")
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<string>("PhoneNumber")
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<bool>("PhoneNumberConfirmed")
                        .HasColumnType("bit(1)");

                    b.Property<string>("SecurityStamp")
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<bool>("TwoFactorEnabled")
                        .HasColumnType("bit(1)");

                    b.Property<string>("UserName")
                        .HasColumnType("varchar(256) CHARACTER SET utf8mb4")
                        .HasMaxLength(256);

                    b.HasKey("Id");

                    b.HasIndex("NormalizedEmail")
                        .HasName("EmailIndex");

                    b.HasIndex("NormalizedUserName")
                        .IsUnique()
                        .HasName("UserNameIndex");

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

            modelBuilder.Entity("Marechai.Database.Models.Audit", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    b.Property<string>("AffectedColumns")
                        .HasColumnType("json");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Keys")
                        .HasColumnType("json");

                    b.Property<string>("NewValues")
                        .HasColumnType("json");

                    b.Property<string>("OldValues")
                        .HasColumnType("json");

                    b.Property<string>("Table")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<byte>("Type")
                        .HasColumnType("tinyint unsigned");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.Property<string>("UserId")
                        .IsRequired()
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.HasKey("Id");

                    b.HasIndex("Table");

                    b.HasIndex("Type");

                    b.HasIndex("UserId");

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

            modelBuilder.Entity("Marechai.Database.Models.Book", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    b.Property<short?>("CountryId")
                        .HasColumnType("smallint(3)");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

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

                    b.Property<string>("Isbn")
                        .HasColumnType("varchar(13) CHARACTER SET utf8mb4")
                        .HasMaxLength(13);

                    b.Property<string>("NativeTitle")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<short?>("Pages")
                        .HasColumnType("smallint");

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

                    b.Property<DateTime?>("Published")
                        .HasColumnType("datetime(6)");

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

                    b.Property<string>("Synopsis")
                        .HasColumnType("longtext CHARACTER SET utf8mb4")
                        .HasMaxLength(262144);

                    b.Property<string>("Title")
                        .IsRequired()
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("CountryId");

                    b.HasIndex("Edition");

                    b.HasIndex("Isbn");

                    b.HasIndex("NativeTitle");

                    b.HasIndex("Pages");

                    b.HasIndex("PreviousId")
                        .IsUnique();

                    b.HasIndex("Published");

                    b.HasIndex("SourceId");

                    b.HasIndex("Synopsis")
                        .HasAnnotation("MySql:FullTextIndex", true);

                    b.HasIndex("Title");

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

            modelBuilder.Entity("Marechai.Database.Models.BooksByMachine", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

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

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<int>("MachineId")
                        .HasColumnType("int(11)");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("BookId");

                    b.HasIndex("MachineId");

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

            modelBuilder.Entity("Marechai.Database.Models.BooksByMachineFamily", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

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

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<int>("MachineFamilyId")
                        .HasColumnType("int(11)");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("BookId");

                    b.HasIndex("MachineFamilyId");

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

            modelBuilder.Entity("Marechai.Database.Models.BrowserTest", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("id")
                        .HasColumnType("int(11)");

                    b.Property<sbyte>("Agif")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("agif")
                        .HasColumnType("tinyint(1)")
                        .HasDefaultValueSql("'0'");

                    b.Property<string>("Browser")
                        .IsRequired()
                        .ValueGeneratedOnAdd()
                        .HasColumnName("browser")
                        .HasColumnType("varchar(64)")
                        .HasDefaultValueSql("''")
                        .HasMaxLength(64);

                    b.Property<sbyte>("Colors")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("colors")
                        .HasColumnType("tinyint(1)")
                        .HasDefaultValueSql("'0'");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<sbyte>("Flash")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("flash")
                        .HasColumnType("tinyint(1)")
                        .HasDefaultValueSql("'0'");

                    b.Property<sbyte>("Frames")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("frames")
                        .HasColumnType("tinyint(1)")
                        .HasDefaultValueSql("'0'");

                    b.Property<sbyte>("Gif87")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("gif87")
                        .HasColumnType("tinyint(1)")
                        .HasDefaultValueSql("'0'");

                    b.Property<sbyte>("Gif89")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("gif89")
                        .HasColumnType("tinyint(1)")
                        .HasDefaultValueSql("'0'");

                    b.Property<sbyte>("Jpeg")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("jpeg")
                        .HasColumnType("tinyint(1)")
                        .HasDefaultValueSql("'0'");

                    b.Property<sbyte>("Js")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("js")
                        .HasColumnType("tinyint(1)")
                        .HasDefaultValueSql("'0'");

                    b.Property<string>("Os")
                        .IsRequired()
                        .ValueGeneratedOnAdd()
                        .HasColumnName("os")
                        .HasColumnType("varchar(32)")
                        .HasDefaultValueSql("''")
                        .HasMaxLength(32);

                    b.Property<string>("Platform")
                        .IsRequired()
                        .ValueGeneratedOnAdd()
                        .HasColumnName("platform")
                        .HasColumnType("varchar(8)")
                        .HasDefaultValueSql("''")
                        .HasMaxLength(8);

                    b.Property<sbyte>("Png")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("png")
                        .HasColumnType("tinyint(1)")
                        .HasDefaultValueSql("'0'");

                    b.Property<sbyte>("Pngt")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("pngt")
                        .HasColumnType("tinyint(1)")
                        .HasDefaultValueSql("'0'");

                    b.Property<sbyte>("Table")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("table")
                        .HasColumnType("tinyint(1)")
                        .HasDefaultValueSql("'0'");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.Property<string>("UserAgent")
                        .IsRequired()
                        .ValueGeneratedOnAdd()
                        .HasColumnName("user_agent")
                        .HasColumnType("varchar(128)")
                        .HasDefaultValueSql("''")
                        .HasMaxLength(128);

                    b.Property<string>("Version")
                        .IsRequired()
                        .ValueGeneratedOnAdd()
                        .HasColumnName("version")
                        .HasColumnType("varchar(16)")
                        .HasDefaultValueSql("''")
                        .HasMaxLength(16);

                    b.HasKey("Id");

                    b.HasIndex("Browser")
                        .HasName("idx_browser_tests_browser");

                    b.HasIndex("Os")
                        .HasName("idx_browser_tests_os");

                    b.HasIndex("Platform")
                        .HasName("idx_browser_tests_platform");

                    b.HasIndex("UserAgent")
                        .HasName("idx_browser_tests_user_agent");

                    b.HasIndex("Version")
                        .HasName("idx_browser_tests_version");

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

            modelBuilder.Entity("Marechai.Database.Models.CompaniesByBook", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

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

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<string>("RoleId")
                        .IsRequired()
                        .HasColumnType("char(3)");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("BookId");

                    b.HasIndex("CompanyId");

                    b.HasIndex("RoleId");

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

            modelBuilder.Entity("Marechai.Database.Models.CompaniesByDocument", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

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

                    b.Property<string>("RoleId")
                        .IsRequired()
                        .HasColumnType("char(3)");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("CompanyId");

                    b.HasIndex("DocumentId");

                    b.HasIndex("RoleId");

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

            modelBuilder.Entity("Marechai.Database.Models.CompaniesByMagazine", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

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

                    b.Property<string>("RoleId")
                        .IsRequired()
                        .HasColumnType("char(3)");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("CompanyId");

                    b.HasIndex("MagazineId");

                    b.HasIndex("RoleId");

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

            modelBuilder.Entity("Marechai.Database.Models.Company", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("id")
                        .HasColumnType("int(11)");

                    b.Property<string>("Address")
                        .HasColumnName("address")
                        .HasColumnType("varchar(80)")
                        .HasMaxLength(80);

                    b.Property<string>("City")
                        .HasColumnName("city")
                        .HasColumnType("varchar(80)")
                        .HasMaxLength(80);

                    b.Property<short?>("CountryId")
                        .HasColumnName("country")
                        .HasColumnType("smallint(3)");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

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

                    b.Property<string>("Facebook")
                        .HasColumnName("facebook")
                        .HasColumnType("varchar(45)")
                        .HasMaxLength(45);

                    b.Property<DateTime?>("Founded")
                        .HasColumnName("founded")
                        .HasColumnType("datetime");

                    b.Property<string>("Name")
                        .IsRequired()
                        .ValueGeneratedOnAdd()
                        .HasColumnName("name")
                        .HasColumnType("varchar(128)")
                        .HasDefaultValueSql("''");

                    b.Property<string>("PostalCode")
                        .HasColumnName("postal_code")
                        .HasColumnType("varchar(25)")
                        .HasMaxLength(25);

                    b.Property<string>("Province")
                        .HasColumnName("province")
                        .HasColumnType("varchar(80)")
                        .HasMaxLength(80);

                    b.Property<DateTime?>("Sold")
                        .HasColumnName("sold")
                        .HasColumnType("datetime");

                    b.Property<int?>("SoldToId")
                        .HasColumnName("sold_to")
                        .HasColumnType("int(11)");

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

                    b.Property<string>("Twitter")
                        .HasColumnName("twitter")
                        .HasColumnType("varchar(45)")
                        .HasMaxLength(45);

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Website")
                        .HasColumnName("website")
                        .HasColumnType("varchar(255)")
                        .HasMaxLength(255);

                    b.HasKey("Id");

                    b.HasIndex("Address")
                        .HasName("idx_companies_address");

                    b.HasIndex("City")
                        .HasName("idx_companies_city");

                    b.HasIndex("CountryId")
                        .HasName("idx_companies_country");

                    b.HasIndex("Facebook")
                        .HasName("idx_companies_facebook");

                    b.HasIndex("Founded")
                        .HasName("idx_companies_founded");

                    b.HasIndex("Name")
                        .HasName("idx_companies_name");

                    b.HasIndex("PostalCode")
                        .HasName("idx_companies_postal_code");

                    b.HasIndex("Province")
                        .HasName("idx_companies_province");

                    b.HasIndex("Sold")
                        .HasName("idx_companies_sold");

                    b.HasIndex("SoldToId")
                        .HasName("idx_companies_sold_to");

                    b.HasIndex("Status")
                        .HasName("idx_companies_status");

                    b.HasIndex("Twitter")
                        .HasName("idx_companies_twitter");

                    b.HasIndex("Website")
                        .HasName("idx_companies_website");

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

            modelBuilder.Entity("Marechai.Database.Models.CompanyDescription", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int(11)");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Html")
                        .HasColumnType("longtext CHARACTER SET utf8mb4")
                        .HasMaxLength(262144);

                    b.Property<string>("Text")
                        .IsRequired()
                        .HasColumnType("longtext CHARACTER SET utf8mb4")
                        .HasMaxLength(262144);

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("CompanyId");

                    b.HasIndex("Text")
                        .HasAnnotation("MySql:FullTextIndex", true);

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

            modelBuilder.Entity("Marechai.Database.Models.CompanyLogo", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("id")
                        .HasColumnType("int(11)");

                    b.Property<int>("CompanyId")
                        .HasColumnName("company_id")
                        .HasColumnType("int(11)");

                    b.Property<Guid>("Guid")
                        .HasColumnName("logo_guid")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.Property<int?>("Year")
                        .HasColumnName("year")
                        .HasColumnType("int(4)");

                    b.HasKey("Id", "CompanyId", "Guid");

                    b.HasIndex("CompanyId")
                        .HasName("idx_company_id");

                    b.HasIndex("Guid")
                        .HasName("idx_guid");

                    b.HasIndex("Id")
                        .IsUnique()
                        .HasName("idx_id");

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

            modelBuilder.Entity("Marechai.Database.Models.CurrencyInflation", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<string>("CurrencyCode")
                        .IsRequired()
                        .HasColumnType("varchar(3) CHARACTER SET utf8mb4");

                    b.Property<float>("Inflation")
                        .HasColumnType("float");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.Property<uint>("Year")
                        .HasColumnType("int unsigned");

                    b.HasKey("Id");

                    b.HasIndex("CurrencyCode");

                    b.HasIndex("Year");

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

            modelBuilder.Entity("Marechai.Database.Models.CurrencyPegging", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<string>("DestinationCode")
                        .IsRequired()
                        .HasColumnType("varchar(3) CHARACTER SET utf8mb4");

                    b.Property<DateTime?>("End")
                        .HasColumnType("datetime(6)");

                    b.Property<float>("Ratio")
                        .HasColumnType("float");

                    b.Property<string>("SourceCode")
                        .IsRequired()
                        .HasColumnType("varchar(3) CHARACTER SET utf8mb4");

                    b.Property<DateTime>("Start")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("DestinationCode");

                    b.HasIndex("End");

                    b.HasIndex("SourceCode");

                    b.HasIndex("Start");

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

            modelBuilder.Entity("Marechai.Database.Models.DbFile", b =>
                {
                    b.Property<ulong>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint unsigned");

                    b.Property<string>("AccoustId")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<bool>("Hack")
                        .HasColumnType("bit(1)");

                    b.Property<string>("HackGroup")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<bool>("Infected")
                        .HasColumnType("bit(1)");

                    b.Property<string>("Magic")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<string>("Malware")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<byte[]>("Md5")
                        .HasColumnType("binary(16)");

                    b.Property<string>("Mime")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<byte[]>("Sha1")
                        .HasColumnType("binary(20)");

                    b.Property<byte[]>("Sha256")
                        .HasColumnType("binary(32)");

                    b.Property<byte[]>("Sha3")
                        .HasColumnType("binary(64)");

                    b.Property<ulong>("Size")
                        .HasColumnType("bigint unsigned");

                    b.Property<string>("Spamsum")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("AccoustId");

                    b.HasIndex("Hack");

                    b.HasIndex("HackGroup");

                    b.HasIndex("Infected");

                    b.HasIndex("Magic");

                    b.HasIndex("Malware");

                    b.HasIndex("Md5");

                    b.HasIndex("Mime");

                    b.HasIndex("Sha1");

                    b.HasIndex("Sha256");

                    b.HasIndex("Sha3");

                    b.HasIndex("Size");

                    b.HasIndex("Spamsum");

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

            modelBuilder.Entity("Marechai.Database.Models.Document", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    b.Property<short?>("CountryId")
                        .HasColumnType("smallint(3)");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<string>("NativeTitle")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<DateTime?>("Published")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Synopsis")
                        .HasColumnType("longtext CHARACTER SET utf8mb4")
                        .HasMaxLength(262144);

                    b.Property<string>("Title")
                        .IsRequired()
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("CountryId");

                    b.HasIndex("NativeTitle");

                    b.HasIndex("Published");

                    b.HasIndex("Synopsis")
                        .HasAnnotation("MySql:FullTextIndex", true);

                    b.HasIndex("Title");

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

            modelBuilder.Entity("Marechai.Database.Models.DocumentCompany", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<int?>("CompanyId")
                        .HasColumnType("int(11)");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("CompanyId")
                        .IsUnique();

                    b.HasIndex("Name");

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

            modelBuilder.Entity("Marechai.Database.Models.DocumentPerson", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<string>("Alias")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<string>("DisplayName")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

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

                    b.Property<string>("Surname")
                        .IsRequired()
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("Alias");

                    b.HasIndex("DisplayName");

                    b.HasIndex("Name");

                    b.HasIndex("PersonId")
                        .IsUnique();

                    b.HasIndex("Surname");

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

            modelBuilder.Entity("Marechai.Database.Models.DocumentRole", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("char(3)");

                    b.Property<bool>("Enabled")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bit(1)")
                        .HasDefaultValue(true);

                    b.Property<string>("Name")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.HasKey("Id");

                    b.HasIndex("Enabled");

                    b.HasIndex("Name");

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

            modelBuilder.Entity("Marechai.Database.Models.DocumentsByMachine", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

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

                    b.Property<int>("MachineId")
                        .HasColumnType("int(11)");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("DocumentId");

                    b.HasIndex("MachineId");

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

            modelBuilder.Entity("Marechai.Database.Models.DocumentsByMachineFamily", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

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

                    b.Property<int>("MachineFamilyId")
                        .HasColumnType("int(11)");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("DocumentId");

                    b.HasIndex("MachineFamilyId");

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

            modelBuilder.Entity("Marechai.Database.Models.DumpHardware", b =>
                {
                    b.Property<ulong>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint unsigned");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Extents")
                        .IsRequired()
                        .HasColumnType("json");

                    b.Property<string>("Firmware")
                        .HasColumnType("varchar(32) CHARACTER SET utf8mb4")
                        .HasMaxLength(32);

                    b.Property<string>("Manufacturer")
                        .HasColumnType("varchar(48) CHARACTER SET utf8mb4")
                        .HasMaxLength(48);

                    b.Property<string>("Model")
                        .IsRequired()
                        .HasColumnType("varchar(48) CHARACTER SET utf8mb4")
                        .HasMaxLength(48);

                    b.Property<string>("Revision")
                        .HasColumnType("varchar(48) CHARACTER SET utf8mb4")
                        .HasMaxLength(48);

                    b.Property<string>("Serial")
                        .HasColumnType("varchar(64) CHARACTER SET utf8mb4")
                        .HasMaxLength(64);

                    b.Property<string>("SoftwareName")
                        .IsRequired()
                        .HasColumnType("varchar(64) CHARACTER SET utf8mb4")
                        .HasMaxLength(64);

                    b.Property<string>("SoftwareOperatingSystem")
                        .HasColumnType("varchar(64) CHARACTER SET utf8mb4")
                        .HasMaxLength(64);

                    b.Property<string>("SoftwareVersion")
                        .HasColumnType("varchar(32) CHARACTER SET utf8mb4")
                        .HasMaxLength(32);

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("Firmware");

                    b.HasIndex("Manufacturer");

                    b.HasIndex("Model");

                    b.HasIndex("Revision");

                    b.HasIndex("Serial");

                    b.HasIndex("SoftwareName");

                    b.HasIndex("SoftwareOperatingSystem");

                    b.HasIndex("SoftwareVersion");

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

            modelBuilder.Entity("Marechai.Database.Models.FileDataStream", b =>
                {
                    b.Property<ulong>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint unsigned");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<ulong>("FileId")
                        .HasColumnType("bigint unsigned");

                    b.Property<string>("Name")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4")
                        .HasMaxLength(255);

                    b.Property<ulong>("Size")
                        .HasColumnType("bigint unsigned");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("FileId");

                    b.HasIndex("Name");

                    b.HasIndex("Size");

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

            modelBuilder.Entity("Marechai.Database.Models.Filesystem", b =>
                {
                    b.Property<ulong>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint unsigned");

                    b.Property<string>("ApplicationIdentifier")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<DateTime?>("BackupDate")
                        .HasColumnType("datetime(6)");

                    b.Property<bool>("Bootable")
                        .HasColumnType("bit(1)");

                    b.Property<int>("ClusterSize")
                        .HasColumnType("int");

                    b.Property<ulong>("Clusters")
                        .HasColumnType("bigint unsigned");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime?>("CreationDate")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("DataPreparerIdentifier")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<DateTime?>("EffectiveDate")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime?>("ExpirationDate")
                        .HasColumnType("datetime(6)");

                    b.Property<ulong?>("Files")
                        .HasColumnType("bigint unsigned");

                    b.Property<ulong?>("FreeClusters")
                        .HasColumnType("bigint unsigned");

                    b.Property<string>("Label")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<DateTime?>("ModificationDate")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("PublisherIdentifier")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<string>("Serial")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<string>("SystemIdentifier")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<string>("Type")
                        .IsRequired()
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.Property<string>("VolumeSetIdentifier")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.HasKey("Id");

                    b.HasIndex("ApplicationIdentifier");

                    b.HasIndex("BackupDate");

                    b.HasIndex("CreationDate");

                    b.HasIndex("DataPreparerIdentifier");

                    b.HasIndex("Label");

                    b.HasIndex("ModificationDate");

                    b.HasIndex("PublisherIdentifier");

                    b.HasIndex("Serial");

                    b.HasIndex("SystemIdentifier");

                    b.HasIndex("Type");

                    b.HasIndex("VolumeSetIdentifier");

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

            modelBuilder.Entity("Marechai.Database.Models.FilesystemsByLogicalPartition", b =>
                {
                    b.Property<ulong>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint unsigned");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<ulong>("FilesystemId")
                        .HasColumnType("bigint unsigned");

                    b.Property<ulong>("PartitionId")
                        .HasColumnType("bigint unsigned");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("FilesystemId");

                    b.HasIndex("PartitionId");

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

            modelBuilder.Entity("Marechai.Database.Models.Forbidden", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("id")
                        .HasColumnType("int(11)");

                    b.Property<string>("Browser")
                        .IsRequired()
                        .ValueGeneratedOnAdd()
                        .HasColumnName("browser")
                        .HasColumnType("char(128)")
                        .HasDefaultValueSql("''");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Date")
                        .IsRequired()
                        .ValueGeneratedOnAdd()
                        .HasColumnName("date")
                        .HasColumnType("char(20)")
                        .HasDefaultValueSql("''");

                    b.Property<string>("Ip")
                        .IsRequired()
                        .ValueGeneratedOnAdd()
                        .HasColumnName("ip")
                        .HasColumnType("char(16)")
                        .HasDefaultValueSql("''");

                    b.Property<string>("Referer")
                        .IsRequired()
                        .ValueGeneratedOnAdd()
                        .HasColumnName("referer")
                        .HasColumnType("char(255)")
                        .HasDefaultValueSql("''");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("Browser")
                        .HasName("idx_forbidden_browser");

                    b.HasIndex("Date")
                        .HasName("idx_forbidden_date");

                    b.HasIndex("Ip")
                        .HasName("idx_forbidden_ip");

                    b.HasIndex("Referer")
                        .HasName("idx_forbidden_referer");

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

            modelBuilder.Entity("Marechai.Database.Models.Gpu", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("id")
                        .HasColumnType("int(11)");

                    b.Property<int?>("CompanyId")
                        .HasColumnName("company")
                        .HasColumnType("int(11)");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<float?>("DieSize")
                        .HasColumnName("die_size")
                        .HasColumnType("float");

                    b.Property<DateTime?>("Introduced")
                        .HasColumnName("introduced")
                        .HasColumnType("datetime");

                    b.Property<string>("ModelCode")
                        .HasColumnName("model_code")
                        .HasColumnType("varchar(45)")
                        .HasMaxLength(45);

                    b.Property<string>("Name")
                        .IsRequired()
                        .ValueGeneratedOnAdd()
                        .HasColumnName("name")
                        .HasColumnType("char(128)")
                        .HasDefaultValueSql("''")
                        .HasMaxLength(128);

                    b.Property<string>("Package")
                        .HasColumnName("package")
                        .HasColumnType("varchar(45)")
                        .HasMaxLength(45);

                    b.Property<string>("Process")
                        .HasColumnName("process")
                        .HasColumnType("varchar(45)")
                        .HasMaxLength(45);

                    b.Property<float?>("ProcessNm")
                        .HasColumnName("process_nm")
                        .HasColumnType("float");

                    b.Property<long?>("Transistors")
                        .HasColumnName("transistors")
                        .HasColumnType("bigint(20)");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("CompanyId")
                        .HasName("idx_gpus_company");

                    b.HasIndex("DieSize")
                        .HasName("idx_gpus_die_size");

                    b.HasIndex("Introduced")
                        .HasName("idx_gpus_introduced");

                    b.HasIndex("ModelCode")
                        .HasName("idx_gpus_model_code");

                    b.HasIndex("Name")
                        .HasName("idx_gpus_name");

                    b.HasIndex("Package")
                        .HasName("idx_gpus_package");

                    b.HasIndex("Process")
                        .HasName("idx_gpus_process");

                    b.HasIndex("ProcessNm")
                        .HasName("idx_gpus_process_nm");

                    b.HasIndex("Transistors")
                        .HasName("idx_gpus_transistors");

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

            modelBuilder.Entity("Marechai.Database.Models.GpusByMachine", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("id")
                        .HasColumnType("bigint(20)");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<int>("GpuId")
                        .HasColumnName("gpu")
                        .HasColumnType("int(11)");

                    b.Property<int>("MachineId")
                        .HasColumnName("machine")
                        .HasColumnType("int(11)");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("GpuId")
                        .HasName("idx_gpus_by_machine_gpus");

                    b.HasIndex("MachineId")
                        .HasName("idx_gpus_by_machine_machine");

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

            modelBuilder.Entity("Marechai.Database.Models.GpusByOwnedMachine", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<int>("GpuId")
                        .HasColumnType("int(11)");

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

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("GpuId");

                    b.HasIndex("OwnedMachineId");

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

            modelBuilder.Entity("Marechai.Database.Models.InstructionSet", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("id")
                        .HasColumnType("int(11)");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnName("instruction_set")
                        .HasColumnType("varchar(45)")
                        .HasMaxLength(45);

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

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

            modelBuilder.Entity("Marechai.Database.Models.InstructionSetExtension", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("id")
                        .HasColumnType("int(11)");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Extension")
                        .IsRequired()
                        .HasColumnName("extension")
                        .HasColumnType("varchar(45)")
                        .HasMaxLength(45);

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

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

            modelBuilder.Entity("Marechai.Database.Models.InstructionSetExtensionsByProcessor", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("id")
                        .HasColumnType("int(11)");

                    b.Property<int>("ProcessorId")
                        .HasColumnName("processor_id")
                        .HasColumnType("int(11)");

                    b.Property<int>("ExtensionId")
                        .HasColumnName("extension_id")
                        .HasColumnType("int(11)");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id", "ProcessorId", "ExtensionId");

                    b.HasIndex("ExtensionId")
                        .HasName("idx_setextension_extension");

                    b.HasIndex("ProcessorId")
                        .HasName("idx_setextension_processor");

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

            modelBuilder.Entity("Marechai.Database.Models.Iso31661Numeric", b =>
                {
                    b.Property<short>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("id")
                        .HasColumnType("smallint(3)");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnName("name")
                        .HasColumnType("varchar(64)")
                        .HasMaxLength(64);

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("Name")
                        .HasName("idx_name");

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

            modelBuilder.Entity("Marechai.Database.Models.Iso4217", b =>
                {
                    b.Property<string>("Code")
                        .HasColumnType("varchar(3) CHARACTER SET utf8mb4")
                        .HasMaxLength(3);

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<byte?>("MinorUnits")
                        .HasColumnType("tinyint unsigned");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("varchar(150) CHARACTER SET utf8mb4")
                        .HasMaxLength(150);

                    b.Property<short>("Numeric")
                        .HasColumnType("smallint(3)");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime?>("Withdrawn")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Code");

                    b.HasIndex("Numeric");

                    b.HasIndex("Withdrawn");

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

            modelBuilder.Entity("Marechai.Database.Models.Iso639", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("char(3)");

                    b.Property<string>("Comment")
                        .HasColumnType("varchar(150)");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Part1")
                        .HasColumnType("char(2)");

                    b.Property<string>("Part2B")
                        .HasColumnType("char(3)");

                    b.Property<string>("Part2T")
                        .HasColumnType("char(3)");

                    b.Property<string>("ReferenceName")
                        .IsRequired()
                        .HasColumnName("Ref_Name")
                        .HasColumnType("varchar(150)");

                    b.Property<string>("Scope")
                        .IsRequired()
                        .HasColumnType("char(1)");

                    b.Property<string>("Type")
                        .IsRequired()
                        .HasColumnType("char(1)");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("Comment");

                    b.HasIndex("Part1");

                    b.HasIndex("Part2B");

                    b.HasIndex("Part2T");

                    b.HasIndex("ReferenceName");

                    b.HasIndex("Scope");

                    b.HasIndex("Type");

                    b.ToTable("ISO_639-3");
                });

            modelBuilder.Entity("Marechai.Database.Models.License", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<bool>("FsfApproved")
                        .HasColumnType("bit(1)");

                    b.Property<string>("Link")
                        .HasColumnType("varchar(512) CHARACTER SET utf8mb4")
                        .HasMaxLength(512);

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<bool>("OsiApproved")
                        .HasColumnType("bit(1)");

                    b.Property<string>("SPDX")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<string>("Text")
                        .HasColumnType("longtext")
                        .HasMaxLength(131072);

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("FsfApproved");

                    b.HasIndex("Name");

                    b.HasIndex("OsiApproved");

                    b.HasIndex("SPDX");

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

            modelBuilder.Entity("Marechai.Database.Models.Log", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("id")
                        .HasColumnType("int(11)");

                    b.Property<string>("Browser")
                        .IsRequired()
                        .ValueGeneratedOnAdd()
                        .HasColumnName("browser")
                        .HasColumnType("char(128)")
                        .HasDefaultValueSql("''");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Date")
                        .IsRequired()
                        .ValueGeneratedOnAdd()
                        .HasColumnName("date")
                        .HasColumnType("char(20)")
                        .HasDefaultValueSql("''");

                    b.Property<string>("Ip")
                        .IsRequired()
                        .ValueGeneratedOnAdd()
                        .HasColumnName("ip")
                        .HasColumnType("char(16)")
                        .HasDefaultValueSql("''");

                    b.Property<string>("Referer")
                        .IsRequired()
                        .ValueGeneratedOnAdd()
                        .HasColumnName("referer")
                        .HasColumnType("char(255)")
                        .HasDefaultValueSql("''");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("Browser")
                        .HasName("idx_log_browser");

                    b.HasIndex("Date")
                        .HasName("idx_log_date");

                    b.HasIndex("Ip")
                        .HasName("idx_log_ip");

                    b.HasIndex("Referer")
                        .HasName("idx_log_referer");

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

            modelBuilder.Entity("Marechai.Database.Models.LogicalPartition", b =>
                {
                    b.Property<ulong>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint unsigned");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Description")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<ulong>("FirstSector")
                        .HasColumnType("bigint unsigned");

                    b.Property<ulong>("LastSector")
                        .HasColumnType("bigint unsigned");

                    b.Property<string>("Name")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<string>("Scheme")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<uint>("Sequence")
                        .HasColumnType("int unsigned");

                    b.Property<ulong>("Size")
                        .HasColumnType("bigint unsigned");

                    b.Property<string>("Type")
                        .IsRequired()
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("Description");

                    b.HasIndex("FirstSector");

                    b.HasIndex("LastSector");

                    b.HasIndex("Name");

                    b.HasIndex("Scheme");

                    b.HasIndex("Type");

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

            modelBuilder.Entity("Marechai.Database.Models.Machine", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("id")
                        .HasColumnType("int(11)");

                    b.Property<int>("CompanyId")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("company")
                        .HasColumnType("int(11)")
                        .HasDefaultValueSql("'0'");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<int?>("FamilyId")
                        .HasColumnName("family")
                        .HasColumnType("int(11)");

                    b.Property<DateTime?>("Introduced")
                        .HasColumnName("introduced")
                        .HasColumnType("datetime");

                    b.Property<string>("Model")
                        .HasColumnName("model")
                        .HasColumnType("varchar(50)")
                        .HasMaxLength(50);

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnName("name")
                        .HasColumnType("varchar(255)")
                        .HasMaxLength(255);

                    b.Property<int>("Type")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("type")
                        .HasColumnType("int(11)")
                        .HasDefaultValueSql("'0'");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("CompanyId")
                        .HasName("idx_machines_company");

                    b.HasIndex("FamilyId")
                        .HasName("idx_machines_family");

                    b.HasIndex("Introduced")
                        .HasName("idx_machines_introduced");

                    b.HasIndex("Model")
                        .HasName("idx_machines_model");

                    b.HasIndex("Name")
                        .HasName("idx_machines_name");

                    b.HasIndex("Type")
                        .HasName("idx_machines_type");

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

            modelBuilder.Entity("Marechai.Database.Models.MachineFamily", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("id")
                        .HasColumnType("int(11)");

                    b.Property<int>("CompanyId")
                        .HasColumnName("company")
                        .HasColumnType("int(11)");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnName("name")
                        .HasColumnType("varchar(255)")
                        .HasMaxLength(255);

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("CompanyId")
                        .HasName("idx_machine_families_company");

                    b.HasIndex("Name")
                        .HasName("idx_machine_families_name");

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

            modelBuilder.Entity("Marechai.Database.Models.MachinePhoto", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<double?>("Aperture")
                        .HasColumnType("double");

                    b.Property<string>("Author")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<string>("CameraManufacturer")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<string>("CameraModel")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<ushort?>("ColorSpace")
                        .HasColumnType("smallint unsigned");

                    b.Property<string>("Comments")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<ushort?>("Contrast")
                        .HasColumnType("smallint unsigned");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime?>("CreationDate")
                        .HasColumnType("datetime(6)");

                    b.Property<double?>("DigitalZoomRatio")
                        .HasColumnType("double");

                    b.Property<string>("ExifVersion")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<ushort?>("ExposureMethod")
                        .HasColumnType("smallint unsigned");

                    b.Property<ushort?>("ExposureProgram")
                        .HasColumnType("smallint unsigned");

                    b.Property<double?>("ExposureTime")
                        .HasColumnType("double");

                    b.Property<ushort?>("Flash")
                        .HasColumnType("smallint unsigned");

                    b.Property<double?>("Focal")
                        .HasColumnType("double");

                    b.Property<double?>("FocalLength")
                        .HasColumnType("double");

                    b.Property<double?>("FocalLengthEquivalent")
                        .HasColumnType("double");

                    b.Property<double?>("HorizontalResolution")
                        .HasColumnType("double");

                    b.Property<ushort?>("IsoRating")
                        .HasColumnType("smallint unsigned");

                    b.Property<string>("Lens")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<int>("LicenseId")
                        .HasColumnType("int");

                    b.Property<ushort?>("LightSource")
                        .HasColumnType("smallint unsigned");

                    b.Property<int>("MachineId")
                        .HasColumnType("int(11)");

                    b.Property<ushort?>("MeteringMode")
                        .HasColumnType("smallint unsigned");

                    b.Property<ushort?>("Orientation")
                        .HasColumnType("smallint unsigned");

                    b.Property<string>("OriginalExtension")
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<ushort?>("ResolutionUnit")
                        .HasColumnType("smallint unsigned");

                    b.Property<ushort?>("Saturation")
                        .HasColumnType("smallint unsigned");

                    b.Property<ushort?>("SceneCaptureType")
                        .HasColumnType("smallint unsigned");

                    b.Property<ushort?>("SensingMethod")
                        .HasColumnType("smallint unsigned");

                    b.Property<ushort?>("Sharpness")
                        .HasColumnType("smallint unsigned");

                    b.Property<string>("SoftwareUsed")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<string>("Source")
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<ushort?>("SubjectDistanceRange")
                        .HasColumnType("smallint unsigned");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("UploadDate")
                        .IsConcurrencyToken()
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.Property<string>("UserId")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<double?>("VerticalResolution")
                        .HasColumnType("double");

                    b.Property<ushort?>("WhiteBalance")
                        .HasColumnType("smallint unsigned");

                    b.HasKey("Id");

                    b.HasIndex("Aperture");

                    b.HasIndex("Author");

                    b.HasIndex("CameraManufacturer");

                    b.HasIndex("CameraModel");

                    b.HasIndex("ColorSpace");

                    b.HasIndex("Comments");

                    b.HasIndex("Contrast");

                    b.HasIndex("CreationDate");

                    b.HasIndex("DigitalZoomRatio");

                    b.HasIndex("ExifVersion");

                    b.HasIndex("ExposureMethod");

                    b.HasIndex("ExposureProgram");

                    b.HasIndex("ExposureTime");

                    b.HasIndex("Flash");

                    b.HasIndex("Focal");

                    b.HasIndex("FocalLength");

                    b.HasIndex("FocalLengthEquivalent");

                    b.HasIndex("HorizontalResolution");

                    b.HasIndex("IsoRating");

                    b.HasIndex("Lens");

                    b.HasIndex("LicenseId");

                    b.HasIndex("LightSource");

                    b.HasIndex("MachineId");

                    b.HasIndex("MeteringMode");

                    b.HasIndex("Orientation");

                    b.HasIndex("ResolutionUnit");

                    b.HasIndex("Saturation");

                    b.HasIndex("SceneCaptureType");

                    b.HasIndex("SensingMethod");

                    b.HasIndex("Sharpness");

                    b.HasIndex("SoftwareUsed");

                    b.HasIndex("SubjectDistanceRange");

                    b.HasIndex("UploadDate");

                    b.HasIndex("UserId");

                    b.HasIndex("VerticalResolution");

                    b.HasIndex("WhiteBalance");

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

            modelBuilder.Entity("Marechai.Database.Models.Magazine", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    b.Property<short?>("CountryId")
                        .HasColumnType("smallint(3)");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime?>("FirstPublication")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Issn")
                        .HasColumnType("varchar(8) CHARACTER SET utf8mb4")
                        .HasMaxLength(8);

                    b.Property<string>("NativeTitle")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<DateTime?>("Published")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Synopsis")
                        .HasColumnType("longtext CHARACTER SET utf8mb4")
                        .HasMaxLength(262144);

                    b.Property<string>("Title")
                        .IsRequired()
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("CountryId");

                    b.HasIndex("FirstPublication");

                    b.HasIndex("Issn");

                    b.HasIndex("NativeTitle");

                    b.HasIndex("Published");

                    b.HasIndex("Synopsis")
                        .HasAnnotation("MySql:FullTextIndex", true);

                    b.HasIndex("Title");

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

            modelBuilder.Entity("Marechai.Database.Models.MagazineIssue", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    b.Property<string>("Caption")
                        .IsRequired()
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

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

                    b.Property<string>("NativeCaption")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<short>("Pages")
                        .HasColumnType("smallint");

                    b.Property<string>("ProductCode")
                        .HasColumnType("varchar(18) CHARACTER SET utf8mb4")
                        .HasMaxLength(18);

                    b.Property<DateTime?>("Published")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("Caption");

                    b.HasIndex("MagazineId");

                    b.HasIndex("NativeCaption");

                    b.HasIndex("Pages");

                    b.HasIndex("ProductCode");

                    b.HasIndex("Published");

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

            modelBuilder.Entity("Marechai.Database.Models.MagazinesByMachine", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<int>("MachineId")
                        .HasColumnType("int(11)");

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

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("MachineId");

                    b.HasIndex("MagazineId");

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

            modelBuilder.Entity("Marechai.Database.Models.MagazinesByMachineFamily", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<int>("MachineFamilyId")
                        .HasColumnType("int(11)");

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

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("MachineFamilyId");

                    b.HasIndex("MagazineId");

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

            modelBuilder.Entity("Marechai.Database.Models.MarechaiDb", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("id")
                        .HasColumnType("int(11)");

                    b.Property<DateTimeOffset?>("Updated")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("updated")
                        .HasColumnType("datetime")
                        .HasDefaultValueSql("CURRENT_TIMESTAMP");

                    b.Property<int>("Version")
                        .HasColumnName("version")
                        .HasColumnType("int(11)");

                    b.HasKey("Id");

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

            modelBuilder.Entity("Marechai.Database.Models.MemoryByMachine", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("id")
                        .HasColumnType("bigint(20)");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<int>("MachineId")
                        .HasColumnName("machine")
                        .HasColumnType("int(11)");

                    b.Property<long?>("Size")
                        .HasColumnName("size")
                        .HasColumnType("bigint(20)");

                    b.Property<double?>("Speed")
                        .HasColumnName("speed")
                        .HasColumnType("double");

                    b.Property<int>("Type")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("type")
                        .HasColumnType("int(11)")
                        .HasDefaultValueSql("'0'");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.Property<int>("Usage")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("usage")
                        .HasColumnType("int(11)")
                        .HasDefaultValueSql("'0'");

                    b.HasKey("Id");

                    b.HasIndex("MachineId")
                        .HasName("idx_memory_by_machine_machine");

                    b.HasIndex("Size")
                        .HasName("idx_memory_by_machine_size");

                    b.HasIndex("Speed")
                        .HasName("idx_memory_by_machine_speed");

                    b.HasIndex("Type")
                        .HasName("idx_memory_by_machine_type");

                    b.HasIndex("Usage")
                        .HasName("idx_memory_by_machine_usage");

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

            modelBuilder.Entity("Marechai.Database.Models.MemoryByOwnedMachine", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

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

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

                    b.Property<double>("Speed")
                        .HasColumnType("double");

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

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.Property<int>("Usage")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("OwnedMachineId");

                    b.HasIndex("Size");

                    b.HasIndex("Speed");

                    b.HasIndex("Type");

                    b.HasIndex("Usage");

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

            modelBuilder.Entity("Marechai.Database.Models.MoneyDonation", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("id")
                        .HasColumnType("int(11)");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Donator")
                        .IsRequired()
                        .ValueGeneratedOnAdd()
                        .HasColumnName("donator")
                        .HasColumnType("char(128)")
                        .HasDefaultValueSql("''");

                    b.Property<decimal>("Quantity")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("quantity")
                        .HasColumnType("decimal(11,2)")
                        .HasDefaultValueSql("'0.00'");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("Donator")
                        .HasName("idx_money_donations_donator");

                    b.HasIndex("Quantity")
                        .HasName("idx_money_donations_quantity");

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

            modelBuilder.Entity("Marechai.Database.Models.News", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("id")
                        .HasColumnType("int(11)");

                    b.Property<int>("AddedId")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("added_id")
                        .HasColumnType("int(11)")
                        .HasDefaultValueSql("'0'");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

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

                    b.Property<int>("Type")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("type")
                        .HasColumnType("int(11)")
                        .HasDefaultValueSql("'0'");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("AddedId")
                        .HasName("idx_news_ip");

                    b.HasIndex("Date")
                        .HasName("idx_news_date");

                    b.HasIndex("Type")
                        .HasName("idx_news_type");

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

            modelBuilder.Entity("Marechai.Database.Models.OwnedMachine", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    b.Property<DateTime>("AcquisitionDate")
                        .HasColumnType("datetime(6)");

                    b.Property<bool>("Boxed")
                        .HasColumnType("bit(1)");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime?>("LastStatusDate")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime?>("LostDate")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("MachineId")
                        .HasColumnType("int(11)");

                    b.Property<bool>("Manuals")
                        .HasColumnType("bit(1)");

                    b.Property<string>("SerialNumber")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<bool>("SerialNumberVisible")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bit(1)")
                        .HasDefaultValue(true);

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

                    b.Property<bool>("Trade")
                        .HasColumnType("bit(1)");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.Property<string>("UserId")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.HasKey("Id");

                    b.HasIndex("AcquisitionDate");

                    b.HasIndex("Boxed");

                    b.HasIndex("LastStatusDate");

                    b.HasIndex("LostDate");

                    b.HasIndex("MachineId");

                    b.HasIndex("Manuals");

                    b.HasIndex("SerialNumber");

                    b.HasIndex("SerialNumberVisible");

                    b.HasIndex("Status");

                    b.HasIndex("Trade");

                    b.HasIndex("UserId");

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

            modelBuilder.Entity("Marechai.Database.Models.OwnedMachinePhoto", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<double?>("Aperture")
                        .HasColumnType("double");

                    b.Property<string>("Author")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<string>("CameraManufacturer")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<string>("CameraModel")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<ushort?>("ColorSpace")
                        .HasColumnType("smallint unsigned");

                    b.Property<string>("Comments")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<ushort?>("Contrast")
                        .HasColumnType("smallint unsigned");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime?>("CreationDate")
                        .HasColumnType("datetime(6)");

                    b.Property<double?>("DigitalZoomRatio")
                        .HasColumnType("double");

                    b.Property<string>("ExifVersion")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<ushort?>("ExposureMethod")
                        .HasColumnType("smallint unsigned");

                    b.Property<ushort?>("ExposureProgram")
                        .HasColumnType("smallint unsigned");

                    b.Property<double?>("ExposureTime")
                        .HasColumnType("double");

                    b.Property<ushort?>("Flash")
                        .HasColumnType("smallint unsigned");

                    b.Property<double?>("Focal")
                        .HasColumnType("double");

                    b.Property<double?>("FocalLength")
                        .HasColumnType("double");

                    b.Property<double?>("FocalLengthEquivalent")
                        .HasColumnType("double");

                    b.Property<double?>("HorizontalResolution")
                        .HasColumnType("double");

                    b.Property<ushort?>("IsoRating")
                        .HasColumnType("smallint unsigned");

                    b.Property<string>("Lens")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<int>("LicenseId")
                        .HasColumnType("int");

                    b.Property<ushort?>("LightSource")
                        .HasColumnType("smallint unsigned");

                    b.Property<ushort?>("MeteringMode")
                        .HasColumnType("smallint unsigned");

                    b.Property<ushort?>("Orientation")
                        .HasColumnType("smallint unsigned");

                    b.Property<string>("OriginalExtension")
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

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

                    b.Property<ushort?>("ResolutionUnit")
                        .HasColumnType("smallint unsigned");

                    b.Property<ushort?>("Saturation")
                        .HasColumnType("smallint unsigned");

                    b.Property<ushort?>("SceneCaptureType")
                        .HasColumnType("smallint unsigned");

                    b.Property<ushort?>("SensingMethod")
                        .HasColumnType("smallint unsigned");

                    b.Property<ushort?>("Sharpness")
                        .HasColumnType("smallint unsigned");

                    b.Property<string>("SoftwareUsed")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<ushort?>("SubjectDistanceRange")
                        .HasColumnType("smallint unsigned");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("UploadDate")
                        .IsConcurrencyToken()
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.Property<string>("UserId")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<double?>("VerticalResolution")
                        .HasColumnType("double");

                    b.Property<ushort?>("WhiteBalance")
                        .HasColumnType("smallint unsigned");

                    b.HasKey("Id");

                    b.HasIndex("Aperture");

                    b.HasIndex("Author");

                    b.HasIndex("CameraManufacturer");

                    b.HasIndex("CameraModel");

                    b.HasIndex("ColorSpace");

                    b.HasIndex("Comments");

                    b.HasIndex("Contrast");

                    b.HasIndex("CreationDate");

                    b.HasIndex("DigitalZoomRatio");

                    b.HasIndex("ExifVersion");

                    b.HasIndex("ExposureMethod");

                    b.HasIndex("ExposureProgram");

                    b.HasIndex("ExposureTime");

                    b.HasIndex("Flash");

                    b.HasIndex("Focal");

                    b.HasIndex("FocalLength");

                    b.HasIndex("FocalLengthEquivalent");

                    b.HasIndex("HorizontalResolution");

                    b.HasIndex("IsoRating");

                    b.HasIndex("Lens");

                    b.HasIndex("LicenseId");

                    b.HasIndex("LightSource");

                    b.HasIndex("MeteringMode");

                    b.HasIndex("Orientation");

                    b.HasIndex("OwnedMachineId");

                    b.HasIndex("ResolutionUnit");

                    b.HasIndex("Saturation");

                    b.HasIndex("SceneCaptureType");

                    b.HasIndex("SensingMethod");

                    b.HasIndex("Sharpness");

                    b.HasIndex("SoftwareUsed");

                    b.HasIndex("SubjectDistanceRange");

                    b.HasIndex("UploadDate");

                    b.HasIndex("UserId");

                    b.HasIndex("VerticalResolution");

                    b.HasIndex("WhiteBalance");

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

            modelBuilder.Entity("Marechai.Database.Models.PeopleByBook", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

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

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<int>("PersonId")
                        .HasColumnType("int");

                    b.Property<string>("RoleId")
                        .IsRequired()
                        .HasColumnType("char(3)");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("BookId");

                    b.HasIndex("PersonId");

                    b.HasIndex("RoleId");

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

            modelBuilder.Entity("Marechai.Database.Models.PeopleByCompany", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int(11)");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime?>("End")
                        .HasColumnType("datetime(6)");

                    b.Property<bool>("Ongoing")
                        .HasColumnType("bit(1)");

                    b.Property<int>("PersonId")
                        .HasColumnType("int");

                    b.Property<string>("Position")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<DateTime?>("Start")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("CompanyId");

                    b.HasIndex("End");

                    b.HasIndex("PersonId");

                    b.HasIndex("Position");

                    b.HasIndex("Start");

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

            modelBuilder.Entity("Marechai.Database.Models.PeopleByDocument", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

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

                    b.Property<int>("PersonId")
                        .HasColumnType("int");

                    b.Property<string>("RoleId")
                        .IsRequired()
                        .HasColumnType("char(3)");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("DocumentId");

                    b.HasIndex("PersonId");

                    b.HasIndex("RoleId");

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

            modelBuilder.Entity("Marechai.Database.Models.PeopleByMagazine", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

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

                    b.Property<int>("PersonId")
                        .HasColumnType("int");

                    b.Property<string>("RoleId")
                        .IsRequired()
                        .HasColumnType("char(3)");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("MagazineId");

                    b.HasIndex("PersonId");

                    b.HasIndex("RoleId");

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

            modelBuilder.Entity("Marechai.Database.Models.Person", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<string>("Alias")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<DateTime>("BirthDate")
                        .HasColumnType("datetime(6)");

                    b.Property<short?>("CountryOfBirthId")
                        .HasColumnType("smallint(3)");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime?>("DeathDate")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("DisplayName")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

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

                    b.Property<string>("Facebook")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<Guid>("Photo")
                        .HasColumnType("char(36)");

                    b.Property<string>("Surname")
                        .IsRequired()
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<string>("Twitter")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Webpage")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.HasKey("Id");

                    b.HasIndex("Alias");

                    b.HasIndex("BirthDate");

                    b.HasIndex("CountryOfBirthId");

                    b.HasIndex("DeathDate");

                    b.HasIndex("DisplayName");

                    b.HasIndex("Facebook");

                    b.HasIndex("Name");

                    b.HasIndex("Photo");

                    b.HasIndex("Surname");

                    b.HasIndex("Twitter");

                    b.HasIndex("Webpage");

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

            modelBuilder.Entity("Marechai.Database.Models.Processor", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("id")
                        .HasColumnType("int(11)");

                    b.Property<int?>("AddrBus")
                        .HasColumnName("addr_bus")
                        .HasColumnType("int(11)");

                    b.Property<int?>("CompanyId")
                        .HasColumnName("company")
                        .HasColumnType("int(11)");

                    b.Property<int?>("Cores")
                        .HasColumnName("cores")
                        .HasColumnType("int(11)");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<int?>("DataBus")
                        .HasColumnName("data_bus")
                        .HasColumnType("int(11)");

                    b.Property<float?>("DieSize")
                        .HasColumnName("die_size")
                        .HasColumnType("float");

                    b.Property<int?>("FprSize")
                        .HasColumnName("FPR_size")
                        .HasColumnType("int(11)");

                    b.Property<int?>("Fprs")
                        .HasColumnName("FPRs")
                        .HasColumnType("int(11)");

                    b.Property<int?>("GprSize")
                        .HasColumnName("GPR_size")
                        .HasColumnType("int(11)");

                    b.Property<int?>("Gprs")
                        .HasColumnName("GPRs")
                        .HasColumnType("int(11)");

                    b.Property<int?>("InstructionSetId")
                        .HasColumnName("instruction_set")
                        .HasColumnType("int(11)");

                    b.Property<DateTime?>("Introduced")
                        .HasColumnName("introduced")
                        .HasColumnType("datetime");

                    b.Property<float?>("L1Data")
                        .HasColumnName("L1_data")
                        .HasColumnType("float");

                    b.Property<float?>("L1Instruction")
                        .HasColumnName("L1_instruction")
                        .HasColumnType("float");

                    b.Property<float?>("L2")
                        .HasColumnType("float");

                    b.Property<float?>("L3")
                        .HasColumnType("float");

                    b.Property<string>("ModelCode")
                        .HasColumnName("model_code")
                        .HasColumnType("varchar(45)")
                        .HasMaxLength(45);

                    b.Property<string>("Name")
                        .IsRequired()
                        .ValueGeneratedOnAdd()
                        .HasColumnName("name")
                        .HasColumnType("char(50)")
                        .HasDefaultValueSql("''")
                        .HasMaxLength(50);

                    b.Property<string>("Package")
                        .HasColumnName("package")
                        .HasColumnType("varchar(45)")
                        .HasMaxLength(45);

                    b.Property<string>("Process")
                        .HasColumnName("process")
                        .HasColumnType("varchar(45)")
                        .HasMaxLength(45);

                    b.Property<float?>("ProcessNm")
                        .HasColumnName("process_nm")
                        .HasColumnType("float");

                    b.Property<int?>("SimdRegisters")
                        .HasColumnName("SIMD_registers")
                        .HasColumnType("int(11)");

                    b.Property<int?>("SimdSize")
                        .HasColumnName("SIMD_size")
                        .HasColumnType("int(11)");

                    b.Property<double?>("Speed")
                        .HasColumnName("speed")
                        .HasColumnType("double");

                    b.Property<int?>("ThreadsPerCore")
                        .HasColumnName("threads_per_core")
                        .HasColumnType("int(11)");

                    b.Property<long?>("Transistors")
                        .HasColumnName("transistors")
                        .HasColumnType("bigint(20)");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("AddrBus")
                        .HasName("idx_processors_addr_bus");

                    b.HasIndex("CompanyId")
                        .HasName("idx_processors_company");

                    b.HasIndex("Cores")
                        .HasName("idx_processors_cores");

                    b.HasIndex("DataBus")
                        .HasName("idx_processors_data_bus");

                    b.HasIndex("DieSize")
                        .HasName("idx_processors_die_size");

                    b.HasIndex("FprSize")
                        .HasName("idx_processors_FPR_size");

                    b.HasIndex("Fprs")
                        .HasName("idx_processors_FPRs");

                    b.HasIndex("GprSize")
                        .HasName("idx_processors_GPR_size");

                    b.HasIndex("Gprs")
                        .HasName("idx_processors_GPRs");

                    b.HasIndex("InstructionSetId")
                        .HasName("idx_processors_instruction_set");

                    b.HasIndex("Introduced")
                        .HasName("idx_processors_introduced");

                    b.HasIndex("L1Data")
                        .HasName("idx_processors_L1_data");

                    b.HasIndex("L1Instruction")
                        .HasName("idx_processors_L1_instruction");

                    b.HasIndex("L2")
                        .HasName("idx_processors_L2");

                    b.HasIndex("L3")
                        .HasName("idx_processors_L3");

                    b.HasIndex("ModelCode")
                        .HasName("idx_processors_model_code");

                    b.HasIndex("Name")
                        .HasName("idx_processors_name");

                    b.HasIndex("Package")
                        .HasName("idx_processors_package");

                    b.HasIndex("Process")
                        .HasName("idx_processors_process");

                    b.HasIndex("ProcessNm")
                        .HasName("idx_processors_process_nm");

                    b.HasIndex("SimdRegisters")
                        .HasName("idx_processors_SIMD_registers");

                    b.HasIndex("SimdSize")
                        .HasName("idx_processors_SIMD_size");

                    b.HasIndex("Speed")
                        .HasName("idx_processors_speed");

                    b.HasIndex("ThreadsPerCore")
                        .HasName("idx_processors_threads_per_core");

                    b.HasIndex("Transistors")
                        .HasName("idx_processors_transistors");

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

            modelBuilder.Entity("Marechai.Database.Models.ProcessorsByMachine", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("id")
                        .HasColumnType("bigint(20)");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<int>("MachineId")
                        .HasColumnName("machine")
                        .HasColumnType("int(11)");

                    b.Property<int>("ProcessorId")
                        .HasColumnName("processor")
                        .HasColumnType("int(11)");

                    b.Property<float?>("Speed")
                        .HasColumnName("speed")
                        .HasColumnType("float");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("MachineId")
                        .HasName("idx_processors_by_machine_machine");

                    b.HasIndex("ProcessorId")
                        .HasName("idx_processors_by_machine_processor");

                    b.HasIndex("Speed")
                        .HasName("idx_processors_by_machine_speed");

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

            modelBuilder.Entity("Marechai.Database.Models.ProcessorsByOwnedMachine", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

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

                    b.Property<int>("ProcessorId")
                        .HasColumnType("int(11)");

                    b.Property<float>("Speed")
                        .HasColumnType("float");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("OwnedMachineId");

                    b.HasIndex("ProcessorId");

                    b.HasIndex("Speed");

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

            modelBuilder.Entity("Marechai.Database.Models.Resolution", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("id")
                        .HasColumnType("int(11)");

                    b.Property<sbyte>("Chars")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("chars")
                        .HasColumnType("tinyint(1)")
                        .HasDefaultValueSql("'0'");

                    b.Property<long?>("Colors")
                        .HasColumnName("colors")
                        .HasColumnType("bigint(20)");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<bool>("Grayscale")
                        .HasColumnType("bit(1)");

                    b.Property<int>("Height")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("height")
                        .HasColumnType("int(11)")
                        .HasDefaultValueSql("'0'");

                    b.Property<long?>("Palette")
                        .HasColumnName("palette")
                        .HasColumnType("bigint(20)");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.Property<int>("Width")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("width")
                        .HasColumnType("int(11)")
                        .HasDefaultValueSql("'0'");

                    b.HasKey("Id");

                    b.HasIndex("Colors")
                        .HasName("idx_resolutions_colors");

                    b.HasIndex("Height")
                        .HasName("idx_resolutions_height");

                    b.HasIndex("Palette")
                        .HasName("idx_resolutions_palette");

                    b.HasIndex("Width")
                        .HasName("idx_resolutions_width");

                    b.HasIndex("Width", "Height")
                        .HasName("idx_resolutions_resolution");

                    b.HasIndex("Width", "Height", "Colors")
                        .HasName("idx_resolutions_resolution_with_color");

                    b.HasIndex("Width", "Height", "Colors", "Palette")
                        .HasName("idx_resolutions_resolution_with_color_and_palette");

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

            modelBuilder.Entity("Marechai.Database.Models.ResolutionsByGpu", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("id")
                        .HasColumnType("bigint(20)");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<int>("GpuId")
                        .HasColumnName("gpu")
                        .HasColumnType("int(11)");

                    b.Property<int>("ResolutionId")
                        .HasColumnName("resolution")
                        .HasColumnType("int(11)");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("GpuId")
                        .HasName("idx_resolutions_by_gpu_gpu");

                    b.HasIndex("ResolutionId")
                        .HasName("idx_resolutions_by_gpu_resolution");

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

            modelBuilder.Entity("Marechai.Database.Models.ResolutionsByScreen", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<int>("ResolutionId")
                        .HasColumnType("int(11)");

                    b.Property<int>("ScreenId")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("ResolutionId");

                    b.HasIndex("ScreenId");

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

            modelBuilder.Entity("Marechai.Database.Models.Screen", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<double>("Diagonal")
                        .HasColumnType("double");

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

                    b.Property<double?>("Height")
                        .HasColumnType("double");

                    b.Property<int>("NativeResolutionId")
                        .HasColumnType("int(11)");

                    b.Property<string>("Type")
                        .IsRequired()
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.Property<double?>("Width")
                        .HasColumnType("double");

                    b.HasKey("Id");

                    b.HasIndex("Diagonal");

                    b.HasIndex("EffectiveColors");

                    b.HasIndex("Height");

                    b.HasIndex("NativeResolutionId");

                    b.HasIndex("Type");

                    b.HasIndex("Width");

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

            modelBuilder.Entity("Marechai.Database.Models.ScreensByMachine", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<int>("MachineId")
                        .HasColumnType("int(11)");

                    b.Property<int>("ScreenId")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("MachineId");

                    b.HasIndex("ScreenId");

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

            modelBuilder.Entity("Marechai.Database.Models.SoundByMachine", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("id")
                        .HasColumnType("bigint(20)");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<int>("MachineId")
                        .HasColumnName("machine")
                        .HasColumnType("int(11)");

                    b.Property<int>("SoundSynthId")
                        .HasColumnName("sound_synth")
                        .HasColumnType("int(11)");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("MachineId")
                        .HasName("idx_sound_by_machine_machine");

                    b.HasIndex("SoundSynthId")
                        .HasName("idx_sound_by_machine_sound_synth");

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

            modelBuilder.Entity("Marechai.Database.Models.SoundByOwnedMachine", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

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

                    b.Property<int>("SoundSynthId")
                        .HasColumnType("int(11)");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("OwnedMachineId");

                    b.HasIndex("SoundSynthId");

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

            modelBuilder.Entity("Marechai.Database.Models.SoundSynth", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("id")
                        .HasColumnType("int(11)");

                    b.Property<int?>("CompanyId")
                        .HasColumnName("company")
                        .HasColumnType("int(11)");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<int?>("Depth")
                        .HasColumnName("depth")
                        .HasColumnType("int(11)");

                    b.Property<double?>("Frequency")
                        .HasColumnName("frequency")
                        .HasColumnType("double");

                    b.Property<DateTime?>("Introduced")
                        .HasColumnName("introduced")
                        .HasColumnType("datetime");

                    b.Property<string>("ModelCode")
                        .HasColumnName("model_code")
                        .HasColumnType("varchar(45)")
                        .HasMaxLength(45);

                    b.Property<string>("Name")
                        .IsRequired()
                        .ValueGeneratedOnAdd()
                        .HasColumnName("name")
                        .HasColumnType("char(50)")
                        .HasDefaultValueSql("''")
                        .HasMaxLength(50);

                    b.Property<int?>("SquareWave")
                        .HasColumnName("square_wave")
                        .HasColumnType("int(11)");

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

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.Property<int?>("Voices")
                        .HasColumnName("voices")
                        .HasColumnType("int(11)");

                    b.Property<int?>("WhiteNoise")
                        .HasColumnName("white_noise")
                        .HasColumnType("int(11)");

                    b.HasKey("Id");

                    b.HasIndex("CompanyId")
                        .HasName("idx_sound_synths_company");

                    b.HasIndex("Depth")
                        .HasName("idx_sound_synths_depth");

                    b.HasIndex("Frequency")
                        .HasName("idx_sound_synths_frequency");

                    b.HasIndex("Introduced")
                        .HasName("idx_sound_synths_introduced");

                    b.HasIndex("ModelCode")
                        .HasName("idx_sound_synths_model_code");

                    b.HasIndex("Name")
                        .HasName("idx_sound_synths_name");

                    b.HasIndex("SquareWave")
                        .HasName("idx_sound_synths_square_wave");

                    b.HasIndex("Type")
                        .HasName("idx_sound_synths_type");

                    b.HasIndex("Voices")
                        .HasName("idx_sound_synths_voices");

                    b.HasIndex("WhiteNoise")
                        .HasName("idx_sound_synths_white_noise");

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

            modelBuilder.Entity("Marechai.Database.Models.StorageByMachine", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("id")
                        .HasColumnType("bigint(20)");

                    b.Property<long?>("Capacity")
                        .HasColumnName("capacity")
                        .HasColumnType("bigint(20)");

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<int>("Interface")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("interface")
                        .HasColumnType("int(11)")
                        .HasDefaultValueSql("'0'");

                    b.Property<int>("MachineId")
                        .HasColumnName("machine")
                        .HasColumnType("int(11)");

                    b.Property<int>("Type")
                        .ValueGeneratedOnAdd()
                        .HasColumnName("type")
                        .HasColumnType("int(11)")
                        .HasDefaultValueSql("'0'");

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("Capacity")
                        .HasName("idx_storage_capacity");

                    b.HasIndex("Interface")
                        .HasName("idx_storage_interface");

                    b.HasIndex("MachineId")
                        .HasName("idx_storage_machine");

                    b.HasIndex("Type")
                        .HasName("idx_storage_type");

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

            modelBuilder.Entity("Marechai.Database.Models.StorageByOwnedMachine", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

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

                    b.Property<DateTime>("CreatedOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<int>("Interface")
                        .HasColumnType("int");

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

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

                    b.Property<DateTime>("UpdatedOn")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("Capacity");

                    b.HasIndex("Interface");

                    b.HasIndex("OwnedMachineId");

                    b.HasIndex("Type");

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

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<string>("ClaimType")
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<string>("ClaimValue")
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<string>("RoleId")
                        .IsRequired()
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.HasKey("Id");

                    b.HasIndex("RoleId");

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

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<string>("ClaimType")
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<string>("ClaimValue")
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<string>("UserId")
                        .IsRequired()
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.HasKey("Id");

                    b.HasIndex("UserId");

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

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
                {
                    b.Property<string>("LoginProvider")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<string>("ProviderKey")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<string>("ProviderDisplayName")
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<string>("UserId")
                        .IsRequired()
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.HasKey("LoginProvider", "ProviderKey");

                    b.HasIndex("UserId");

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

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
                {
                    b.Property<string>("UserId")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<string>("RoleId")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.HasKey("UserId", "RoleId");

                    b.HasIndex("RoleId");

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

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
                {
                    b.Property<string>("UserId")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<string>("LoginProvider")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<string>("Name")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<string>("Value")
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.HasKey("UserId", "LoginProvider", "Name");

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

            modelBuilder.Entity("Marechai.Database.Models.Audit", b =>
                {
                    b.HasOne("Marechai.Database.Models.ApplicationUser", "User")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Marechai.Database.Models.Book", b =>
                {
                    b.HasOne("Marechai.Database.Models.Iso31661Numeric", "Country")
                        .WithMany("Books")
                        .HasForeignKey("CountryId");

                    b.HasOne("Marechai.Database.Models.Book", "Previous")
                        .WithOne("Next")
                        .HasForeignKey("Marechai.Database.Models.Book", "PreviousId");

                    b.HasOne("Marechai.Database.Models.Book", "Source")
                        .WithMany("Derivates")
                        .HasForeignKey("SourceId");
                });

            modelBuilder.Entity("Marechai.Database.Models.BooksByMachine", b =>
                {
                    b.HasOne("Marechai.Database.Models.Book", "Book")
                        .WithMany("Machines")
                        .HasForeignKey("BookId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.Machine", "Machine")
                        .WithMany("Books")
                        .HasForeignKey("MachineId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Marechai.Database.Models.BooksByMachineFamily", b =>
                {
                    b.HasOne("Marechai.Database.Models.Book", "Book")
                        .WithMany("MachineFamilies")
                        .HasForeignKey("BookId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.MachineFamily", "MachineFamily")
                        .WithMany("Books")
                        .HasForeignKey("MachineFamilyId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Marechai.Database.Models.CompaniesByBook", b =>
                {
                    b.HasOne("Marechai.Database.Models.Book", "Book")
                        .WithMany("Companies")
                        .HasForeignKey("BookId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.DocumentCompany", "Company")
                        .WithMany("Books")
                        .HasForeignKey("CompanyId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.DocumentRole", "Role")
                        .WithMany()
                        .HasForeignKey("RoleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Marechai.Database.Models.CompaniesByDocument", b =>
                {
                    b.HasOne("Marechai.Database.Models.DocumentCompany", "Company")
                        .WithMany("Documents")
                        .HasForeignKey("CompanyId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.Document", "Document")
                        .WithMany("Companies")
                        .HasForeignKey("DocumentId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.DocumentRole", "Role")
                        .WithMany()
                        .HasForeignKey("RoleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Marechai.Database.Models.CompaniesByMagazine", b =>
                {
                    b.HasOne("Marechai.Database.Models.DocumentCompany", "Company")
                        .WithMany("Magazines")
                        .HasForeignKey("CompanyId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.Magazine", "Magazine")
                        .WithMany("Companies")
                        .HasForeignKey("MagazineId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.DocumentRole", "Role")
                        .WithMany()
                        .HasForeignKey("RoleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Marechai.Database.Models.Company", b =>
                {
                    b.HasOne("Marechai.Database.Models.Iso31661Numeric", "Country")
                        .WithMany("Companies")
                        .HasForeignKey("CountryId")
                        .HasConstraintName("fk_companies_country");

                    b.HasOne("Marechai.Database.Models.Company", "SoldTo")
                        .WithMany("InverseSoldToNavigation")
                        .HasForeignKey("SoldToId")
                        .HasConstraintName("fk_companies_sold_to");
                });

            modelBuilder.Entity("Marechai.Database.Models.CompanyDescription", b =>
                {
                    b.HasOne("Marechai.Database.Models.Company", "Company")
                        .WithMany("Descriptions")
                        .HasForeignKey("CompanyId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Marechai.Database.Models.CompanyLogo", b =>
                {
                    b.HasOne("Marechai.Database.Models.Company", "Company")
                        .WithMany("Logos")
                        .HasForeignKey("CompanyId")
                        .HasConstraintName("fk_company_logos_company1")
                        .IsRequired();
                });

            modelBuilder.Entity("Marechai.Database.Models.CurrencyInflation", b =>
                {
                    b.HasOne("Marechai.Database.Models.Iso4217", "Currency")
                        .WithMany()
                        .HasForeignKey("CurrencyCode")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Marechai.Database.Models.CurrencyPegging", b =>
                {
                    b.HasOne("Marechai.Database.Models.Iso4217", "Destination")
                        .WithMany()
                        .HasForeignKey("DestinationCode")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.Iso4217", "Source")
                        .WithMany()
                        .HasForeignKey("SourceCode")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Marechai.Database.Models.Document", b =>
                {
                    b.HasOne("Marechai.Database.Models.Iso31661Numeric", "Country")
                        .WithMany("Documents")
                        .HasForeignKey("CountryId");
                });

            modelBuilder.Entity("Marechai.Database.Models.DocumentCompany", b =>
                {
                    b.HasOne("Marechai.Database.Models.Company", "Company")
                        .WithOne("DocumentCompany")
                        .HasForeignKey("Marechai.Database.Models.DocumentCompany", "CompanyId")
                        .OnDelete(DeleteBehavior.SetNull);
                });

            modelBuilder.Entity("Marechai.Database.Models.DocumentPerson", b =>
                {
                    b.HasOne("Marechai.Database.Models.Person", "Person")
                        .WithOne("DocumentPerson")
                        .HasForeignKey("Marechai.Database.Models.DocumentPerson", "PersonId")
                        .OnDelete(DeleteBehavior.SetNull);
                });

            modelBuilder.Entity("Marechai.Database.Models.DocumentsByMachine", b =>
                {
                    b.HasOne("Marechai.Database.Models.Document", "Document")
                        .WithMany("Machines")
                        .HasForeignKey("DocumentId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.Machine", "Machine")
                        .WithMany("Documents")
                        .HasForeignKey("MachineId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Marechai.Database.Models.DocumentsByMachineFamily", b =>
                {
                    b.HasOne("Marechai.Database.Models.Document", "Document")
                        .WithMany("MachineFamilies")
                        .HasForeignKey("DocumentId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.MachineFamily", "MachineFamily")
                        .WithMany("Documents")
                        .HasForeignKey("MachineFamilyId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Marechai.Database.Models.FileDataStream", b =>
                {
                    b.HasOne("Marechai.Database.Models.DbFile", "File")
                        .WithMany()
                        .HasForeignKey("FileId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Marechai.Database.Models.FilesystemsByLogicalPartition", b =>
                {
                    b.HasOne("Marechai.Database.Models.Filesystem", "Filesystem")
                        .WithMany("Partitions")
                        .HasForeignKey("FilesystemId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.LogicalPartition", "Partition")
                        .WithMany("Filesystems")
                        .HasForeignKey("PartitionId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Marechai.Database.Models.Gpu", b =>
                {
                    b.HasOne("Marechai.Database.Models.Company", "Company")
                        .WithMany("Gpus")
                        .HasForeignKey("CompanyId")
                        .HasConstraintName("fk_gpus_company");
                });

            modelBuilder.Entity("Marechai.Database.Models.GpusByMachine", b =>
                {
                    b.HasOne("Marechai.Database.Models.Gpu", "Gpu")
                        .WithMany("GpusByMachine")
                        .HasForeignKey("GpuId")
                        .HasConstraintName("fk_gpus_by_machine_gpu")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.Machine", "Machine")
                        .WithMany("Gpus")
                        .HasForeignKey("MachineId")
                        .HasConstraintName("fk_gpus_by_machine_machine")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Marechai.Database.Models.GpusByOwnedMachine", b =>
                {
                    b.HasOne("Marechai.Database.Models.Gpu", "Gpu")
                        .WithMany()
                        .HasForeignKey("GpuId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.OwnedMachine", "OwnedMachine")
                        .WithMany("Gpus")
                        .HasForeignKey("OwnedMachineId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Marechai.Database.Models.InstructionSetExtensionsByProcessor", b =>
                {
                    b.HasOne("Marechai.Database.Models.InstructionSetExtension", "Extension")
                        .WithMany("InstructionSetExtensionsByProcessor")
                        .HasForeignKey("ExtensionId")
                        .HasConstraintName("fk_extension_extension_id")
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.Processor", "Processor")
                        .WithMany("InstructionSetExtensions")
                        .HasForeignKey("ProcessorId")
                        .HasConstraintName("fk_extension_processor_id")
                        .IsRequired();
                });

            modelBuilder.Entity("Marechai.Database.Models.Machine", b =>
                {
                    b.HasOne("Marechai.Database.Models.Company", "Company")
                        .WithMany("Machines")
                        .HasForeignKey("CompanyId")
                        .HasConstraintName("fk_machines_company")
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.MachineFamily", "Family")
                        .WithMany("Machines")
                        .HasForeignKey("FamilyId")
                        .HasConstraintName("fk_machines_family");
                });

            modelBuilder.Entity("Marechai.Database.Models.MachineFamily", b =>
                {
                    b.HasOne("Marechai.Database.Models.Company", "Company")
                        .WithMany("MachineFamilies")
                        .HasForeignKey("CompanyId")
                        .HasConstraintName("fk_machine_families_company")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Marechai.Database.Models.MachinePhoto", b =>
                {
                    b.HasOne("Marechai.Database.Models.License", "License")
                        .WithMany("Photos")
                        .HasForeignKey("LicenseId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.Machine", "Machine")
                        .WithMany("Photos")
                        .HasForeignKey("MachineId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.ApplicationUser", "User")
                        .WithMany("Photos")
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.SetNull);
                });

            modelBuilder.Entity("Marechai.Database.Models.Magazine", b =>
                {
                    b.HasOne("Marechai.Database.Models.Iso31661Numeric", "Country")
                        .WithMany("Magazines")
                        .HasForeignKey("CountryId");
                });

            modelBuilder.Entity("Marechai.Database.Models.MagazineIssue", b =>
                {
                    b.HasOne("Marechai.Database.Models.Magazine", "Magazine")
                        .WithMany("Issues")
                        .HasForeignKey("MagazineId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Marechai.Database.Models.MagazinesByMachine", b =>
                {
                    b.HasOne("Marechai.Database.Models.Machine", "Machine")
                        .WithMany("Magazines")
                        .HasForeignKey("MachineId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.MagazineIssue", "Magazine")
                        .WithMany("Machines")
                        .HasForeignKey("MagazineId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Marechai.Database.Models.MagazinesByMachineFamily", b =>
                {
                    b.HasOne("Marechai.Database.Models.MachineFamily", "MachineFamily")
                        .WithMany("Magazines")
                        .HasForeignKey("MachineFamilyId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.MagazineIssue", "Magazine")
                        .WithMany("MachineFamilies")
                        .HasForeignKey("MagazineId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Marechai.Database.Models.MemoryByMachine", b =>
                {
                    b.HasOne("Marechai.Database.Models.Machine", "Machine")
                        .WithMany("Memory")
                        .HasForeignKey("MachineId")
                        .HasConstraintName("fk_memory_by_machine_machine")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Marechai.Database.Models.MemoryByOwnedMachine", b =>
                {
                    b.HasOne("Marechai.Database.Models.OwnedMachine", "OwnedMachine")
                        .WithMany("Memory")
                        .HasForeignKey("OwnedMachineId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Marechai.Database.Models.OwnedMachine", b =>
                {
                    b.HasOne("Marechai.Database.Models.Machine", "Machine")
                        .WithMany()
                        .HasForeignKey("MachineId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.ApplicationUser", "User")
                        .WithMany("OwnedMachines")
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("Marechai.Database.Models.OwnedMachinePhoto", b =>
                {
                    b.HasOne("Marechai.Database.Models.License", "License")
                        .WithMany("OwnedMachinePhotos")
                        .HasForeignKey("LicenseId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.OwnedMachine", "OwnedMachine")
                        .WithMany("Photos")
                        .HasForeignKey("OwnedMachineId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.ApplicationUser", "User")
                        .WithMany("OwnedMachinePhotos")
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("Marechai.Database.Models.PeopleByBook", b =>
                {
                    b.HasOne("Marechai.Database.Models.Book", "Book")
                        .WithMany("People")
                        .HasForeignKey("BookId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.DocumentPerson", "Person")
                        .WithMany("Books")
                        .HasForeignKey("PersonId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.DocumentRole", "Role")
                        .WithMany()
                        .HasForeignKey("RoleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Marechai.Database.Models.PeopleByCompany", b =>
                {
                    b.HasOne("Marechai.Database.Models.Company", "Company")
                        .WithMany("People")
                        .HasForeignKey("CompanyId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.Person", "Person")
                        .WithMany("Companies")
                        .HasForeignKey("PersonId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Marechai.Database.Models.PeopleByDocument", b =>
                {
                    b.HasOne("Marechai.Database.Models.Document", "Document")
                        .WithMany("People")
                        .HasForeignKey("DocumentId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.DocumentPerson", "Person")
                        .WithMany("Documents")
                        .HasForeignKey("PersonId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.DocumentRole", "Role")
                        .WithMany()
                        .HasForeignKey("RoleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Marechai.Database.Models.PeopleByMagazine", b =>
                {
                    b.HasOne("Marechai.Database.Models.MagazineIssue", "Magazine")
                        .WithMany("People")
                        .HasForeignKey("MagazineId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.DocumentPerson", "Person")
                        .WithMany("Magazines")
                        .HasForeignKey("PersonId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.DocumentRole", "Role")
                        .WithMany()
                        .HasForeignKey("RoleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Marechai.Database.Models.Person", b =>
                {
                    b.HasOne("Marechai.Database.Models.Iso31661Numeric", "CountryOfBirth")
                        .WithMany("People")
                        .HasForeignKey("CountryOfBirthId");
                });

            modelBuilder.Entity("Marechai.Database.Models.Processor", b =>
                {
                    b.HasOne("Marechai.Database.Models.Company", "Company")
                        .WithMany("Processors")
                        .HasForeignKey("CompanyId")
                        .HasConstraintName("fk_processors_company");

                    b.HasOne("Marechai.Database.Models.InstructionSet", "InstructionSet")
                        .WithMany("Processors")
                        .HasForeignKey("InstructionSetId")
                        .HasConstraintName("fk_processors_instruction_set");
                });

            modelBuilder.Entity("Marechai.Database.Models.ProcessorsByMachine", b =>
                {
                    b.HasOne("Marechai.Database.Models.Machine", "Machine")
                        .WithMany("Processors")
                        .HasForeignKey("MachineId")
                        .HasConstraintName("fk_processors_by_machine_machine")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.Processor", "Processor")
                        .WithMany("ProcessorsByMachine")
                        .HasForeignKey("ProcessorId")
                        .HasConstraintName("fk_processors_by_machine_processor")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Marechai.Database.Models.ProcessorsByOwnedMachine", b =>
                {
                    b.HasOne("Marechai.Database.Models.OwnedMachine", "OwnedMachine")
                        .WithMany("Processors")
                        .HasForeignKey("OwnedMachineId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.Processor", "Processor")
                        .WithMany()
                        .HasForeignKey("ProcessorId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Marechai.Database.Models.ResolutionsByGpu", b =>
                {
                    b.HasOne("Marechai.Database.Models.Gpu", "Gpu")
                        .WithMany("ResolutionsByGpu")
                        .HasForeignKey("GpuId")
                        .HasConstraintName("fk_resolutions_by_gpu_gpu")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.Resolution", "Resolution")
                        .WithMany("ResolutionsByGpu")
                        .HasForeignKey("ResolutionId")
                        .HasConstraintName("fk_resolutions_by_gpu_resolution")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Marechai.Database.Models.ResolutionsByScreen", b =>
                {
                    b.HasOne("Marechai.Database.Models.Resolution", "Resolution")
                        .WithMany("ResolutionsByScreen")
                        .HasForeignKey("ResolutionId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.Screen", "Screen")
                        .WithMany("Resolutions")
                        .HasForeignKey("ScreenId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Marechai.Database.Models.Screen", b =>
                {
                    b.HasOne("Marechai.Database.Models.Resolution", "NativeResolution")
                        .WithMany("Screens")
                        .HasForeignKey("NativeResolutionId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Marechai.Database.Models.ScreensByMachine", b =>
                {
                    b.HasOne("Marechai.Database.Models.Machine", "Machine")
                        .WithMany("Screens")
                        .HasForeignKey("MachineId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.Screen", "Screen")
                        .WithMany("ScreensByMachines")
                        .HasForeignKey("ScreenId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Marechai.Database.Models.SoundByMachine", b =>
                {
                    b.HasOne("Marechai.Database.Models.Machine", "Machine")
                        .WithMany("Sound")
                        .HasForeignKey("MachineId")
                        .HasConstraintName("fk_sound_by_machine_machine")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.SoundSynth", "SoundSynth")
                        .WithMany("SoundByMachine")
                        .HasForeignKey("SoundSynthId")
                        .HasConstraintName("fk_sound_by_machine_sound_synth")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Marechai.Database.Models.SoundByOwnedMachine", b =>
                {
                    b.HasOne("Marechai.Database.Models.OwnedMachine", "OwnedMachine")
                        .WithMany("Sound")
                        .HasForeignKey("OwnedMachineId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.SoundSynth", "SoundSynth")
                        .WithMany()
                        .HasForeignKey("SoundSynthId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Marechai.Database.Models.SoundSynth", b =>
                {
                    b.HasOne("Marechai.Database.Models.Company", "Company")
                        .WithMany("SoundSynths")
                        .HasForeignKey("CompanyId")
                        .HasConstraintName("fk_sound_synths_company");
                });

            modelBuilder.Entity("Marechai.Database.Models.StorageByMachine", b =>
                {
                    b.HasOne("Marechai.Database.Models.Machine", "Machine")
                        .WithMany("Storage")
                        .HasForeignKey("MachineId")
                        .HasConstraintName("fk_storage_by_machine_machine")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Marechai.Database.Models.StorageByOwnedMachine", b =>
                {
                    b.HasOne("Marechai.Database.Models.OwnedMachine", "OwnedMachine")
                        .WithMany("Storage")
                        .HasForeignKey("OwnedMachineId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
                {
                    b.HasOne("Marechai.Database.Models.ApplicationRole", null)
                        .WithMany()
                        .HasForeignKey("RoleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
                {
                    b.HasOne("Marechai.Database.Models.ApplicationUser", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
                {
                    b.HasOne("Marechai.Database.Models.ApplicationUser", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
                {
                    b.HasOne("Marechai.Database.Models.ApplicationRole", null)
                        .WithMany()
                        .HasForeignKey("RoleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Marechai.Database.Models.ApplicationUser", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
                {
                    b.HasOne("Marechai.Database.Models.ApplicationUser", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });
#pragma warning restore 612, 618
        }
    }
}
