diff --git a/Marechai.Database/Enums.cs b/Marechai.Database/Enums.cs index d1137b3f..5f4da583 100644 --- a/Marechai.Database/Enums.cs +++ b/Marechai.Database/Enums.cs @@ -520,4 +520,10 @@ namespace Marechai.Database R = 1 << 2, S = 1 << 3, T = 1 << 4, U = 1 << 5, V = 1 << 6, W = 1 << 7 } + + public enum DistributionMode : uint + { + Unknown = 0, Retail = 1, Bundle = 2, + Oem = 3 + } } \ No newline at end of file diff --git a/Marechai.Database/Migrations/20200611212211_AddSoftwareVariant.Designer.cs b/Marechai.Database/Migrations/20200611212211_AddSoftwareVariant.Designer.cs new file mode 100644 index 00000000..89606925 --- /dev/null +++ b/Marechai.Database/Migrations/20200611212211_AddSoftwareVariant.Designer.cs @@ -0,0 +1,6672 @@ +// +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("20200611212211_AddSoftwareVariant")] + partial class AddSoftwareVariant + { + 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("Id") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Created") + .HasColumnType("datetime(6)"); + + b.Property("Description") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Name") + .HasColumnType("varchar(256) CHARACTER SET utf8mb4") + .HasMaxLength(256); + + b.Property("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("Id") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("AccessFailedCount") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Email") + .HasColumnType("varchar(256) CHARACTER SET utf8mb4") + .HasMaxLength(256); + + b.Property("EmailConfirmed") + .HasColumnType("bit(1)"); + + b.Property("LockoutEnabled") + .HasColumnType("bit(1)"); + + b.Property("LockoutEnd") + .HasColumnType("datetime(6)"); + + b.Property("NormalizedEmail") + .HasColumnType("varchar(256) CHARACTER SET utf8mb4") + .HasMaxLength(256); + + b.Property("NormalizedUserName") + .HasColumnType("varchar(256) CHARACTER SET utf8mb4") + .HasMaxLength(256); + + b.Property("PasswordHash") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("PhoneNumber") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("bit(1)"); + + b.Property("SecurityStamp") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("TwoFactorEnabled") + .HasColumnType("bit(1)"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("AffectedColumns") + .HasColumnType("json"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("Keys") + .HasColumnType("json"); + + b.Property("NewValues") + .HasColumnType("json"); + + b.Property("OldValues") + .HasColumnType("json"); + + b.Property("Table") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("Type") + .HasColumnType("tinyint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CountryId") + .HasColumnType("smallint(3)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("Edition") + .HasColumnType("int"); + + b.Property("Isbn") + .HasColumnType("varchar(13) CHARACTER SET utf8mb4") + .HasMaxLength(13); + + b.Property("NativeTitle") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("Pages") + .HasColumnType("smallint"); + + b.Property("PreviousId") + .HasColumnType("bigint"); + + b.Property("Published") + .HasColumnType("datetime(6)"); + + b.Property("SourceId") + .HasColumnType("bigint"); + + b.Property("Synopsis") + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasMaxLength(262144); + + b.Property("Title") + .IsRequired() + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("BookId") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("MachineId") + .HasColumnType("int(11)"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("BookId") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("MachineFamilyId") + .HasColumnType("int(11)"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnName("id") + .HasColumnType("int(11)"); + + b.Property("Agif") + .ValueGeneratedOnAdd() + .HasColumnName("agif") + .HasColumnType("tinyint(1)") + .HasDefaultValueSql("'0'"); + + b.Property("Browser") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnName("browser") + .HasColumnType("varchar(64)") + .HasDefaultValueSql("''") + .HasMaxLength(64); + + b.Property("Colors") + .ValueGeneratedOnAdd() + .HasColumnName("colors") + .HasColumnType("tinyint(1)") + .HasDefaultValueSql("'0'"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("Flash") + .ValueGeneratedOnAdd() + .HasColumnName("flash") + .HasColumnType("tinyint(1)") + .HasDefaultValueSql("'0'"); + + b.Property("Frames") + .ValueGeneratedOnAdd() + .HasColumnName("frames") + .HasColumnType("tinyint(1)") + .HasDefaultValueSql("'0'"); + + b.Property("Gif87") + .ValueGeneratedOnAdd() + .HasColumnName("gif87") + .HasColumnType("tinyint(1)") + .HasDefaultValueSql("'0'"); + + b.Property("Gif89") + .ValueGeneratedOnAdd() + .HasColumnName("gif89") + .HasColumnType("tinyint(1)") + .HasDefaultValueSql("'0'"); + + b.Property("Jpeg") + .ValueGeneratedOnAdd() + .HasColumnName("jpeg") + .HasColumnType("tinyint(1)") + .HasDefaultValueSql("'0'"); + + b.Property("Js") + .ValueGeneratedOnAdd() + .HasColumnName("js") + .HasColumnType("tinyint(1)") + .HasDefaultValueSql("'0'"); + + b.Property("Os") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnName("os") + .HasColumnType("varchar(32)") + .HasDefaultValueSql("''") + .HasMaxLength(32); + + b.Property("Platform") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnName("platform") + .HasColumnType("varchar(8)") + .HasDefaultValueSql("''") + .HasMaxLength(8); + + b.Property("Png") + .ValueGeneratedOnAdd() + .HasColumnName("png") + .HasColumnType("tinyint(1)") + .HasDefaultValueSql("'0'"); + + b.Property("Pngt") + .ValueGeneratedOnAdd() + .HasColumnName("pngt") + .HasColumnType("tinyint(1)") + .HasDefaultValueSql("'0'"); + + b.Property("Table") + .ValueGeneratedOnAdd() + .HasColumnName("table") + .HasColumnType("tinyint(1)") + .HasDefaultValueSql("'0'"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("UserAgent") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnName("user_agent") + .HasColumnType("varchar(128)") + .HasDefaultValueSql("''") + .HasMaxLength(128); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("BookId") + .HasColumnType("bigint"); + + b.Property("CompanyId") + .HasColumnType("int"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("char(3)"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CompanyId") + .HasColumnType("int"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("DocumentId") + .HasColumnType("bigint"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("char(3)"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CompanyId") + .HasColumnType("int"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("MagazineId") + .HasColumnType("bigint"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("char(3)"); + + b.Property("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.CompaniesBySoftwareFamily", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("CompanyId") + .HasColumnType("int(11)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("char(3)"); + + b.Property("SoftwareFamilyId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("CompanyId"); + + b.HasIndex("RoleId"); + + b.HasIndex("SoftwareFamilyId"); + + b.ToTable("CompaniesBySoftwareFamily"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CompaniesBySoftwareVariant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("CompanyId") + .HasColumnType("int(11)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("char(3)"); + + b.Property("SoftwareVariantId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("CompanyId"); + + b.HasIndex("RoleId"); + + b.HasIndex("SoftwareVariantId"); + + b.ToTable("CompaniesBySoftwareVariant"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CompaniesBySoftwareVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("CompanyId") + .HasColumnType("int(11)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("char(3)"); + + b.Property("SoftwareVersionId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("CompanyId"); + + b.HasIndex("RoleId"); + + b.HasIndex("SoftwareVersionId"); + + b.ToTable("CompaniesBySoftwareVersion"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Company", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnName("id") + .HasColumnType("int(11)"); + + b.Property("Address") + .HasColumnName("address") + .HasColumnType("varchar(80)") + .HasMaxLength(80); + + b.Property("City") + .HasColumnName("city") + .HasColumnType("varchar(80)") + .HasMaxLength(80); + + b.Property("CountryId") + .HasColumnName("country") + .HasColumnType("smallint(3)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("DocumentCompanyId") + .HasColumnType("int"); + + b.Property("Facebook") + .HasColumnName("facebook") + .HasColumnType("varchar(45)") + .HasMaxLength(45); + + b.Property("Founded") + .HasColumnName("founded") + .HasColumnType("datetime"); + + b.Property("Name") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnName("name") + .HasColumnType("varchar(128)") + .HasDefaultValueSql("''"); + + b.Property("PostalCode") + .HasColumnName("postal_code") + .HasColumnType("varchar(25)") + .HasMaxLength(25); + + b.Property("Province") + .HasColumnName("province") + .HasColumnType("varchar(80)") + .HasMaxLength(80); + + b.Property("Sold") + .HasColumnName("sold") + .HasColumnType("datetime"); + + b.Property("SoldToId") + .HasColumnName("sold_to") + .HasColumnType("int(11)"); + + b.Property("Status") + .HasColumnName("status") + .HasColumnType("int(11)"); + + b.Property("Twitter") + .HasColumnName("twitter") + .HasColumnType("varchar(45)") + .HasMaxLength(45); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("CompanyId") + .HasColumnType("int(11)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("Html") + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasMaxLength(262144); + + b.Property("Text") + .IsRequired() + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasMaxLength(262144); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnName("id") + .HasColumnType("int(11)"); + + b.Property("CompanyId") + .HasColumnName("company_id") + .HasColumnType("int(11)"); + + b.Property("Guid") + .HasColumnName("logo_guid") + .HasColumnType("char(36)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("CurrencyCode") + .IsRequired() + .HasColumnType("varchar(3) CHARACTER SET utf8mb4"); + + b.Property("Inflation") + .HasColumnType("float"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("DestinationCode") + .IsRequired() + .HasColumnType("varchar(3) CHARACTER SET utf8mb4"); + + b.Property("End") + .HasColumnType("datetime(6)"); + + b.Property("Ratio") + .HasColumnType("float"); + + b.Property("SourceCode") + .IsRequired() + .HasColumnType("varchar(3) CHARACTER SET utf8mb4"); + + b.Property("Start") + .HasColumnType("datetime(6)"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("AccoustId") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("Hack") + .HasColumnType("bit(1)"); + + b.Property("HackGroup") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("Infected") + .HasColumnType("bit(1)"); + + b.Property("Magic") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("Malware") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("Md5") + .HasColumnType("binary(16)"); + + b.Property("Mime") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("Sha1") + .HasColumnType("binary(20)"); + + b.Property("Sha256") + .HasColumnType("binary(32)"); + + b.Property("Sha3") + .HasColumnType("binary(64)"); + + b.Property("Size") + .HasColumnType("bigint unsigned"); + + b.Property("Spamsum") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CountryId") + .HasColumnType("smallint(3)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("NativeTitle") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("Published") + .HasColumnType("datetime(6)"); + + b.Property("Synopsis") + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasMaxLength(262144); + + b.Property("Title") + .IsRequired() + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("CompanyId") + .HasColumnType("int(11)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Alias") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("DisplayName") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("PersonId") + .HasColumnType("int"); + + b.Property("Surname") + .IsRequired() + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("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("Id") + .HasColumnType("char(3)"); + + b.Property("Enabled") + .ValueGeneratedOnAdd() + .HasColumnType("bit(1)") + .HasDefaultValue(true); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("DocumentId") + .HasColumnType("bigint"); + + b.Property("MachineId") + .HasColumnType("int(11)"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("DocumentId") + .HasColumnType("bigint"); + + b.Property("MachineFamilyId") + .HasColumnType("int(11)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("MachineFamilyId"); + + b.ToTable("DocumentsByMachineFamily"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Dump", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("DumpDate") + .HasColumnType("datetime(6)"); + + b.Property("Dumper") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("DumpingGroup") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("MediaDumpId") + .HasColumnType("bigint unsigned"); + + b.Property("MediaId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("UserId") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.HasIndex("DumpDate"); + + b.HasIndex("Dumper"); + + b.HasIndex("DumpingGroup"); + + b.HasIndex("MediaDumpId"); + + b.HasIndex("MediaId"); + + b.HasIndex("UserId"); + + b.ToTable("Dumps"); + }); + + modelBuilder.Entity("Marechai.Database.Models.DumpHardware", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("DumpId") + .HasColumnType("bigint unsigned"); + + b.Property("Extents") + .IsRequired() + .HasColumnType("json"); + + b.Property("Firmware") + .HasColumnType("varchar(32) CHARACTER SET utf8mb4") + .HasMaxLength(32); + + b.Property("Manufacturer") + .HasColumnType("varchar(48) CHARACTER SET utf8mb4") + .HasMaxLength(48); + + b.Property("Model") + .IsRequired() + .HasColumnType("varchar(48) CHARACTER SET utf8mb4") + .HasMaxLength(48); + + b.Property("Revision") + .HasColumnType("varchar(48) CHARACTER SET utf8mb4") + .HasMaxLength(48); + + b.Property("Serial") + .HasColumnType("varchar(64) CHARACTER SET utf8mb4") + .HasMaxLength(64); + + b.Property("SoftwareName") + .IsRequired() + .HasColumnType("varchar(64) CHARACTER SET utf8mb4") + .HasMaxLength(64); + + b.Property("SoftwareOperatingSystem") + .HasColumnType("varchar(64) CHARACTER SET utf8mb4") + .HasMaxLength(64); + + b.Property("SoftwareVersion") + .HasColumnType("varchar(32) CHARACTER SET utf8mb4") + .HasMaxLength(32); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("DumpId"); + + 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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("FileId") + .HasColumnType("bigint unsigned"); + + b.Property("Name") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("Size") + .HasColumnType("bigint unsigned"); + + b.Property("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.FileDataStreamsByMediaFile", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("FileDataStreamId") + .HasColumnType("bigint unsigned"); + + b.Property("MediaFileId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("FileDataStreamId"); + + b.HasIndex("MediaFileId"); + + b.ToTable("FileDataStreamsByMediaFile"); + }); + + modelBuilder.Entity("Marechai.Database.Models.FileDataStreamsByStandaloneFile", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("FileDataStreamId") + .HasColumnType("bigint unsigned"); + + b.Property("StandaloneFileId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("FileDataStreamId"); + + b.HasIndex("StandaloneFileId"); + + b.ToTable("FileDataStreamsByStandaloneFile"); + }); + + modelBuilder.Entity("Marechai.Database.Models.FilesByFilesystem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("FileId") + .HasColumnType("bigint unsigned"); + + b.Property("FilesystemId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("FileId"); + + b.HasIndex("FilesystemId"); + + b.ToTable("FilesByFilesystem"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Filesystem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("ApplicationIdentifier") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("BackupDate") + .HasColumnType("datetime(6)"); + + b.Property("Bootable") + .HasColumnType("bit(1)"); + + b.Property("ClusterSize") + .HasColumnType("int"); + + b.Property("Clusters") + .HasColumnType("bigint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("DataPreparerIdentifier") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("EffectiveDate") + .HasColumnType("datetime(6)"); + + b.Property("ExpirationDate") + .HasColumnType("datetime(6)"); + + b.Property("FilesCount") + .HasColumnType("bigint unsigned"); + + b.Property("FreeClusters") + .HasColumnType("bigint unsigned"); + + b.Property("Label") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("ModificationDate") + .HasColumnType("datetime(6)"); + + b.Property("PublisherIdentifier") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("Serial") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("SystemIdentifier") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("Type") + .IsRequired() + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("FilesystemId") + .HasColumnType("bigint unsigned"); + + b.Property("PartitionId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("FilesystemId"); + + b.HasIndex("PartitionId"); + + b.ToTable("FilesystemsByLogicalPartition"); + }); + + modelBuilder.Entity("Marechai.Database.Models.FilesystemsByMediaDumpFile", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("FilesystemId") + .HasColumnType("bigint unsigned"); + + b.Property("MediaDumpFileImageId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("FilesystemId"); + + b.HasIndex("MediaDumpFileImageId"); + + b.ToTable("FilesystemsByMediaDumpFile"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Forbidden", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnName("id") + .HasColumnType("int(11)"); + + b.Property("Browser") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnName("browser") + .HasColumnType("char(128)") + .HasDefaultValueSql("''"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("Date") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnName("date") + .HasColumnType("char(20)") + .HasDefaultValueSql("''"); + + b.Property("Ip") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnName("ip") + .HasColumnType("char(16)") + .HasDefaultValueSql("''"); + + b.Property("Referer") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnName("referer") + .HasColumnType("char(255)") + .HasDefaultValueSql("''"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnName("id") + .HasColumnType("int(11)"); + + b.Property("CompanyId") + .HasColumnName("company") + .HasColumnType("int(11)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("DieSize") + .HasColumnName("die_size") + .HasColumnType("float"); + + b.Property("Introduced") + .HasColumnName("introduced") + .HasColumnType("datetime"); + + b.Property("ModelCode") + .HasColumnName("model_code") + .HasColumnType("varchar(45)") + .HasMaxLength(45); + + b.Property("Name") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnName("name") + .HasColumnType("char(128)") + .HasDefaultValueSql("''") + .HasMaxLength(128); + + b.Property("Package") + .HasColumnName("package") + .HasColumnType("varchar(45)") + .HasMaxLength(45); + + b.Property("Process") + .HasColumnName("process") + .HasColumnType("varchar(45)") + .HasMaxLength(45); + + b.Property("ProcessNm") + .HasColumnName("process_nm") + .HasColumnType("float"); + + b.Property("Transistors") + .HasColumnName("transistors") + .HasColumnType("bigint(20)"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnName("id") + .HasColumnType("bigint(20)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("GpuId") + .HasColumnName("gpu") + .HasColumnType("int(11)"); + + b.Property("MachineId") + .HasColumnName("machine") + .HasColumnType("int(11)"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("GpuId") + .HasColumnType("int(11)"); + + b.Property("OwnedMachineId") + .HasColumnType("bigint"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("GpuId"); + + b.HasIndex("OwnedMachineId"); + + b.ToTable("GpusByOwnedMachine"); + }); + + modelBuilder.Entity("Marechai.Database.Models.GpusBySoftwareVariant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("GpuId") + .HasColumnType("int(11)"); + + b.Property("Minimum") + .HasColumnType("bit(1)"); + + b.Property("Recommended") + .HasColumnType("bit(1)"); + + b.Property("SoftwareVariantId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("GpuId"); + + b.HasIndex("Minimum"); + + b.HasIndex("Recommended"); + + b.HasIndex("SoftwareVariantId"); + + b.ToTable("GpusBySoftwareVariant"); + }); + + modelBuilder.Entity("Marechai.Database.Models.InstructionSet", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnName("id") + .HasColumnType("int(11)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("Name") + .IsRequired() + .HasColumnName("instruction_set") + .HasColumnType("varchar(45)") + .HasMaxLength(45); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.ToTable("instruction_sets"); + }); + + modelBuilder.Entity("Marechai.Database.Models.InstructionSetExtension", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnName("id") + .HasColumnType("int(11)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("Extension") + .IsRequired() + .HasColumnName("extension") + .HasColumnType("varchar(45)") + .HasMaxLength(45); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.ToTable("instruction_set_extensions"); + }); + + modelBuilder.Entity("Marechai.Database.Models.InstructionSetExtensionsByProcessor", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnName("id") + .HasColumnType("int(11)"); + + b.Property("ProcessorId") + .HasColumnName("processor_id") + .HasColumnType("int(11)"); + + b.Property("ExtensionId") + .HasColumnName("extension_id") + .HasColumnType("int(11)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("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.InstructionSetsBySoftwareVariant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("InstructionSetId") + .HasColumnType("int(11)"); + + b.Property("SoftwareVariantId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("InstructionSetId"); + + b.HasIndex("SoftwareVariantId"); + + b.ToTable("InstructionSetsBySoftwareVariant"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Iso31661Numeric", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnName("id") + .HasColumnType("smallint(3)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("Name") + .IsRequired() + .HasColumnName("name") + .HasColumnType("varchar(64)") + .HasMaxLength(64); + + b.Property("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("Code") + .HasColumnType("varchar(3) CHARACTER SET utf8mb4") + .HasMaxLength(3); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("MinorUnits") + .HasColumnType("tinyint unsigned"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(150) CHARACTER SET utf8mb4") + .HasMaxLength(150); + + b.Property("Numeric") + .HasColumnType("smallint(3)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("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("Id") + .HasColumnType("char(3)"); + + b.Property("Comment") + .HasColumnType("varchar(150)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("Part1") + .HasColumnType("char(2)"); + + b.Property("Part2B") + .HasColumnType("char(3)"); + + b.Property("Part2T") + .HasColumnType("char(3)"); + + b.Property("ReferenceName") + .IsRequired() + .HasColumnName("Ref_Name") + .HasColumnType("varchar(150)"); + + b.Property("Scope") + .IsRequired() + .HasColumnType("char(1)"); + + b.Property("Type") + .IsRequired() + .HasColumnType("char(1)"); + + b.Property("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.LanguagesBySoftwareVariant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("LanguageId") + .IsRequired() + .HasColumnType("char(3)"); + + b.Property("SoftwareVariantId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("LanguageId"); + + b.HasIndex("SoftwareVariantId"); + + b.ToTable("LanguagesBySoftwareVariant"); + }); + + modelBuilder.Entity("Marechai.Database.Models.License", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("FsfApproved") + .HasColumnType("bit(1)"); + + b.Property("Link") + .HasColumnType("varchar(512) CHARACTER SET utf8mb4") + .HasMaxLength(512); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("OsiApproved") + .HasColumnType("bit(1)"); + + b.Property("SPDX") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("Text") + .HasColumnType("longtext") + .HasMaxLength(131072); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnName("id") + .HasColumnType("int(11)"); + + b.Property("Browser") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnName("browser") + .HasColumnType("char(128)") + .HasDefaultValueSql("''"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("Date") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnName("date") + .HasColumnType("char(20)") + .HasDefaultValueSql("''"); + + b.Property("Ip") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnName("ip") + .HasColumnType("char(16)") + .HasDefaultValueSql("''"); + + b.Property("Referer") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnName("referer") + .HasColumnType("char(255)") + .HasDefaultValueSql("''"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("Description") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("FirstSector") + .HasColumnType("bigint unsigned"); + + b.Property("LastSector") + .HasColumnType("bigint unsigned"); + + b.Property("Name") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("Scheme") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("Sequence") + .HasColumnType("int unsigned"); + + b.Property("Size") + .HasColumnType("bigint unsigned"); + + b.Property("Type") + .IsRequired() + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("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.LogicalPartitionsByMedia", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("MediaId") + .HasColumnType("bigint unsigned"); + + b.Property("PartitionId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("MediaId"); + + b.HasIndex("PartitionId"); + + b.ToTable("LogicalPartitionsByMedia"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Machine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnName("id") + .HasColumnType("int(11)"); + + b.Property("CompanyId") + .ValueGeneratedOnAdd() + .HasColumnName("company") + .HasColumnType("int(11)") + .HasDefaultValueSql("'0'"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("FamilyId") + .HasColumnName("family") + .HasColumnType("int(11)"); + + b.Property("Introduced") + .HasColumnName("introduced") + .HasColumnType("datetime"); + + b.Property("Model") + .HasColumnName("model") + .HasColumnType("varchar(50)") + .HasMaxLength(50); + + b.Property("Name") + .IsRequired() + .HasColumnName("name") + .HasColumnType("varchar(255)") + .HasMaxLength(255); + + b.Property("Type") + .ValueGeneratedOnAdd() + .HasColumnName("type") + .HasColumnType("int(11)") + .HasDefaultValueSql("'0'"); + + b.Property("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.MachineFamiliesBySoftwareVariant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("MachineFamilyId") + .HasColumnType("int(11)"); + + b.Property("SoftwareVariantId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("MachineFamilyId"); + + b.HasIndex("SoftwareVariantId"); + + b.ToTable("MachineFamiliesBySoftwareVariant"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MachineFamily", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnName("id") + .HasColumnType("int(11)"); + + b.Property("CompanyId") + .HasColumnName("company") + .HasColumnType("int(11)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("Name") + .IsRequired() + .HasColumnName("name") + .HasColumnType("varchar(255)") + .HasMaxLength(255); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Aperture") + .HasColumnType("double"); + + b.Property("Author") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("CameraManufacturer") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("CameraModel") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("ColorSpace") + .HasColumnType("smallint unsigned"); + + b.Property("Comments") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("Contrast") + .HasColumnType("smallint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("DigitalZoomRatio") + .HasColumnType("double"); + + b.Property("ExifVersion") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("ExposureMethod") + .HasColumnType("smallint unsigned"); + + b.Property("ExposureProgram") + .HasColumnType("smallint unsigned"); + + b.Property("ExposureTime") + .HasColumnType("double"); + + b.Property("Flash") + .HasColumnType("smallint unsigned"); + + b.Property("Focal") + .HasColumnType("double"); + + b.Property("FocalLength") + .HasColumnType("double"); + + b.Property("FocalLengthEquivalent") + .HasColumnType("double"); + + b.Property("HorizontalResolution") + .HasColumnType("double"); + + b.Property("IsoRating") + .HasColumnType("smallint unsigned"); + + b.Property("Lens") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("LicenseId") + .HasColumnType("int"); + + b.Property("LightSource") + .HasColumnType("smallint unsigned"); + + b.Property("MachineId") + .HasColumnType("int(11)"); + + b.Property("MeteringMode") + .HasColumnType("smallint unsigned"); + + b.Property("Orientation") + .HasColumnType("smallint unsigned"); + + b.Property("OriginalExtension") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("ResolutionUnit") + .HasColumnType("smallint unsigned"); + + b.Property("Saturation") + .HasColumnType("smallint unsigned"); + + b.Property("SceneCaptureType") + .HasColumnType("smallint unsigned"); + + b.Property("SensingMethod") + .HasColumnType("smallint unsigned"); + + b.Property("Sharpness") + .HasColumnType("smallint unsigned"); + + b.Property("SoftwareUsed") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("Source") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("SubjectDistanceRange") + .HasColumnType("smallint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("UploadDate") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("UserId") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("VerticalResolution") + .HasColumnType("double"); + + b.Property("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.MachinesBySoftwareVariant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("MachineId") + .HasColumnType("int(11)"); + + b.Property("SoftwareVariantId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("MachineId"); + + b.HasIndex("SoftwareVariantId"); + + b.ToTable("MachinesBySoftwareVariant"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Magazine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CountryId") + .HasColumnType("smallint(3)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("FirstPublication") + .HasColumnType("datetime(6)"); + + b.Property("Issn") + .HasColumnType("varchar(8) CHARACTER SET utf8mb4") + .HasMaxLength(8); + + b.Property("NativeTitle") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("Published") + .HasColumnType("datetime(6)"); + + b.Property("Synopsis") + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasMaxLength(262144); + + b.Property("Title") + .IsRequired() + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("Caption") + .IsRequired() + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("MagazineId") + .HasColumnType("bigint"); + + b.Property("NativeCaption") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("Pages") + .HasColumnType("smallint"); + + b.Property("ProductCode") + .HasColumnType("varchar(18) CHARACTER SET utf8mb4") + .HasMaxLength(18); + + b.Property("Published") + .HasColumnType("datetime(6)"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("MachineId") + .HasColumnType("int(11)"); + + b.Property("MagazineId") + .HasColumnType("bigint"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("MachineFamilyId") + .HasColumnType("int(11)"); + + b.Property("MagazineId") + .HasColumnType("bigint"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnName("id") + .HasColumnType("int(11)"); + + b.Property("Updated") + .ValueGeneratedOnAdd() + .HasColumnName("updated") + .HasColumnType("datetime") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .HasColumnName("version") + .HasColumnType("int(11)"); + + b.HasKey("Id"); + + b.ToTable("marechai_db"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Media", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("Barcode") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("BlockSizes") + .HasColumnType("json"); + + b.Property("CatalogueNumber") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("CopyProtection") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("Firmware") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("LastSequence") + .HasColumnType("smallint unsigned"); + + b.Property("Layers") + .HasColumnType("smallint unsigned"); + + b.Property("LogicalBlockSize") + .HasColumnType("int"); + + b.Property("Manufacturer") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("Model") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("PartNumber") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("PhysicalBlockSize") + .HasColumnType("int"); + + b.Property("Revision") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("Sectors") + .HasColumnType("bigint unsigned"); + + b.Property("Sequence") + .HasColumnType("smallint unsigned"); + + b.Property("SerialNumber") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("Sessions") + .HasColumnType("smallint unsigned"); + + b.Property("Sides") + .HasColumnType("smallint unsigned"); + + b.Property("Size") + .HasColumnType("bigint unsigned"); + + b.Property("StorageInterface") + .HasColumnType("int"); + + b.Property("Title") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("Tracks") + .HasColumnType("smallint unsigned"); + + b.Property("Type") + .HasColumnType("int unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("WriteOffset") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("Barcode"); + + b.HasIndex("CatalogueNumber"); + + b.HasIndex("CopyProtection"); + + b.HasIndex("Firmware"); + + b.HasIndex("Manufacturer"); + + b.HasIndex("Model"); + + b.HasIndex("PartNumber"); + + b.HasIndex("Revision"); + + b.HasIndex("SerialNumber"); + + b.HasIndex("Title"); + + b.HasIndex("Type"); + + b.ToTable("Media"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaBySoftwareVariant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("MediaId") + .HasColumnType("bigint unsigned"); + + b.Property("SoftwareVariantId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("MediaId"); + + b.HasIndex("SoftwareVariantId"); + + b.ToTable("MediaBySoftwareVariant"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaDump", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("Format") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("MediaId") + .HasColumnType("bigint unsigned"); + + b.Property("Status") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("Format"); + + b.HasIndex("MediaId"); + + b.HasIndex("Status"); + + b.ToTable("MediaDumps"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaDumpFileImage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("FileSequence") + .HasColumnType("bigint"); + + b.Property("Md5") + .HasColumnType("binary(16)"); + + b.Property("MediaDumpId") + .HasColumnType("bigint unsigned"); + + b.Property("PartitionSequence") + .HasColumnType("smallint"); + + b.Property("Sha1") + .HasColumnType("binary(20)"); + + b.Property("Sha256") + .HasColumnType("binary(32)"); + + b.Property("Sha3") + .HasColumnType("binary(64)"); + + b.Property("Size") + .HasColumnType("bigint unsigned"); + + b.Property("Spamsum") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("Md5"); + + b.HasIndex("MediaDumpId"); + + b.HasIndex("Sha1"); + + b.HasIndex("Sha256"); + + b.HasIndex("Sha3"); + + b.HasIndex("Size"); + + b.HasIndex("Spamsum"); + + b.ToTable("MediaDumpFileImages"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaDumpImage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("AccoustId") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("Md5") + .HasColumnType("binary(16)"); + + b.Property("MediaDumpId") + .HasColumnType("bigint unsigned"); + + b.Property("Sha1") + .HasColumnType("binary(20)"); + + b.Property("Sha256") + .HasColumnType("binary(32)"); + + b.Property("Sha3") + .HasColumnType("binary(64)"); + + b.Property("Size") + .HasColumnType("bigint unsigned"); + + b.Property("Spamsum") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AccoustId"); + + b.HasIndex("Md5"); + + b.HasIndex("MediaDumpId") + .IsUnique(); + + b.HasIndex("Sha1"); + + b.HasIndex("Sha256"); + + b.HasIndex("Sha3"); + + b.HasIndex("Size"); + + b.HasIndex("Spamsum"); + + b.ToTable("MediaDumpImages"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaDumpSubchannelImage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("Md5") + .HasColumnType("binary(16)"); + + b.Property("MediaDumpId") + .HasColumnType("bigint unsigned"); + + b.Property("Sha1") + .HasColumnType("binary(20)"); + + b.Property("Sha256") + .HasColumnType("binary(32)"); + + b.Property("Sha3") + .HasColumnType("binary(64)"); + + b.Property("Size") + .HasColumnType("bigint unsigned"); + + b.Property("Spamsum") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("Status") + .HasColumnType("tinyint unsigned"); + + b.Property("TrackId") + .HasColumnType("bigint unsigned"); + + b.Property("TrackSequence") + .HasColumnType("smallint"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("Md5"); + + b.HasIndex("MediaDumpId") + .IsUnique(); + + b.HasIndex("Sha1"); + + b.HasIndex("Sha256"); + + b.HasIndex("Sha3"); + + b.HasIndex("Size"); + + b.HasIndex("Spamsum"); + + b.HasIndex("TrackId") + .IsUnique(); + + b.ToTable("MediaDumpSubchannelImages"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaDumpTrackImage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("Format") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("Md5") + .HasColumnType("binary(16)"); + + b.Property("MediaDumpId") + .HasColumnType("bigint unsigned"); + + b.Property("Sha1") + .HasColumnType("binary(20)"); + + b.Property("Sha256") + .HasColumnType("binary(32)"); + + b.Property("Sha3") + .HasColumnType("binary(64)"); + + b.Property("Size") + .HasColumnType("bigint unsigned"); + + b.Property("Spamsum") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("TrackSequence") + .HasColumnType("smallint"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("Format"); + + b.HasIndex("Md5"); + + b.HasIndex("MediaDumpId"); + + b.HasIndex("Sha1"); + + b.HasIndex("Sha256"); + + b.HasIndex("Sha3"); + + b.HasIndex("Size"); + + b.HasIndex("Spamsum"); + + b.ToTable("MediaDumpTrackImages"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaFile", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("AccessDate") + .HasColumnType("datetime(6)"); + + b.Property("Attributes") + .HasColumnType("bigint unsigned"); + + b.Property("BackupDate") + .HasColumnType("datetime(6)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("DeviceNumber") + .HasColumnType("int unsigned"); + + b.Property("GroupId") + .HasColumnType("bigint unsigned"); + + b.Property("Inode") + .HasColumnType("bigint unsigned"); + + b.Property("IsDirectory") + .HasColumnType("bit(1)"); + + b.Property("LastWriteDate") + .HasColumnType("datetime(6)"); + + b.Property("Links") + .HasColumnType("bigint unsigned"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("Path") + .IsRequired() + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasMaxLength(8192); + + b.Property("PathSeparator") + .IsRequired() + .HasColumnType("varchar(1) CHARACTER SET utf8mb4"); + + b.Property("PosixMode") + .HasColumnType("smallint unsigned"); + + b.Property("StatusChangeDate") + .HasColumnType("datetime(6)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("UserId") + .HasColumnType("bigint unsigned"); + + b.HasKey("Id"); + + b.HasIndex("AccessDate"); + + b.HasIndex("BackupDate"); + + b.HasIndex("CreationDate"); + + b.HasIndex("GroupId"); + + b.HasIndex("IsDirectory"); + + b.HasIndex("LastWriteDate"); + + b.HasIndex("Name"); + + b.HasIndex("Path"); + + b.HasIndex("StatusChangeDate"); + + b.HasIndex("UserId"); + + b.ToTable("MediaFiles"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MemoryByMachine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnName("id") + .HasColumnType("bigint(20)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("MachineId") + .HasColumnName("machine") + .HasColumnType("int(11)"); + + b.Property("Size") + .HasColumnName("size") + .HasColumnType("bigint(20)"); + + b.Property("Speed") + .HasColumnName("speed") + .HasColumnType("double"); + + b.Property("Type") + .ValueGeneratedOnAdd() + .HasColumnName("type") + .HasColumnType("int(11)") + .HasDefaultValueSql("'0'"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("OwnedMachineId") + .HasColumnType("bigint"); + + b.Property("Size") + .HasColumnType("bigint"); + + b.Property("Speed") + .HasColumnType("double"); + + b.Property("Type") + .HasColumnType("int"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnName("id") + .HasColumnType("int(11)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("Donator") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnName("donator") + .HasColumnType("char(128)") + .HasDefaultValueSql("''"); + + b.Property("Quantity") + .ValueGeneratedOnAdd() + .HasColumnName("quantity") + .HasColumnType("decimal(11,2)") + .HasDefaultValueSql("'0.00'"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnName("id") + .HasColumnType("int(11)"); + + b.Property("AddedId") + .ValueGeneratedOnAdd() + .HasColumnName("added_id") + .HasColumnType("int(11)") + .HasDefaultValueSql("'0'"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("Date") + .HasColumnName("date") + .HasColumnType("datetime"); + + b.Property("Type") + .ValueGeneratedOnAdd() + .HasColumnName("type") + .HasColumnType("int(11)") + .HasDefaultValueSql("'0'"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("AcquisitionDate") + .HasColumnType("datetime(6)"); + + b.Property("Boxed") + .HasColumnType("bit(1)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("LastStatusDate") + .HasColumnType("datetime(6)"); + + b.Property("LostDate") + .HasColumnType("datetime(6)"); + + b.Property("MachineId") + .HasColumnType("int(11)"); + + b.Property("Manuals") + .HasColumnType("bit(1)"); + + b.Property("SerialNumber") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("SerialNumberVisible") + .ValueGeneratedOnAdd() + .HasColumnType("bit(1)") + .HasDefaultValue(true); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("Trade") + .HasColumnType("bit(1)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Aperture") + .HasColumnType("double"); + + b.Property("Author") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("CameraManufacturer") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("CameraModel") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("ColorSpace") + .HasColumnType("smallint unsigned"); + + b.Property("Comments") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("Contrast") + .HasColumnType("smallint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("DigitalZoomRatio") + .HasColumnType("double"); + + b.Property("ExifVersion") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("ExposureMethod") + .HasColumnType("smallint unsigned"); + + b.Property("ExposureProgram") + .HasColumnType("smallint unsigned"); + + b.Property("ExposureTime") + .HasColumnType("double"); + + b.Property("Flash") + .HasColumnType("smallint unsigned"); + + b.Property("Focal") + .HasColumnType("double"); + + b.Property("FocalLength") + .HasColumnType("double"); + + b.Property("FocalLengthEquivalent") + .HasColumnType("double"); + + b.Property("HorizontalResolution") + .HasColumnType("double"); + + b.Property("IsoRating") + .HasColumnType("smallint unsigned"); + + b.Property("Lens") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("LicenseId") + .HasColumnType("int"); + + b.Property("LightSource") + .HasColumnType("smallint unsigned"); + + b.Property("MeteringMode") + .HasColumnType("smallint unsigned"); + + b.Property("Orientation") + .HasColumnType("smallint unsigned"); + + b.Property("OriginalExtension") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("OwnedMachineId") + .HasColumnType("bigint"); + + b.Property("ResolutionUnit") + .HasColumnType("smallint unsigned"); + + b.Property("Saturation") + .HasColumnType("smallint unsigned"); + + b.Property("SceneCaptureType") + .HasColumnType("smallint unsigned"); + + b.Property("SensingMethod") + .HasColumnType("smallint unsigned"); + + b.Property("Sharpness") + .HasColumnType("smallint unsigned"); + + b.Property("SoftwareUsed") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("SubjectDistanceRange") + .HasColumnType("smallint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("UploadDate") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("UserId") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("VerticalResolution") + .HasColumnType("double"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("BookId") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("PersonId") + .HasColumnType("int"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("char(3)"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CompanyId") + .HasColumnType("int(11)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("End") + .HasColumnType("datetime(6)"); + + b.Property("Ongoing") + .HasColumnType("bit(1)"); + + b.Property("PersonId") + .HasColumnType("int"); + + b.Property("Position") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("Start") + .HasColumnType("datetime(6)"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("DocumentId") + .HasColumnType("bigint"); + + b.Property("PersonId") + .HasColumnType("int"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("char(3)"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("MagazineId") + .HasColumnType("bigint"); + + b.Property("PersonId") + .HasColumnType("int"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("char(3)"); + + b.Property("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.PeopleBySoftwareFamily", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("PersonId") + .HasColumnType("int"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("char(3)"); + + b.Property("SoftwareFamilyId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("PersonId"); + + b.HasIndex("RoleId"); + + b.HasIndex("SoftwareFamilyId"); + + b.ToTable("PeopleBySoftwareFamily"); + }); + + modelBuilder.Entity("Marechai.Database.Models.PeopleBySoftwareVariant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("PersonId") + .HasColumnType("int"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("char(3)"); + + b.Property("SoftwareVariantId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("PersonId"); + + b.HasIndex("RoleId"); + + b.HasIndex("SoftwareVariantId"); + + b.ToTable("PeopleBySoftwareVariant"); + }); + + modelBuilder.Entity("Marechai.Database.Models.PeopleBySoftwareVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("PersonId") + .HasColumnType("int"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("char(3)"); + + b.Property("SoftwareVersionId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("PersonId"); + + b.HasIndex("RoleId"); + + b.HasIndex("SoftwareVersionId"); + + b.ToTable("PeopleBySoftwareVersion"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Person", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Alias") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("BirthDate") + .HasColumnType("datetime(6)"); + + b.Property("CountryOfBirthId") + .HasColumnType("smallint(3)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("DeathDate") + .HasColumnType("datetime(6)"); + + b.Property("DisplayName") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("DocumentPersonId") + .HasColumnType("int"); + + b.Property("Facebook") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("Photo") + .HasColumnType("char(36)"); + + b.Property("Surname") + .IsRequired() + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("Twitter") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnName("id") + .HasColumnType("int(11)"); + + b.Property("AddrBus") + .HasColumnName("addr_bus") + .HasColumnType("int(11)"); + + b.Property("CompanyId") + .HasColumnName("company") + .HasColumnType("int(11)"); + + b.Property("Cores") + .HasColumnName("cores") + .HasColumnType("int(11)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("DataBus") + .HasColumnName("data_bus") + .HasColumnType("int(11)"); + + b.Property("DieSize") + .HasColumnName("die_size") + .HasColumnType("float"); + + b.Property("FprSize") + .HasColumnName("FPR_size") + .HasColumnType("int(11)"); + + b.Property("Fprs") + .HasColumnName("FPRs") + .HasColumnType("int(11)"); + + b.Property("GprSize") + .HasColumnName("GPR_size") + .HasColumnType("int(11)"); + + b.Property("Gprs") + .HasColumnName("GPRs") + .HasColumnType("int(11)"); + + b.Property("InstructionSetId") + .HasColumnName("instruction_set") + .HasColumnType("int(11)"); + + b.Property("Introduced") + .HasColumnName("introduced") + .HasColumnType("datetime"); + + b.Property("L1Data") + .HasColumnName("L1_data") + .HasColumnType("float"); + + b.Property("L1Instruction") + .HasColumnName("L1_instruction") + .HasColumnType("float"); + + b.Property("L2") + .HasColumnType("float"); + + b.Property("L3") + .HasColumnType("float"); + + b.Property("ModelCode") + .HasColumnName("model_code") + .HasColumnType("varchar(45)") + .HasMaxLength(45); + + b.Property("Name") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnName("name") + .HasColumnType("char(50)") + .HasDefaultValueSql("''") + .HasMaxLength(50); + + b.Property("Package") + .HasColumnName("package") + .HasColumnType("varchar(45)") + .HasMaxLength(45); + + b.Property("Process") + .HasColumnName("process") + .HasColumnType("varchar(45)") + .HasMaxLength(45); + + b.Property("ProcessNm") + .HasColumnName("process_nm") + .HasColumnType("float"); + + b.Property("SimdRegisters") + .HasColumnName("SIMD_registers") + .HasColumnType("int(11)"); + + b.Property("SimdSize") + .HasColumnName("SIMD_size") + .HasColumnType("int(11)"); + + b.Property("Speed") + .HasColumnName("speed") + .HasColumnType("double"); + + b.Property("ThreadsPerCore") + .HasColumnName("threads_per_core") + .HasColumnType("int(11)"); + + b.Property("Transistors") + .HasColumnName("transistors") + .HasColumnType("bigint(20)"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnName("id") + .HasColumnType("bigint(20)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("MachineId") + .HasColumnName("machine") + .HasColumnType("int(11)"); + + b.Property("ProcessorId") + .HasColumnName("processor") + .HasColumnType("int(11)"); + + b.Property("Speed") + .HasColumnName("speed") + .HasColumnType("float"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("OwnedMachineId") + .HasColumnType("bigint"); + + b.Property("ProcessorId") + .HasColumnType("int(11)"); + + b.Property("Speed") + .HasColumnType("float"); + + b.Property("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.ProcessorsBySoftwareVariant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("Minimum") + .HasColumnType("bit(1)"); + + b.Property("ProcessorId") + .HasColumnType("int(11)"); + + b.Property("Recommended") + .HasColumnType("bit(1)"); + + b.Property("SoftwareVariantId") + .HasColumnType("bigint unsigned"); + + b.Property("Speed") + .HasColumnType("float"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("Minimum"); + + b.HasIndex("ProcessorId"); + + b.HasIndex("Recommended"); + + b.HasIndex("SoftwareVariantId"); + + b.HasIndex("Speed"); + + b.ToTable("ProcessorsBySoftwareVariant"); + }); + + modelBuilder.Entity("Marechai.Database.Models.RequiredOperatingSystemsBySofwareVariant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("OperatingSystemId") + .HasColumnType("bigint unsigned"); + + b.Property("SoftwareVariantId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("OperatingSystemId"); + + b.HasIndex("SoftwareVariantId"); + + b.ToTable("RequiredOperatingSystemsBySofwareVariant"); + }); + + modelBuilder.Entity("Marechai.Database.Models.RequiredSoftwareBySoftwareVariant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("SoftwareVariantId") + .HasColumnType("bigint unsigned"); + + b.Property("SoftwareVersionId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("SoftwareVariantId"); + + b.HasIndex("SoftwareVersionId"); + + b.ToTable("RequiredSoftwareBySoftwareVariant"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Resolution", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnName("id") + .HasColumnType("int(11)"); + + b.Property("Chars") + .ValueGeneratedOnAdd() + .HasColumnName("chars") + .HasColumnType("tinyint(1)") + .HasDefaultValueSql("'0'"); + + b.Property("Colors") + .HasColumnName("colors") + .HasColumnType("bigint(20)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("Grayscale") + .HasColumnType("bit(1)"); + + b.Property("Height") + .ValueGeneratedOnAdd() + .HasColumnName("height") + .HasColumnType("int(11)") + .HasDefaultValueSql("'0'"); + + b.Property("Palette") + .HasColumnName("palette") + .HasColumnType("bigint(20)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnName("id") + .HasColumnType("bigint(20)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("GpuId") + .HasColumnName("gpu") + .HasColumnType("int(11)"); + + b.Property("ResolutionId") + .HasColumnName("resolution") + .HasColumnType("int(11)"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("ResolutionId") + .HasColumnType("int(11)"); + + b.Property("ScreenId") + .HasColumnType("int"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("Diagonal") + .HasColumnType("double"); + + b.Property("EffectiveColors") + .HasColumnType("bigint"); + + b.Property("Height") + .HasColumnType("double"); + + b.Property("NativeResolutionId") + .HasColumnType("int(11)"); + + b.Property("Type") + .IsRequired() + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("MachineId") + .HasColumnType("int(11)"); + + b.Property("ScreenId") + .HasColumnType("int"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("MachineId"); + + b.HasIndex("ScreenId"); + + b.ToTable("ScreensByMachine"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareFamily", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("Introduced") + .HasColumnType("datetime(6)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("ParentId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("Introduced"); + + b.HasIndex("Name"); + + b.HasIndex("ParentId"); + + b.ToTable("SoftwareFamilies"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareVariant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("CatalogueNumber") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("DistributionMode") + .HasColumnType("int unsigned"); + + b.Property("Introduced") + .HasColumnType("datetime(6)"); + + b.Property("MinimumMemory") + .HasColumnType("bigint unsigned"); + + b.Property("Name") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("ParentId") + .HasColumnType("bigint unsigned"); + + b.Property("PartNumber") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("ProductCode") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("RecommendedMemory") + .HasColumnType("bigint unsigned"); + + b.Property("RequiredStorage") + .HasColumnType("bigint unsigned"); + + b.Property("SerialNumber") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("SoftwareVersionId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("Version") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.HasIndex("CatalogueNumber"); + + b.HasIndex("DistributionMode"); + + b.HasIndex("Introduced"); + + b.HasIndex("MinimumMemory"); + + b.HasIndex("Name"); + + b.HasIndex("ParentId"); + + b.HasIndex("PartNumber"); + + b.HasIndex("ProductCode"); + + b.HasIndex("RecommendedMemory"); + + b.HasIndex("RequiredStorage"); + + b.HasIndex("SerialNumber"); + + b.HasIndex("SoftwareVersionId"); + + b.HasIndex("Version"); + + b.ToTable("SoftwareVariants"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("Codename") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("FamilyId") + .HasColumnType("bigint unsigned"); + + b.Property("Introduced") + .HasColumnType("datetime(6)"); + + b.Property("LicenseId") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("PreviousId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("Version") + .IsRequired() + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.HasIndex("Codename"); + + b.HasIndex("FamilyId"); + + b.HasIndex("Introduced"); + + b.HasIndex("LicenseId"); + + b.HasIndex("Name"); + + b.HasIndex("PreviousId") + .IsUnique(); + + b.HasIndex("Version"); + + b.ToTable("SoftwareVersion"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoundByMachine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnName("id") + .HasColumnType("bigint(20)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("MachineId") + .HasColumnName("machine") + .HasColumnType("int(11)"); + + b.Property("SoundSynthId") + .HasColumnName("sound_synth") + .HasColumnType("int(11)"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("OwnedMachineId") + .HasColumnType("bigint"); + + b.Property("SoundSynthId") + .HasColumnType("int(11)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("OwnedMachineId"); + + b.HasIndex("SoundSynthId"); + + b.ToTable("SoundByOwnedMachine"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoundBySoftwareVariant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("SoftwareVariantId") + .HasColumnType("bigint unsigned"); + + b.Property("SoundSynthId") + .HasColumnType("int(11)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("SoftwareVariantId"); + + b.HasIndex("SoundSynthId"); + + b.ToTable("SoundBySoftwareVariant"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoundSynth", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnName("id") + .HasColumnType("int(11)"); + + b.Property("CompanyId") + .HasColumnName("company") + .HasColumnType("int(11)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("Depth") + .HasColumnName("depth") + .HasColumnType("int(11)"); + + b.Property("Frequency") + .HasColumnName("frequency") + .HasColumnType("double"); + + b.Property("Introduced") + .HasColumnName("introduced") + .HasColumnType("datetime"); + + b.Property("ModelCode") + .HasColumnName("model_code") + .HasColumnType("varchar(45)") + .HasMaxLength(45); + + b.Property("Name") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnName("name") + .HasColumnType("char(50)") + .HasDefaultValueSql("''") + .HasMaxLength(50); + + b.Property("SquareWave") + .HasColumnName("square_wave") + .HasColumnType("int(11)"); + + b.Property("Type") + .HasColumnName("type") + .HasColumnType("int(11)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("Voices") + .HasColumnName("voices") + .HasColumnType("int(11)"); + + b.Property("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.StandaloneFile", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("AccessDate") + .HasColumnType("datetime(6)"); + + b.Property("Attributes") + .HasColumnType("bigint unsigned"); + + b.Property("BackupDate") + .HasColumnType("datetime(6)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("DeviceNumber") + .HasColumnType("int unsigned"); + + b.Property("GroupId") + .HasColumnType("bigint unsigned"); + + b.Property("Inode") + .HasColumnType("bigint unsigned"); + + b.Property("IsDirectory") + .HasColumnType("bit(1)"); + + b.Property("LastWriteDate") + .HasColumnType("datetime(6)"); + + b.Property("Links") + .HasColumnType("bigint unsigned"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("Path") + .IsRequired() + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasMaxLength(8192); + + b.Property("PathSeparator") + .IsRequired() + .HasColumnType("varchar(1) CHARACTER SET utf8mb4"); + + b.Property("PosixMode") + .HasColumnType("smallint unsigned"); + + b.Property("SoftwareVariantId") + .HasColumnType("bigint unsigned"); + + b.Property("StatusChangeDate") + .HasColumnType("datetime(6)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("UserId") + .HasColumnType("bigint unsigned"); + + b.HasKey("Id"); + + b.HasIndex("AccessDate"); + + b.HasIndex("BackupDate"); + + b.HasIndex("CreationDate"); + + b.HasIndex("GroupId"); + + b.HasIndex("IsDirectory"); + + b.HasIndex("LastWriteDate"); + + b.HasIndex("Name"); + + b.HasIndex("Path"); + + b.HasIndex("SoftwareVariantId"); + + b.HasIndex("StatusChangeDate"); + + b.HasIndex("UserId"); + + b.ToTable("StandaloneFiles"); + }); + + modelBuilder.Entity("Marechai.Database.Models.StorageByMachine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnName("id") + .HasColumnType("bigint(20)"); + + b.Property("Capacity") + .HasColumnName("capacity") + .HasColumnType("bigint(20)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("Interface") + .ValueGeneratedOnAdd() + .HasColumnName("interface") + .HasColumnType("int(11)") + .HasDefaultValueSql("'0'"); + + b.Property("MachineId") + .HasColumnName("machine") + .HasColumnType("int(11)"); + + b.Property("Type") + .ValueGeneratedOnAdd() + .HasColumnName("type") + .HasColumnType("int(11)") + .HasDefaultValueSql("'0'"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("Capacity") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("Interface") + .HasColumnType("int"); + + b.Property("OwnedMachineId") + .HasColumnType("bigint"); + + b.Property("Type") + .HasColumnType("int"); + + b.Property("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", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ClaimType") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("ClaimValue") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ClaimType") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("ClaimValue") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("ProviderKey") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("ProviderDisplayName") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("RoleId") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("LoginProvider") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("Name") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("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.CompaniesBySoftwareFamily", b => + { + b.HasOne("Marechai.Database.Models.Company", "Company") + .WithMany("SoftwareFamilies") + .HasForeignKey("CompanyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.DocumentRole", "Role") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareFamily", "SoftwareFamily") + .WithMany("Companies") + .HasForeignKey("SoftwareFamilyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Marechai.Database.Models.CompaniesBySoftwareVariant", b => + { + b.HasOne("Marechai.Database.Models.Company", "Company") + .WithMany("SoftwareVariants") + .HasForeignKey("CompanyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.DocumentRole", "Role") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareVariant", "SoftwareVariant") + .WithMany("Companies") + .HasForeignKey("SoftwareVariantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Marechai.Database.Models.CompaniesBySoftwareVersion", b => + { + b.HasOne("Marechai.Database.Models.Company", "Company") + .WithMany("SoftwareVersions") + .HasForeignKey("CompanyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.DocumentRole", "Role") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareVersion", "SoftwareVersion") + .WithMany("Companies") + .HasForeignKey("SoftwareVersionId") + .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.Dump", b => + { + b.HasOne("Marechai.Database.Models.MediaDump", "MediaDump") + .WithMany("Dumps") + .HasForeignKey("MediaDumpId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("Marechai.Database.Models.Media", "Media") + .WithMany("Dumps") + .HasForeignKey("MediaId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "User") + .WithMany("Dumps") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.SetNull); + }); + + modelBuilder.Entity("Marechai.Database.Models.DumpHardware", b => + { + b.HasOne("Marechai.Database.Models.Dump", "Dump") + .WithMany("DumpHardware") + .HasForeignKey("DumpId") + .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.FileDataStreamsByMediaFile", b => + { + b.HasOne("Marechai.Database.Models.FileDataStream", "FileDataStream") + .WithMany() + .HasForeignKey("FileDataStreamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.MediaFile", "MediaFile") + .WithMany("DataStreams") + .HasForeignKey("MediaFileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Marechai.Database.Models.FileDataStreamsByStandaloneFile", b => + { + b.HasOne("Marechai.Database.Models.FileDataStream", "FileDataStream") + .WithMany() + .HasForeignKey("FileDataStreamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.StandaloneFile", "StandaloneFile") + .WithMany("DataStreams") + .HasForeignKey("StandaloneFileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Marechai.Database.Models.FilesByFilesystem", b => + { + b.HasOne("Marechai.Database.Models.MediaFile", "File") + .WithMany() + .HasForeignKey("FileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Filesystem", "Filesystem") + .WithMany("Files") + .HasForeignKey("FilesystemId") + .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.FilesystemsByMediaDumpFile", b => + { + b.HasOne("Marechai.Database.Models.Filesystem", "Filesystem") + .WithMany("MediaDumpFileImages") + .HasForeignKey("FilesystemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.MediaDumpFileImage", "MediaDumpFileImage") + .WithMany("Filesystems") + .HasForeignKey("MediaDumpFileImageId") + .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.GpusBySoftwareVariant", b => + { + b.HasOne("Marechai.Database.Models.Gpu", "Gpu") + .WithMany("Software") + .HasForeignKey("GpuId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareVariant", "SoftwareVariant") + .WithMany("Gpus") + .HasForeignKey("SoftwareVariantId") + .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.InstructionSetsBySoftwareVariant", b => + { + b.HasOne("Marechai.Database.Models.InstructionSet", "InstructionSet") + .WithMany("Software") + .HasForeignKey("InstructionSetId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareVariant", "SoftwareVariant") + .WithMany("Architectures") + .HasForeignKey("SoftwareVariantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Marechai.Database.Models.LanguagesBySoftwareVariant", b => + { + b.HasOne("Marechai.Database.Models.Iso639", "Language") + .WithMany("Software") + .HasForeignKey("LanguageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareVariant", "SoftwareVariant") + .WithMany("Languages") + .HasForeignKey("SoftwareVariantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Marechai.Database.Models.LogicalPartitionsByMedia", b => + { + b.HasOne("Marechai.Database.Models.Media", "Media") + .WithMany("LogicalPartitions") + .HasForeignKey("MediaId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.LogicalPartition", "Partition") + .WithMany("Media") + .HasForeignKey("PartitionId") + .OnDelete(DeleteBehavior.Cascade) + .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.MachineFamiliesBySoftwareVariant", b => + { + b.HasOne("Marechai.Database.Models.MachineFamily", "MachineFamily") + .WithMany("Software") + .HasForeignKey("MachineFamilyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareVariant", "SoftwareVariant") + .WithMany("MachineFamilies") + .HasForeignKey("SoftwareVariantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + 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.MachinesBySoftwareVariant", b => + { + b.HasOne("Marechai.Database.Models.Machine", "Machine") + .WithMany("Software") + .HasForeignKey("MachineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareVariant", "SoftwareVariant") + .WithMany("Machines") + .HasForeignKey("SoftwareVariantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + 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.MediaBySoftwareVariant", b => + { + b.HasOne("Marechai.Database.Models.Media", "Media") + .WithMany("Software") + .HasForeignKey("MediaId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareVariant", "SoftwareVariant") + .WithMany("Media") + .HasForeignKey("SoftwareVariantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaDump", b => + { + b.HasOne("Marechai.Database.Models.Media", "Media") + .WithMany("MediaDumps") + .HasForeignKey("MediaId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaDumpFileImage", b => + { + b.HasOne("Marechai.Database.Models.MediaDump", "MediaDump") + .WithMany("Files") + .HasForeignKey("MediaDumpId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaDumpImage", b => + { + b.HasOne("Marechai.Database.Models.MediaDump", "MediaDump") + .WithOne("Image") + .HasForeignKey("Marechai.Database.Models.MediaDumpImage", "MediaDumpId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaDumpSubchannelImage", b => + { + b.HasOne("Marechai.Database.Models.MediaDump", "MediaDump") + .WithOne("Subchannel") + .HasForeignKey("Marechai.Database.Models.MediaDumpSubchannelImage", "MediaDumpId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("Marechai.Database.Models.MediaDumpTrackImage", "Track") + .WithOne("Subchannel") + .HasForeignKey("Marechai.Database.Models.MediaDumpSubchannelImage", "TrackId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaDumpTrackImage", b => + { + b.HasOne("Marechai.Database.Models.MediaDump", "MediaDump") + .WithMany("Tracks") + .HasForeignKey("MediaDumpId") + .OnDelete(DeleteBehavior.Cascade); + }); + + 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.PeopleBySoftwareFamily", b => + { + b.HasOne("Marechai.Database.Models.Person", "Person") + .WithMany("SoftwareFamilies") + .HasForeignKey("PersonId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.DocumentRole", "Role") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareFamily", "SoftwareFamily") + .WithMany("People") + .HasForeignKey("SoftwareFamilyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Marechai.Database.Models.PeopleBySoftwareVariant", b => + { + b.HasOne("Marechai.Database.Models.Person", "Person") + .WithMany("SoftwareVariants") + .HasForeignKey("PersonId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.DocumentRole", "Role") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareVariant", "SoftwareVariant") + .WithMany("People") + .HasForeignKey("SoftwareVariantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Marechai.Database.Models.PeopleBySoftwareVersion", b => + { + b.HasOne("Marechai.Database.Models.Person", "Person") + .WithMany("SoftwareVersions") + .HasForeignKey("PersonId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.DocumentRole", "Role") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareVersion", "SoftwareVersion") + .WithMany("People") + .HasForeignKey("SoftwareVersionId") + .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.ProcessorsBySoftwareVariant", b => + { + b.HasOne("Marechai.Database.Models.Processor", "Processor") + .WithMany("Software") + .HasForeignKey("ProcessorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareVariant", "SoftwareVariant") + .WithMany("Processors") + .HasForeignKey("SoftwareVariantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Marechai.Database.Models.RequiredOperatingSystemsBySofwareVariant", b => + { + b.HasOne("Marechai.Database.Models.SoftwareVersion", "OperatingSystem") + .WithMany() + .HasForeignKey("OperatingSystemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareVariant", "SoftwareVariant") + .WithMany("RequiredOperatingSystems") + .HasForeignKey("SoftwareVariantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Marechai.Database.Models.RequiredSoftwareBySoftwareVariant", b => + { + b.HasOne("Marechai.Database.Models.SoftwareVariant", "SoftwareVariant") + .WithMany("RequiredSoftware") + .HasForeignKey("SoftwareVariantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareVersion", "SoftwareVersion") + .WithMany() + .HasForeignKey("SoftwareVersionId") + .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.SoftwareFamily", b => + { + b.HasOne("Marechai.Database.Models.SoftwareFamily", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.SetNull); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareVariant", b => + { + b.HasOne("Marechai.Database.Models.SoftwareVariant", "Parent") + .WithMany("Derivates") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Marechai.Database.Models.SoftwareVersion", "SoftwareVersion") + .WithMany("Variants") + .HasForeignKey("SoftwareVersionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareVersion", b => + { + b.HasOne("Marechai.Database.Models.SoftwareFamily", "Family") + .WithMany("Versions") + .HasForeignKey("FamilyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.License", "License") + .WithMany() + .HasForeignKey("LicenseId"); + + b.HasOne("Marechai.Database.Models.SoftwareVersion", "Previous") + .WithOne("Next") + .HasForeignKey("Marechai.Database.Models.SoftwareVersion", "PreviousId") + .OnDelete(DeleteBehavior.SetNull); + }); + + 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.SoundBySoftwareVariant", b => + { + b.HasOne("Marechai.Database.Models.SoftwareVariant", "SoftwareVariant") + .WithMany("SupportedSound") + .HasForeignKey("SoftwareVariantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoundSynth", "SoundSynth") + .WithMany("Software") + .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.StandaloneFile", b => + { + b.HasOne("Marechai.Database.Models.SoftwareVariant", "SoftwareVariant") + .WithMany("Files") + .HasForeignKey("SoftwareVariantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + 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", b => + { + b.HasOne("Marechai.Database.Models.ApplicationRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("Marechai.Database.Models.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("Marechai.Database.Models.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", 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", b => + { + b.HasOne("Marechai.Database.Models.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Marechai.Database/Migrations/20200611212211_AddSoftwareVariant.cs b/Marechai.Database/Migrations/20200611212211_AddSoftwareVariant.cs new file mode 100644 index 00000000..e99c4ac2 --- /dev/null +++ b/Marechai.Database/Migrations/20200611212211_AddSoftwareVariant.cs @@ -0,0 +1,597 @@ +/****************************************************************************** +// MARECHAI: Master repository of computing history artifacts information +// ---------------------------------------------------------------------------- +// +// Author(s) : Natalia Portillo +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2003-2020 Natalia Portillo +*******************************************************************************/ + +using System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Marechai.Database.Migrations +{ + public partial class AddSoftwareVariant : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable("SoftwareVariants", table => new + { + Id = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CreatedOn = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.IdentityColumn), + UpdatedOn = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.ComputedColumn), + Name = table.Column(nullable: true), Version = table.Column(nullable: true), + Introduced = table.Column(nullable: true), ParentId = table.Column(nullable: true), + SoftwareVersionId = table.Column(nullable: false), + MinimumMemory = table.Column(nullable: true), + RecommendedMemory = table.Column(nullable: true), + RequiredStorage = table.Column(nullable: true), + PartNumber = table.Column(nullable: true), SerialNumber = table.Column(nullable: true), + ProductCode = table.Column(nullable: true), + CatalogueNumber = table.Column(nullable: true), + DistributionMode = table.Column(nullable: false) + }, constraints: table => + { + table.PrimaryKey("PK_SoftwareVariants", x => x.Id); + + table.ForeignKey("FK_SoftwareVariants_SoftwareVariants_ParentId", x => x.ParentId, "SoftwareVariants", + "Id", onDelete: ReferentialAction.SetNull); + + table.ForeignKey("FK_SoftwareVariants_SoftwareVersion_SoftwareVersionId", x => x.SoftwareVersionId, + "SoftwareVersion", "Id", onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable("CompaniesBySoftwareVariant", table => new + { + Id = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CreatedOn = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.IdentityColumn), + UpdatedOn = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.ComputedColumn), + CompanyId = table.Column(nullable: false), + SoftwareVariantId = table.Column(nullable: false), RoleId = table.Column(nullable: false) + }, constraints: table => + { + table.PrimaryKey("PK_CompaniesBySoftwareVariant", x => x.Id); + + table.ForeignKey("FK_CompaniesBySoftwareVariant_companies_CompanyId", x => x.CompanyId, "companies", + "id", onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_CompaniesBySoftwareVariant_DocumentRoles_RoleId", x => x.RoleId, "DocumentRoles", + "Id", onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_CompaniesBySoftwareVariant_SoftwareVariants_SoftwareVariantId", + x => x.SoftwareVariantId, "SoftwareVariants", "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable("GpusBySoftwareVariant", table => new + { + Id = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CreatedOn = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.IdentityColumn), + UpdatedOn = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.ComputedColumn), + GpuId = table.Column(nullable: false), SoftwareVariantId = table.Column(nullable: false), + Minimum = table.Column(nullable: true), Recommended = table.Column(nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_GpusBySoftwareVariant", x => x.Id); + + table.ForeignKey("FK_GpusBySoftwareVariant_gpus_GpuId", x => x.GpuId, "gpus", "id", + onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_GpusBySoftwareVariant_SoftwareVariants_SoftwareVariantId", + x => x.SoftwareVariantId, "SoftwareVariants", "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable("InstructionSetsBySoftwareVariant", table => new + { + Id = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CreatedOn = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.IdentityColumn), + UpdatedOn = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.ComputedColumn), + InstructionSetId = table.Column(nullable: false), + SoftwareVariantId = table.Column(nullable: false) + }, constraints: table => + { + table.PrimaryKey("PK_InstructionSetsBySoftwareVariant", x => x.Id); + + table.ForeignKey("FK_InstructionSetsBySoftwareVariant_instruction_sets_Instructio~", + x => x.InstructionSetId, "instruction_sets", "id", + onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_InstructionSetsBySoftwareVariant_SoftwareVariants_SoftwareVa~", + x => x.SoftwareVariantId, "SoftwareVariants", "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable("LanguagesBySoftwareVariant", table => new + { + Id = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CreatedOn = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.IdentityColumn), + UpdatedOn = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.ComputedColumn), + LanguageId = table.Column(nullable: false), + SoftwareVariantId = table.Column(nullable: false) + }, constraints: table => + { + table.PrimaryKey("PK_LanguagesBySoftwareVariant", x => x.Id); + + table.ForeignKey("FK_LanguagesBySoftwareVariant_ISO_639-3_LanguageId", x => x.LanguageId, "ISO_639-3", + "Id", onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_LanguagesBySoftwareVariant_SoftwareVariants_SoftwareVariantId", + x => x.SoftwareVariantId, "SoftwareVariants", "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable("MachineFamiliesBySoftwareVariant", table => new + { + Id = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CreatedOn = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.IdentityColumn), + UpdatedOn = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.ComputedColumn), + MachineFamilyId = table.Column(nullable: false), + SoftwareVariantId = table.Column(nullable: false) + }, constraints: table => + { + table.PrimaryKey("PK_MachineFamiliesBySoftwareVariant", x => x.Id); + + table.ForeignKey("FK_MachineFamiliesBySoftwareVariant_machine_families_MachineFam~", + x => x.MachineFamilyId, "machine_families", "id", onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_MachineFamiliesBySoftwareVariant_SoftwareVariants_SoftwareVa~", + x => x.SoftwareVariantId, "SoftwareVariants", "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable("MachinesBySoftwareVariant", table => new + { + Id = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CreatedOn = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.IdentityColumn), + UpdatedOn = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.ComputedColumn), + MachineId = table.Column(nullable: false), SoftwareVariantId = table.Column(nullable: false) + }, constraints: table => + { + table.PrimaryKey("PK_MachinesBySoftwareVariant", x => x.Id); + + table.ForeignKey("FK_MachinesBySoftwareVariant_machines_MachineId", x => x.MachineId, "machines", "id", + onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_MachinesBySoftwareVariant_SoftwareVariants_SoftwareVariantId", + x => x.SoftwareVariantId, "SoftwareVariants", "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable("MediaBySoftwareVariant", table => new + { + Id = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CreatedOn = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.IdentityColumn), + UpdatedOn = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.ComputedColumn), + MediaId = table.Column(nullable: false), SoftwareVariantId = table.Column(nullable: false) + }, constraints: table => + { + table.PrimaryKey("PK_MediaBySoftwareVariant", x => x.Id); + + table.ForeignKey("FK_MediaBySoftwareVariant_Media_MediaId", x => x.MediaId, "Media", "Id", + onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_MediaBySoftwareVariant_SoftwareVariants_SoftwareVariantId", + x => x.SoftwareVariantId, "SoftwareVariants", "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable("PeopleBySoftwareVariant", table => new + { + Id = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CreatedOn = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.IdentityColumn), + UpdatedOn = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.ComputedColumn), + SoftwareVariantId = table.Column(nullable: false), PersonId = table.Column(nullable: false), + RoleId = table.Column(nullable: false) + }, constraints: table => + { + table.PrimaryKey("PK_PeopleBySoftwareVariant", x => x.Id); + + table.ForeignKey("FK_PeopleBySoftwareVariant_People_PersonId", x => x.PersonId, "People", "Id", + onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_PeopleBySoftwareVariant_DocumentRoles_RoleId", x => x.RoleId, "DocumentRoles", + "Id", onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_PeopleBySoftwareVariant_SoftwareVariants_SoftwareVariantId", + x => x.SoftwareVariantId, "SoftwareVariants", "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable("ProcessorsBySoftwareVariant", table => new + { + Id = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CreatedOn = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.IdentityColumn), + UpdatedOn = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.ComputedColumn), + ProcessorId = table.Column(nullable: false), + SoftwareVariantId = table.Column(nullable: false), Speed = table.Column(nullable: true), + Minimum = table.Column(nullable: true), Recommended = table.Column(nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_ProcessorsBySoftwareVariant", x => x.Id); + + table.ForeignKey("FK_ProcessorsBySoftwareVariant_processors_ProcessorId", x => x.ProcessorId, + "processors", "id", onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_ProcessorsBySoftwareVariant_SoftwareVariants_SoftwareVariant~", + x => x.SoftwareVariantId, "SoftwareVariants", "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable("RequiredOperatingSystemsBySofwareVariant", table => new + { + Id = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CreatedOn = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.IdentityColumn), + UpdatedOn = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.ComputedColumn), + OperatingSystemId = table.Column(nullable: false), + SoftwareVariantId = table.Column(nullable: false) + }, constraints: table => + { + table.PrimaryKey("PK_RequiredOperatingSystemsBySofwareVariant", x => x.Id); + + table.ForeignKey("FK_RequiredOperatingSystemsBySofwareVariant_SoftwareVersion_Ope~", + x => x.OperatingSystemId, "SoftwareVersion", "Id", + onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_RequiredOperatingSystemsBySofwareVariant_SoftwareVariants_So~", + x => x.SoftwareVariantId, "SoftwareVariants", "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable("RequiredSoftwareBySoftwareVariant", table => new + { + Id = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CreatedOn = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.IdentityColumn), + UpdatedOn = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.ComputedColumn), + SoftwareVersionId = table.Column(nullable: false), + SoftwareVariantId = table.Column(nullable: false) + }, constraints: table => + { + table.PrimaryKey("PK_RequiredSoftwareBySoftwareVariant", x => x.Id); + + table.ForeignKey("FK_RequiredSoftwareBySoftwareVariant_SoftwareVariants_SoftwareV~", + x => x.SoftwareVariantId, "SoftwareVariants", "Id", + onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_RequiredSoftwareBySoftwareVariant_SoftwareVersion_SoftwareVe~", + x => x.SoftwareVersionId, "SoftwareVersion", "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable("SoundBySoftwareVariant", table => new + { + Id = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CreatedOn = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.IdentityColumn), + UpdatedOn = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.ComputedColumn), + SoundSynthId = table.Column(nullable: false), + SoftwareVariantId = table.Column(nullable: false) + }, constraints: table => + { + table.PrimaryKey("PK_SoundBySoftwareVariant", x => x.Id); + + table.ForeignKey("FK_SoundBySoftwareVariant_SoftwareVariants_SoftwareVariantId", + x => x.SoftwareVariantId, "SoftwareVariants", "Id", + onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_SoundBySoftwareVariant_sound_synths_SoundSynthId", x => x.SoundSynthId, + "sound_synths", "id", onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable("StandaloneFiles", table => new + { + Id = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CreatedOn = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.IdentityColumn), + UpdatedOn = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.ComputedColumn), + Path = table.Column(maxLength: 8192, nullable: false), + Name = table.Column(maxLength: 255, nullable: false), + PathSeparator = table.Column(nullable: false), + IsDirectory = table.Column(nullable: false), + CreationDate = table.Column(nullable: true), + AccessDate = table.Column(nullable: true), + StatusChangeDate = table.Column(nullable: true), + BackupDate = table.Column(nullable: true), + LastWriteDate = table.Column(nullable: true), + Attributes = table.Column(nullable: false), PosixMode = table.Column(nullable: true), + DeviceNumber = table.Column(nullable: true), GroupId = table.Column(nullable: true), + UserId = table.Column(nullable: true), Inode = table.Column(nullable: true), + Links = table.Column(nullable: true), SoftwareVariantId = table.Column(nullable: false) + }, constraints: table => + { + table.PrimaryKey("PK_StandaloneFiles", x => x.Id); + + table.ForeignKey("FK_StandaloneFiles_SoftwareVariants_SoftwareVariantId", x => x.SoftwareVariantId, + "SoftwareVariants", "Id", onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable("FileDataStreamsByStandaloneFile", table => new + { + Id = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CreatedOn = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.IdentityColumn), + UpdatedOn = table.Column(nullable: false). + Annotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.ComputedColumn), + FileDataStreamId = table.Column(nullable: false), + StandaloneFileId = table.Column(nullable: false) + }, constraints: table => + { + table.PrimaryKey("PK_FileDataStreamsByStandaloneFile", x => x.Id); + + table.ForeignKey("FK_FileDataStreamsByStandaloneFile_FileDataStreams_FileDataStre~", + x => x.FileDataStreamId, "FileDataStreams", "Id", onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_FileDataStreamsByStandaloneFile_StandaloneFiles_StandaloneFi~", + x => x.StandaloneFileId, "StandaloneFiles", "Id", onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex("IX_CompaniesBySoftwareVariant_CompanyId", "CompaniesBySoftwareVariant", + "CompanyId"); + + migrationBuilder.CreateIndex("IX_CompaniesBySoftwareVariant_RoleId", "CompaniesBySoftwareVariant", + "RoleId"); + + migrationBuilder.CreateIndex("IX_CompaniesBySoftwareVariant_SoftwareVariantId", + "CompaniesBySoftwareVariant", "SoftwareVariantId"); + + migrationBuilder.CreateIndex("IX_FileDataStreamsByStandaloneFile_FileDataStreamId", + "FileDataStreamsByStandaloneFile", "FileDataStreamId"); + + migrationBuilder.CreateIndex("IX_FileDataStreamsByStandaloneFile_StandaloneFileId", + "FileDataStreamsByStandaloneFile", "StandaloneFileId"); + + migrationBuilder.CreateIndex("IX_GpusBySoftwareVariant_GpuId", "GpusBySoftwareVariant", "GpuId"); + + migrationBuilder.CreateIndex("IX_GpusBySoftwareVariant_Minimum", "GpusBySoftwareVariant", "Minimum"); + + migrationBuilder.CreateIndex("IX_GpusBySoftwareVariant_Recommended", "GpusBySoftwareVariant", + "Recommended"); + + migrationBuilder.CreateIndex("IX_GpusBySoftwareVariant_SoftwareVariantId", "GpusBySoftwareVariant", + "SoftwareVariantId"); + + migrationBuilder.CreateIndex("IX_InstructionSetsBySoftwareVariant_InstructionSetId", + "InstructionSetsBySoftwareVariant", "InstructionSetId"); + + migrationBuilder.CreateIndex("IX_InstructionSetsBySoftwareVariant_SoftwareVariantId", + "InstructionSetsBySoftwareVariant", "SoftwareVariantId"); + + migrationBuilder.CreateIndex("IX_LanguagesBySoftwareVariant_LanguageId", "LanguagesBySoftwareVariant", + "LanguageId"); + + migrationBuilder.CreateIndex("IX_LanguagesBySoftwareVariant_SoftwareVariantId", + "LanguagesBySoftwareVariant", "SoftwareVariantId"); + + migrationBuilder.CreateIndex("IX_MachineFamiliesBySoftwareVariant_MachineFamilyId", + "MachineFamiliesBySoftwareVariant", "MachineFamilyId"); + + migrationBuilder.CreateIndex("IX_MachineFamiliesBySoftwareVariant_SoftwareVariantId", + "MachineFamiliesBySoftwareVariant", "SoftwareVariantId"); + + migrationBuilder.CreateIndex("IX_MachinesBySoftwareVariant_MachineId", "MachinesBySoftwareVariant", + "MachineId"); + + migrationBuilder.CreateIndex("IX_MachinesBySoftwareVariant_SoftwareVariantId", "MachinesBySoftwareVariant", + "SoftwareVariantId"); + + migrationBuilder.CreateIndex("IX_MediaBySoftwareVariant_MediaId", "MediaBySoftwareVariant", "MediaId"); + + migrationBuilder.CreateIndex("IX_MediaBySoftwareVariant_SoftwareVariantId", "MediaBySoftwareVariant", + "SoftwareVariantId"); + + migrationBuilder.CreateIndex("IX_PeopleBySoftwareVariant_PersonId", "PeopleBySoftwareVariant", "PersonId"); + + migrationBuilder.CreateIndex("IX_PeopleBySoftwareVariant_RoleId", "PeopleBySoftwareVariant", "RoleId"); + + migrationBuilder.CreateIndex("IX_PeopleBySoftwareVariant_SoftwareVariantId", "PeopleBySoftwareVariant", + "SoftwareVariantId"); + + migrationBuilder.CreateIndex("IX_ProcessorsBySoftwareVariant_Minimum", "ProcessorsBySoftwareVariant", + "Minimum"); + + migrationBuilder.CreateIndex("IX_ProcessorsBySoftwareVariant_ProcessorId", "ProcessorsBySoftwareVariant", + "ProcessorId"); + + migrationBuilder.CreateIndex("IX_ProcessorsBySoftwareVariant_Recommended", "ProcessorsBySoftwareVariant", + "Recommended"); + + migrationBuilder.CreateIndex("IX_ProcessorsBySoftwareVariant_SoftwareVariantId", + "ProcessorsBySoftwareVariant", "SoftwareVariantId"); + + migrationBuilder.CreateIndex("IX_ProcessorsBySoftwareVariant_Speed", "ProcessorsBySoftwareVariant", + "Speed"); + + migrationBuilder.CreateIndex("IX_RequiredOperatingSystemsBySofwareVariant_OperatingSystemId", + "RequiredOperatingSystemsBySofwareVariant", "OperatingSystemId"); + + migrationBuilder.CreateIndex("IX_RequiredOperatingSystemsBySofwareVariant_SoftwareVariantId", + "RequiredOperatingSystemsBySofwareVariant", "SoftwareVariantId"); + + migrationBuilder.CreateIndex("IX_RequiredSoftwareBySoftwareVariant_SoftwareVariantId", + "RequiredSoftwareBySoftwareVariant", "SoftwareVariantId"); + + migrationBuilder.CreateIndex("IX_RequiredSoftwareBySoftwareVariant_SoftwareVersionId", + "RequiredSoftwareBySoftwareVariant", "SoftwareVersionId"); + + migrationBuilder.CreateIndex("IX_SoftwareVariants_CatalogueNumber", "SoftwareVariants", "CatalogueNumber"); + + migrationBuilder.CreateIndex("IX_SoftwareVariants_DistributionMode", "SoftwareVariants", + "DistributionMode"); + + migrationBuilder.CreateIndex("IX_SoftwareVariants_Introduced", "SoftwareVariants", "Introduced"); + + migrationBuilder.CreateIndex("IX_SoftwareVariants_MinimumMemory", "SoftwareVariants", "MinimumMemory"); + + migrationBuilder.CreateIndex("IX_SoftwareVariants_Name", "SoftwareVariants", "Name"); + + migrationBuilder.CreateIndex("IX_SoftwareVariants_ParentId", "SoftwareVariants", "ParentId"); + + migrationBuilder.CreateIndex("IX_SoftwareVariants_PartNumber", "SoftwareVariants", "PartNumber"); + + migrationBuilder.CreateIndex("IX_SoftwareVariants_ProductCode", "SoftwareVariants", "ProductCode"); + + migrationBuilder.CreateIndex("IX_SoftwareVariants_RecommendedMemory", "SoftwareVariants", + "RecommendedMemory"); + + migrationBuilder.CreateIndex("IX_SoftwareVariants_RequiredStorage", "SoftwareVariants", "RequiredStorage"); + + migrationBuilder.CreateIndex("IX_SoftwareVariants_SerialNumber", "SoftwareVariants", "SerialNumber"); + + migrationBuilder.CreateIndex("IX_SoftwareVariants_SoftwareVersionId", "SoftwareVariants", + "SoftwareVersionId"); + + migrationBuilder.CreateIndex("IX_SoftwareVariants_Version", "SoftwareVariants", "Version"); + + migrationBuilder.CreateIndex("IX_SoundBySoftwareVariant_SoftwareVariantId", "SoundBySoftwareVariant", + "SoftwareVariantId"); + + migrationBuilder.CreateIndex("IX_SoundBySoftwareVariant_SoundSynthId", "SoundBySoftwareVariant", + "SoundSynthId"); + + migrationBuilder.CreateIndex("IX_StandaloneFiles_AccessDate", "StandaloneFiles", "AccessDate"); + + migrationBuilder.CreateIndex("IX_StandaloneFiles_BackupDate", "StandaloneFiles", "BackupDate"); + + migrationBuilder.CreateIndex("IX_StandaloneFiles_CreationDate", "StandaloneFiles", "CreationDate"); + + migrationBuilder.CreateIndex("IX_StandaloneFiles_GroupId", "StandaloneFiles", "GroupId"); + + migrationBuilder.CreateIndex("IX_StandaloneFiles_IsDirectory", "StandaloneFiles", "IsDirectory"); + + migrationBuilder.CreateIndex("IX_StandaloneFiles_LastWriteDate", "StandaloneFiles", "LastWriteDate"); + + migrationBuilder.CreateIndex("IX_StandaloneFiles_Name", "StandaloneFiles", "Name"); + + migrationBuilder.CreateIndex("IX_StandaloneFiles_Path", "StandaloneFiles", "Path"); + + migrationBuilder.CreateIndex("IX_StandaloneFiles_SoftwareVariantId", "StandaloneFiles", + "SoftwareVariantId"); + + migrationBuilder.CreateIndex("IX_StandaloneFiles_StatusChangeDate", "StandaloneFiles", "StatusChangeDate"); + + migrationBuilder.CreateIndex("IX_StandaloneFiles_UserId", "StandaloneFiles", "UserId"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable("CompaniesBySoftwareVariant"); + + migrationBuilder.DropTable("FileDataStreamsByStandaloneFile"); + + migrationBuilder.DropTable("GpusBySoftwareVariant"); + + migrationBuilder.DropTable("InstructionSetsBySoftwareVariant"); + + migrationBuilder.DropTable("LanguagesBySoftwareVariant"); + + migrationBuilder.DropTable("MachineFamiliesBySoftwareVariant"); + + migrationBuilder.DropTable("MachinesBySoftwareVariant"); + + migrationBuilder.DropTable("MediaBySoftwareVariant"); + + migrationBuilder.DropTable("PeopleBySoftwareVariant"); + + migrationBuilder.DropTable("ProcessorsBySoftwareVariant"); + + migrationBuilder.DropTable("RequiredOperatingSystemsBySofwareVariant"); + + migrationBuilder.DropTable("RequiredSoftwareBySoftwareVariant"); + + migrationBuilder.DropTable("SoundBySoftwareVariant"); + + migrationBuilder.DropTable("StandaloneFiles"); + + migrationBuilder.DropTable("SoftwareVariants"); + } + } +} \ No newline at end of file diff --git a/Marechai.Database/Migrations/MarechaiContextModelSnapshot.cs b/Marechai.Database/Migrations/MarechaiContextModelSnapshot.cs index 004cfa73..119ff3f9 100644 --- a/Marechai.Database/Migrations/MarechaiContextModelSnapshot.cs +++ b/Marechai.Database/Migrations/MarechaiContextModelSnapshot.cs @@ -381,6 +381,31 @@ namespace Marechai.Database.Migrations b.ToTable("CompaniesBySoftwareFamily"); }); + modelBuilder.Entity("Marechai.Database.Models.CompaniesBySoftwareVariant", b => + { + b.Property("Id").ValueGeneratedOnAdd().HasColumnType("bigint unsigned"); + + b.Property("CompanyId").HasColumnType("int(11)"); + + b.Property("CreatedOn").ValueGeneratedOnAdd().HasColumnType("datetime(6)"); + + b.Property("RoleId").IsRequired().HasColumnType("char(3)"); + + b.Property("SoftwareVariantId").HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn").ValueGeneratedOnAddOrUpdate().HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("CompanyId"); + + b.HasIndex("RoleId"); + + b.HasIndex("SoftwareVariantId"); + + b.ToTable("CompaniesBySoftwareVariant"); + }); + modelBuilder.Entity("Marechai.Database.Models.CompaniesBySoftwareVersion", b => { b.Property("Id").ValueGeneratedOnAdd().HasColumnType("bigint unsigned"); @@ -927,6 +952,27 @@ namespace Marechai.Database.Migrations b.ToTable("FileDataStreamsByMediaFile"); }); + modelBuilder.Entity("Marechai.Database.Models.FileDataStreamsByStandaloneFile", b => + { + b.Property("Id").ValueGeneratedOnAdd().HasColumnType("bigint unsigned"); + + b.Property("CreatedOn").ValueGeneratedOnAdd().HasColumnType("datetime(6)"); + + b.Property("FileDataStreamId").HasColumnType("bigint unsigned"); + + b.Property("StandaloneFileId").HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn").ValueGeneratedOnAddOrUpdate().HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("FileDataStreamId"); + + b.HasIndex("StandaloneFileId"); + + b.ToTable("FileDataStreamsByStandaloneFile"); + }); + modelBuilder.Entity("Marechai.Database.Models.FilesByFilesystem", b => { b.Property("Id").ValueGeneratedOnAdd().HasColumnType("bigint unsigned"); @@ -1187,6 +1233,35 @@ namespace Marechai.Database.Migrations b.ToTable("GpusByOwnedMachine"); }); + modelBuilder.Entity("Marechai.Database.Models.GpusBySoftwareVariant", b => + { + b.Property("Id").ValueGeneratedOnAdd().HasColumnType("bigint unsigned"); + + b.Property("CreatedOn").ValueGeneratedOnAdd().HasColumnType("datetime(6)"); + + b.Property("GpuId").HasColumnType("int(11)"); + + b.Property("Minimum").HasColumnType("bit(1)"); + + b.Property("Recommended").HasColumnType("bit(1)"); + + b.Property("SoftwareVariantId").HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn").ValueGeneratedOnAddOrUpdate().HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("GpuId"); + + b.HasIndex("Minimum"); + + b.HasIndex("Recommended"); + + b.HasIndex("SoftwareVariantId"); + + b.ToTable("GpusBySoftwareVariant"); + }); + modelBuilder.Entity("Marechai.Database.Models.InstructionSet", b => { b.Property("Id").ValueGeneratedOnAdd().HasColumnName("id").HasColumnType("int(11)"); @@ -1240,6 +1315,27 @@ namespace Marechai.Database.Migrations b.ToTable("instruction_set_extensions_by_processor"); }); + modelBuilder.Entity("Marechai.Database.Models.InstructionSetsBySoftwareVariant", b => + { + b.Property("Id").ValueGeneratedOnAdd().HasColumnType("bigint unsigned"); + + b.Property("CreatedOn").ValueGeneratedOnAdd().HasColumnType("datetime(6)"); + + b.Property("InstructionSetId").HasColumnType("int(11)"); + + b.Property("SoftwareVariantId").HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn").ValueGeneratedOnAddOrUpdate().HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("InstructionSetId"); + + b.HasIndex("SoftwareVariantId"); + + b.ToTable("InstructionSetsBySoftwareVariant"); + }); + modelBuilder.Entity("Marechai.Database.Models.Iso31661Numeric", b => { b.Property("Id").ValueGeneratedOnAdd().HasColumnName("id").HasColumnType("smallint(3)"); @@ -1326,6 +1422,27 @@ namespace Marechai.Database.Migrations b.ToTable("ISO_639-3"); }); + modelBuilder.Entity("Marechai.Database.Models.LanguagesBySoftwareVariant", b => + { + b.Property("Id").ValueGeneratedOnAdd().HasColumnType("bigint unsigned"); + + b.Property("CreatedOn").ValueGeneratedOnAdd().HasColumnType("datetime(6)"); + + b.Property("LanguageId").IsRequired().HasColumnType("char(3)"); + + b.Property("SoftwareVariantId").HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn").ValueGeneratedOnAddOrUpdate().HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("LanguageId"); + + b.HasIndex("SoftwareVariantId"); + + b.ToTable("LanguagesBySoftwareVariant"); + }); + modelBuilder.Entity("Marechai.Database.Models.License", b => { b.Property("Id").ValueGeneratedOnAdd().HasColumnType("int"); @@ -1494,6 +1611,27 @@ namespace Marechai.Database.Migrations b.ToTable("machines"); }); + modelBuilder.Entity("Marechai.Database.Models.MachineFamiliesBySoftwareVariant", b => + { + b.Property("Id").ValueGeneratedOnAdd().HasColumnType("bigint unsigned"); + + b.Property("CreatedOn").ValueGeneratedOnAdd().HasColumnType("datetime(6)"); + + b.Property("MachineFamilyId").HasColumnType("int(11)"); + + b.Property("SoftwareVariantId").HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn").ValueGeneratedOnAddOrUpdate().HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("MachineFamilyId"); + + b.HasIndex("SoftwareVariantId"); + + b.ToTable("MachineFamiliesBySoftwareVariant"); + }); + modelBuilder.Entity("Marechai.Database.Models.MachineFamily", b => { b.Property("Id").ValueGeneratedOnAdd().HasColumnName("id").HasColumnType("int(11)"); @@ -1678,6 +1816,27 @@ namespace Marechai.Database.Migrations b.ToTable("MachinePhotos"); }); + modelBuilder.Entity("Marechai.Database.Models.MachinesBySoftwareVariant", b => + { + b.Property("Id").ValueGeneratedOnAdd().HasColumnType("bigint unsigned"); + + b.Property("CreatedOn").ValueGeneratedOnAdd().HasColumnType("datetime(6)"); + + b.Property("MachineId").HasColumnType("int(11)"); + + b.Property("SoftwareVariantId").HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn").ValueGeneratedOnAddOrUpdate().HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("MachineId"); + + b.HasIndex("SoftwareVariantId"); + + b.ToTable("MachinesBySoftwareVariant"); + }); + modelBuilder.Entity("Marechai.Database.Models.Magazine", b => { b.Property("Id").ValueGeneratedOnAdd().HasColumnType("bigint"); @@ -1895,6 +2054,27 @@ namespace Marechai.Database.Migrations b.ToTable("Media"); }); + modelBuilder.Entity("Marechai.Database.Models.MediaBySoftwareVariant", b => + { + b.Property("Id").ValueGeneratedOnAdd().HasColumnType("bigint unsigned"); + + b.Property("CreatedOn").ValueGeneratedOnAdd().HasColumnType("datetime(6)"); + + b.Property("MediaId").HasColumnType("bigint unsigned"); + + b.Property("SoftwareVariantId").HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn").ValueGeneratedOnAddOrUpdate().HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("MediaId"); + + b.HasIndex("SoftwareVariantId"); + + b.ToTable("MediaBySoftwareVariant"); + }); + modelBuilder.Entity("Marechai.Database.Models.MediaDump", b => { b.Property("Id").ValueGeneratedOnAdd().HasColumnType("bigint unsigned"); @@ -2644,6 +2824,31 @@ namespace Marechai.Database.Migrations b.ToTable("PeopleBySoftwareFamily"); }); + modelBuilder.Entity("Marechai.Database.Models.PeopleBySoftwareVariant", b => + { + b.Property("Id").ValueGeneratedOnAdd().HasColumnType("bigint unsigned"); + + b.Property("CreatedOn").ValueGeneratedOnAdd().HasColumnType("datetime(6)"); + + b.Property("PersonId").HasColumnType("int"); + + b.Property("RoleId").IsRequired().HasColumnType("char(3)"); + + b.Property("SoftwareVariantId").HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn").ValueGeneratedOnAddOrUpdate().HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("PersonId"); + + b.HasIndex("RoleId"); + + b.HasIndex("SoftwareVariantId"); + + b.ToTable("PeopleBySoftwareVariant"); + }); + modelBuilder.Entity("Marechai.Database.Models.PeopleBySoftwareVersion", b => { b.Property("Id").ValueGeneratedOnAdd().HasColumnType("bigint unsigned"); @@ -2893,6 +3098,81 @@ namespace Marechai.Database.Migrations b.ToTable("ProcessorsByOwnedMachine"); }); + modelBuilder.Entity("Marechai.Database.Models.ProcessorsBySoftwareVariant", b => + { + b.Property("Id").ValueGeneratedOnAdd().HasColumnType("bigint unsigned"); + + b.Property("CreatedOn").ValueGeneratedOnAdd().HasColumnType("datetime(6)"); + + b.Property("Minimum").HasColumnType("bit(1)"); + + b.Property("ProcessorId").HasColumnType("int(11)"); + + b.Property("Recommended").HasColumnType("bit(1)"); + + b.Property("SoftwareVariantId").HasColumnType("bigint unsigned"); + + b.Property("Speed").HasColumnType("float"); + + b.Property("UpdatedOn").ValueGeneratedOnAddOrUpdate().HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("Minimum"); + + b.HasIndex("ProcessorId"); + + b.HasIndex("Recommended"); + + b.HasIndex("SoftwareVariantId"); + + b.HasIndex("Speed"); + + b.ToTable("ProcessorsBySoftwareVariant"); + }); + + modelBuilder.Entity("Marechai.Database.Models.RequiredOperatingSystemsBySofwareVariant", b => + { + b.Property("Id").ValueGeneratedOnAdd().HasColumnType("bigint unsigned"); + + b.Property("CreatedOn").ValueGeneratedOnAdd().HasColumnType("datetime(6)"); + + b.Property("OperatingSystemId").HasColumnType("bigint unsigned"); + + b.Property("SoftwareVariantId").HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn").ValueGeneratedOnAddOrUpdate().HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("OperatingSystemId"); + + b.HasIndex("SoftwareVariantId"); + + b.ToTable("RequiredOperatingSystemsBySofwareVariant"); + }); + + modelBuilder.Entity("Marechai.Database.Models.RequiredSoftwareBySoftwareVariant", b => + { + b.Property("Id").ValueGeneratedOnAdd().HasColumnType("bigint unsigned"); + + b.Property("CreatedOn").ValueGeneratedOnAdd().HasColumnType("datetime(6)"); + + b.Property("SoftwareVariantId").HasColumnType("bigint unsigned"); + + b.Property("SoftwareVersionId").HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn").ValueGeneratedOnAddOrUpdate().HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("SoftwareVariantId"); + + b.HasIndex("SoftwareVersionId"); + + b.ToTable("RequiredSoftwareBySoftwareVariant"); + }); + modelBuilder.Entity("Marechai.Database.Models.Resolution", b => { b.Property("Id").ValueGeneratedOnAdd().HasColumnName("id").HasColumnType("int(11)"); @@ -3061,6 +3341,71 @@ namespace Marechai.Database.Migrations b.ToTable("SoftwareFamilies"); }); + modelBuilder.Entity("Marechai.Database.Models.SoftwareVariant", b => + { + b.Property("Id").ValueGeneratedOnAdd().HasColumnType("bigint unsigned"); + + b.Property("CatalogueNumber").HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("CreatedOn").ValueGeneratedOnAdd().HasColumnType("datetime(6)"); + + b.Property("DistributionMode").HasColumnType("int unsigned"); + + b.Property("Introduced").HasColumnType("datetime(6)"); + + b.Property("MinimumMemory").HasColumnType("bigint unsigned"); + + b.Property("Name").HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("ParentId").HasColumnType("bigint unsigned"); + + b.Property("PartNumber").HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("ProductCode").HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("RecommendedMemory").HasColumnType("bigint unsigned"); + + b.Property("RequiredStorage").HasColumnType("bigint unsigned"); + + b.Property("SerialNumber").HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("SoftwareVersionId").HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn").ValueGeneratedOnAddOrUpdate().HasColumnType("datetime(6)"); + + b.Property("Version").HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.HasIndex("CatalogueNumber"); + + b.HasIndex("DistributionMode"); + + b.HasIndex("Introduced"); + + b.HasIndex("MinimumMemory"); + + b.HasIndex("Name"); + + b.HasIndex("ParentId"); + + b.HasIndex("PartNumber"); + + b.HasIndex("ProductCode"); + + b.HasIndex("RecommendedMemory"); + + b.HasIndex("RequiredStorage"); + + b.HasIndex("SerialNumber"); + + b.HasIndex("SoftwareVersionId"); + + b.HasIndex("Version"); + + b.ToTable("SoftwareVariants"); + }); + modelBuilder.Entity("Marechai.Database.Models.SoftwareVersion", b => { b.Property("Id").ValueGeneratedOnAdd().HasColumnType("bigint unsigned"); @@ -3144,6 +3489,27 @@ namespace Marechai.Database.Migrations b.ToTable("SoundByOwnedMachine"); }); + modelBuilder.Entity("Marechai.Database.Models.SoundBySoftwareVariant", b => + { + b.Property("Id").ValueGeneratedOnAdd().HasColumnType("bigint unsigned"); + + b.Property("CreatedOn").ValueGeneratedOnAdd().HasColumnType("datetime(6)"); + + b.Property("SoftwareVariantId").HasColumnType("bigint unsigned"); + + b.Property("SoundSynthId").HasColumnType("int(11)"); + + b.Property("UpdatedOn").ValueGeneratedOnAddOrUpdate().HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("SoftwareVariantId"); + + b.HasIndex("SoundSynthId"); + + b.ToTable("SoundBySoftwareVariant"); + }); + modelBuilder.Entity("Marechai.Database.Models.SoundSynth", b => { b.Property("Id").ValueGeneratedOnAdd().HasColumnName("id").HasColumnType("int(11)"); @@ -3199,6 +3565,77 @@ namespace Marechai.Database.Migrations b.ToTable("sound_synths"); }); + modelBuilder.Entity("Marechai.Database.Models.StandaloneFile", b => + { + b.Property("Id").ValueGeneratedOnAdd().HasColumnType("bigint unsigned"); + + b.Property("AccessDate").HasColumnType("datetime(6)"); + + b.Property("Attributes").HasColumnType("bigint unsigned"); + + b.Property("BackupDate").HasColumnType("datetime(6)"); + + b.Property("CreatedOn").ValueGeneratedOnAdd().HasColumnType("datetime(6)"); + + b.Property("CreationDate").HasColumnType("datetime(6)"); + + b.Property("DeviceNumber").HasColumnType("int unsigned"); + + b.Property("GroupId").HasColumnType("bigint unsigned"); + + b.Property("Inode").HasColumnType("bigint unsigned"); + + b.Property("IsDirectory").HasColumnType("bit(1)"); + + b.Property("LastWriteDate").HasColumnType("datetime(6)"); + + b.Property("Links").HasColumnType("bigint unsigned"); + + b.Property("Name").IsRequired().HasColumnType("varchar(255) CHARACTER SET utf8mb4"). + HasMaxLength(255); + + b.Property("Path").IsRequired().HasColumnType("longtext CHARACTER SET utf8mb4"). + HasMaxLength(8192); + + b.Property("PathSeparator").IsRequired().HasColumnType("varchar(1) CHARACTER SET utf8mb4"); + + b.Property("PosixMode").HasColumnType("smallint unsigned"); + + b.Property("SoftwareVariantId").HasColumnType("bigint unsigned"); + + b.Property("StatusChangeDate").HasColumnType("datetime(6)"); + + b.Property("UpdatedOn").ValueGeneratedOnAddOrUpdate().HasColumnType("datetime(6)"); + + b.Property("UserId").HasColumnType("bigint unsigned"); + + b.HasKey("Id"); + + b.HasIndex("AccessDate"); + + b.HasIndex("BackupDate"); + + b.HasIndex("CreationDate"); + + b.HasIndex("GroupId"); + + b.HasIndex("IsDirectory"); + + b.HasIndex("LastWriteDate"); + + b.HasIndex("Name"); + + b.HasIndex("Path"); + + b.HasIndex("SoftwareVariantId"); + + b.HasIndex("StatusChangeDate"); + + b.HasIndex("UserId"); + + b.ToTable("StandaloneFiles"); + }); + modelBuilder.Entity("Marechai.Database.Models.StorageByMachine", b => { b.Property("Id").ValueGeneratedOnAdd().HasColumnName("id").HasColumnType("bigint(20)"); @@ -3421,6 +3858,18 @@ namespace Marechai.Database.Migrations HasForeignKey("SoftwareFamilyId").OnDelete(DeleteBehavior.Cascade).IsRequired(); }); + modelBuilder.Entity("Marechai.Database.Models.CompaniesBySoftwareVariant", b => + { + b.HasOne("Marechai.Database.Models.Company", "Company").WithMany("SoftwareVariants"). + HasForeignKey("CompanyId").OnDelete(DeleteBehavior.Cascade).IsRequired(); + + b.HasOne("Marechai.Database.Models.DocumentRole", "Role").WithMany().HasForeignKey("RoleId"). + OnDelete(DeleteBehavior.Cascade).IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareVariant", "SoftwareVariant").WithMany("Companies"). + HasForeignKey("SoftwareVariantId").OnDelete(DeleteBehavior.Cascade).IsRequired(); + }); + modelBuilder.Entity("Marechai.Database.Models.CompaniesBySoftwareVersion", b => { b.HasOne("Marechai.Database.Models.Company", "Company").WithMany("SoftwareVersions"). @@ -3539,6 +3988,15 @@ namespace Marechai.Database.Migrations HasForeignKey("MediaFileId").OnDelete(DeleteBehavior.Cascade).IsRequired(); }); + modelBuilder.Entity("Marechai.Database.Models.FileDataStreamsByStandaloneFile", b => + { + b.HasOne("Marechai.Database.Models.FileDataStream", "FileDataStream").WithMany(). + HasForeignKey("FileDataStreamId").OnDelete(DeleteBehavior.Cascade).IsRequired(); + + b.HasOne("Marechai.Database.Models.StandaloneFile", "StandaloneFile").WithMany("DataStreams"). + HasForeignKey("StandaloneFileId").OnDelete(DeleteBehavior.Cascade).IsRequired(); + }); + modelBuilder.Entity("Marechai.Database.Models.FilesByFilesystem", b => { b.HasOne("Marechai.Database.Models.MediaFile", "File").WithMany().HasForeignKey("FileId"). @@ -3590,6 +4048,15 @@ namespace Marechai.Database.Migrations HasForeignKey("OwnedMachineId").OnDelete(DeleteBehavior.Cascade).IsRequired(); }); + modelBuilder.Entity("Marechai.Database.Models.GpusBySoftwareVariant", b => + { + b.HasOne("Marechai.Database.Models.Gpu", "Gpu").WithMany("Software").HasForeignKey("GpuId"). + OnDelete(DeleteBehavior.Cascade).IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareVariant", "SoftwareVariant").WithMany("Gpus"). + HasForeignKey("SoftwareVariantId").OnDelete(DeleteBehavior.Cascade).IsRequired(); + }); + modelBuilder.Entity("Marechai.Database.Models.InstructionSetExtensionsByProcessor", b => { b.HasOne("Marechai.Database.Models.InstructionSetExtension", "Extension"). @@ -3600,6 +4067,24 @@ namespace Marechai.Database.Migrations HasForeignKey("ProcessorId").HasConstraintName("fk_extension_processor_id").IsRequired(); }); + modelBuilder.Entity("Marechai.Database.Models.InstructionSetsBySoftwareVariant", b => + { + b.HasOne("Marechai.Database.Models.InstructionSet", "InstructionSet").WithMany("Software"). + HasForeignKey("InstructionSetId").OnDelete(DeleteBehavior.Cascade).IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareVariant", "SoftwareVariant").WithMany("Architectures"). + HasForeignKey("SoftwareVariantId").OnDelete(DeleteBehavior.Cascade).IsRequired(); + }); + + modelBuilder.Entity("Marechai.Database.Models.LanguagesBySoftwareVariant", b => + { + b.HasOne("Marechai.Database.Models.Iso639", "Language").WithMany("Software"). + HasForeignKey("LanguageId").OnDelete(DeleteBehavior.Cascade).IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareVariant", "SoftwareVariant").WithMany("Languages"). + HasForeignKey("SoftwareVariantId").OnDelete(DeleteBehavior.Cascade).IsRequired(); + }); + modelBuilder.Entity("Marechai.Database.Models.LogicalPartitionsByMedia", b => { b.HasOne("Marechai.Database.Models.Media", "Media").WithMany("LogicalPartitions"). @@ -3618,6 +4103,15 @@ namespace Marechai.Database.Migrations HasForeignKey("FamilyId").HasConstraintName("fk_machines_family"); }); + modelBuilder.Entity("Marechai.Database.Models.MachineFamiliesBySoftwareVariant", b => + { + b.HasOne("Marechai.Database.Models.MachineFamily", "MachineFamily").WithMany("Software"). + HasForeignKey("MachineFamilyId").OnDelete(DeleteBehavior.Cascade).IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareVariant", "SoftwareVariant").WithMany("MachineFamilies"). + HasForeignKey("SoftwareVariantId").OnDelete(DeleteBehavior.Cascade).IsRequired(); + }); + modelBuilder.Entity("Marechai.Database.Models.MachineFamily", b => { b.HasOne("Marechai.Database.Models.Company", "Company").WithMany("MachineFamilies"). @@ -3637,6 +4131,15 @@ namespace Marechai.Database.Migrations OnDelete(DeleteBehavior.SetNull); }); + modelBuilder.Entity("Marechai.Database.Models.MachinesBySoftwareVariant", b => + { + b.HasOne("Marechai.Database.Models.Machine", "Machine").WithMany("Software").HasForeignKey("MachineId"). + OnDelete(DeleteBehavior.Cascade).IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareVariant", "SoftwareVariant").WithMany("Machines"). + HasForeignKey("SoftwareVariantId").OnDelete(DeleteBehavior.Cascade).IsRequired(); + }); + modelBuilder.Entity("Marechai.Database.Models.Magazine", b => { b.HasOne("Marechai.Database.Models.Iso31661Numeric", "Country").WithMany("Magazines"). @@ -3667,6 +4170,15 @@ namespace Marechai.Database.Migrations HasForeignKey("MagazineId").OnDelete(DeleteBehavior.Cascade).IsRequired(); }); + modelBuilder.Entity("Marechai.Database.Models.MediaBySoftwareVariant", b => + { + b.HasOne("Marechai.Database.Models.Media", "Media").WithMany("Software").HasForeignKey("MediaId"). + OnDelete(DeleteBehavior.Cascade).IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareVariant", "SoftwareVariant").WithMany("Media"). + HasForeignKey("SoftwareVariantId").OnDelete(DeleteBehavior.Cascade).IsRequired(); + }); + modelBuilder.Entity("Marechai.Database.Models.MediaDump", b => { b.HasOne("Marechai.Database.Models.Media", "Media").WithMany("MediaDumps").HasForeignKey("MediaId"). @@ -3793,6 +4305,18 @@ namespace Marechai.Database.Migrations HasForeignKey("SoftwareFamilyId").OnDelete(DeleteBehavior.Cascade).IsRequired(); }); + modelBuilder.Entity("Marechai.Database.Models.PeopleBySoftwareVariant", b => + { + b.HasOne("Marechai.Database.Models.Person", "Person").WithMany("SoftwareVariants"). + HasForeignKey("PersonId").OnDelete(DeleteBehavior.Cascade).IsRequired(); + + b.HasOne("Marechai.Database.Models.DocumentRole", "Role").WithMany().HasForeignKey("RoleId"). + OnDelete(DeleteBehavior.Cascade).IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareVariant", "SoftwareVariant").WithMany("People"). + HasForeignKey("SoftwareVariantId").OnDelete(DeleteBehavior.Cascade).IsRequired(); + }); + modelBuilder.Entity("Marechai.Database.Models.PeopleBySoftwareVersion", b => { b.HasOne("Marechai.Database.Models.Person", "Person").WithMany("SoftwareVersions"). @@ -3840,6 +4364,34 @@ namespace Marechai.Database.Migrations OnDelete(DeleteBehavior.Cascade).IsRequired(); }); + modelBuilder.Entity("Marechai.Database.Models.ProcessorsBySoftwareVariant", b => + { + b.HasOne("Marechai.Database.Models.Processor", "Processor").WithMany("Software"). + HasForeignKey("ProcessorId").OnDelete(DeleteBehavior.Cascade).IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareVariant", "SoftwareVariant").WithMany("Processors"). + HasForeignKey("SoftwareVariantId").OnDelete(DeleteBehavior.Cascade).IsRequired(); + }); + + modelBuilder.Entity("Marechai.Database.Models.RequiredOperatingSystemsBySofwareVariant", b => + { + b.HasOne("Marechai.Database.Models.SoftwareVersion", "OperatingSystem").WithMany(). + HasForeignKey("OperatingSystemId").OnDelete(DeleteBehavior.Cascade).IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareVariant", "SoftwareVariant"). + WithMany("RequiredOperatingSystems").HasForeignKey("SoftwareVariantId"). + OnDelete(DeleteBehavior.Cascade).IsRequired(); + }); + + modelBuilder.Entity("Marechai.Database.Models.RequiredSoftwareBySoftwareVariant", b => + { + b.HasOne("Marechai.Database.Models.SoftwareVariant", "SoftwareVariant").WithMany("RequiredSoftware"). + HasForeignKey("SoftwareVariantId").OnDelete(DeleteBehavior.Cascade).IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareVersion", "SoftwareVersion").WithMany(). + HasForeignKey("SoftwareVersionId").OnDelete(DeleteBehavior.Cascade).IsRequired(); + }); + modelBuilder.Entity("Marechai.Database.Models.ResolutionsByGpu", b => { b.HasOne("Marechai.Database.Models.Gpu", "Gpu").WithMany("ResolutionsByGpu").HasForeignKey("GpuId"). @@ -3880,6 +4432,15 @@ namespace Marechai.Database.Migrations HasForeignKey("ParentId").OnDelete(DeleteBehavior.SetNull); }); + modelBuilder.Entity("Marechai.Database.Models.SoftwareVariant", b => + { + b.HasOne("Marechai.Database.Models.SoftwareVariant", "Parent").WithMany("Derivates"). + HasForeignKey("ParentId").OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Marechai.Database.Models.SoftwareVersion", "SoftwareVersion").WithMany("Variants"). + HasForeignKey("SoftwareVersionId").OnDelete(DeleteBehavior.Cascade).IsRequired(); + }); + modelBuilder.Entity("Marechai.Database.Models.SoftwareVersion", b => { b.HasOne("Marechai.Database.Models.SoftwareFamily", "Family").WithMany("Versions"). @@ -3911,12 +4472,27 @@ namespace Marechai.Database.Migrations OnDelete(DeleteBehavior.Cascade).IsRequired(); }); + modelBuilder.Entity("Marechai.Database.Models.SoundBySoftwareVariant", b => + { + b.HasOne("Marechai.Database.Models.SoftwareVariant", "SoftwareVariant").WithMany("SupportedSound"). + HasForeignKey("SoftwareVariantId").OnDelete(DeleteBehavior.Cascade).IsRequired(); + + b.HasOne("Marechai.Database.Models.SoundSynth", "SoundSynth").WithMany("Software"). + 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.StandaloneFile", b => + { + b.HasOne("Marechai.Database.Models.SoftwareVariant", "SoftwareVariant").WithMany("Files"). + HasForeignKey("SoftwareVariantId").OnDelete(DeleteBehavior.Cascade).IsRequired(); + }); + modelBuilder.Entity("Marechai.Database.Models.StorageByMachine", b => { b.HasOne("Marechai.Database.Models.Machine", "Machine").WithMany("Storage").HasForeignKey("MachineId"). diff --git a/Marechai.Database/Models/BaseFile.cs b/Marechai.Database/Models/BaseFile.cs new file mode 100644 index 00000000..aede2ed1 --- /dev/null +++ b/Marechai.Database/Models/BaseFile.cs @@ -0,0 +1,55 @@ +/****************************************************************************** +// MARECHAI: Master repository of computing history artifacts information +// ---------------------------------------------------------------------------- +// +// Author(s) : Natalia Portillo +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2003-2020 Natalia Portillo +*******************************************************************************/ + +using System; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using Aaru.CommonTypes.Structs; + +namespace Marechai.Database.Models +{ + public abstract class BaseFile : BaseModel + { + [StringLength(8192), Required] + public string Path { get; set; } + [StringLength(255), Required] + public string Name { get; set; } + [Required, DefaultValue('/')] + public char PathSeparator { get; set; } + public bool IsDirectory { get; set; } + public DateTime? CreationDate { get; set; } + public DateTime? AccessDate { get; set; } + public DateTime? StatusChangeDate { get; set; } + public DateTime? BackupDate { get; set; } + public DateTime? LastWriteDate { get; set; } + public FileAttributes Attributes { get; set; } + public ushort? PosixMode { get; set; } + public uint? DeviceNumber { get; set; } + public ulong? GroupId { get; set; } + public ulong? UserId { get; set; } + public ulong? Inode { get; set; } + public ulong? Links { get; set; } + } +} \ No newline at end of file diff --git a/Marechai.Database/Models/BaseModel.cs b/Marechai.Database/Models/BaseModel.cs index 2fdc09ff..e7287861 100644 --- a/Marechai.Database/Models/BaseModel.cs +++ b/Marechai.Database/Models/BaseModel.cs @@ -28,7 +28,7 @@ using System.ComponentModel.DataAnnotations.Schema; namespace Marechai.Database.Models { - public class BaseModel + public abstract class BaseModel { public TKey Id { get; set; } diff --git a/Marechai.Database/Models/BasePhoto.cs b/Marechai.Database/Models/BasePhoto.cs index 287338d7..28c958b7 100644 --- a/Marechai.Database/Models/BasePhoto.cs +++ b/Marechai.Database/Models/BasePhoto.cs @@ -29,7 +29,7 @@ using System.ComponentModel.DataAnnotations; namespace Marechai.Database.Models { - public class BasePhoto : BaseModel + public abstract class BasePhoto : BaseModel { public double? Aperture { get; set; } public string Author { get; set; } diff --git a/Marechai.Database/Models/CompaniesBySoftwareVariant.cs b/Marechai.Database/Models/CompaniesBySoftwareVariant.cs new file mode 100644 index 00000000..7ee8cd79 --- /dev/null +++ b/Marechai.Database/Models/CompaniesBySoftwareVariant.cs @@ -0,0 +1,39 @@ +/****************************************************************************** +// MARECHAI: Master repository of computing history artifacts information +// ---------------------------------------------------------------------------- +// +// Author(s) : Natalia Portillo +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2003-2020 Natalia Portillo +*******************************************************************************/ + +using System.ComponentModel.DataAnnotations; + +namespace Marechai.Database.Models +{ + public class CompaniesBySoftwareVariant : BaseModel + { + [Required] + public virtual Company Company { get; set; } + [Required] + public virtual SoftwareVariant SoftwareVariant { get; set; } + [Required] + public virtual DocumentRole Role { get; set; } + } +} \ No newline at end of file diff --git a/Marechai.Database/Models/Company.cs b/Marechai.Database/Models/Company.cs index fadfb753..3b227f21 100644 --- a/Marechai.Database/Models/Company.cs +++ b/Marechai.Database/Models/Company.cs @@ -86,5 +86,6 @@ namespace Marechai.Database.Models public virtual DocumentCompany DocumentCompany { get; set; } public virtual ICollection SoftwareFamilies { get; set; } public virtual ICollection SoftwareVersions { get; set; } + public virtual ICollection SoftwareVariants { get; set; } } } \ No newline at end of file diff --git a/Marechai.Database/Models/FileDataStreamsByStandaloneFile.cs b/Marechai.Database/Models/FileDataStreamsByStandaloneFile.cs new file mode 100644 index 00000000..b72d552f --- /dev/null +++ b/Marechai.Database/Models/FileDataStreamsByStandaloneFile.cs @@ -0,0 +1,37 @@ +/****************************************************************************** +// MARECHAI: Master repository of computing history artifacts information +// ---------------------------------------------------------------------------- +// +// Author(s) : Natalia Portillo +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2003-2020 Natalia Portillo +*******************************************************************************/ + +using System.ComponentModel.DataAnnotations; + +namespace Marechai.Database.Models +{ + public class FileDataStreamsByStandaloneFile : BaseModel + { + [Required] + public virtual FileDataStream FileDataStream { get; set; } + [Required] + public virtual StandaloneFile StandaloneFile { get; set; } + } +} \ No newline at end of file diff --git a/Marechai.Database/Models/Gpu.cs b/Marechai.Database/Models/Gpu.cs index 104ee447..fb67762d 100644 --- a/Marechai.Database/Models/Gpu.cs +++ b/Marechai.Database/Models/Gpu.cs @@ -56,8 +56,9 @@ namespace Marechai.Database.Models [Range(1, long.MaxValue)] public long? Transistors { get; set; } - public virtual Company Company { get; set; } - public virtual ICollection GpusByMachine { get; set; } - public virtual ICollection ResolutionsByGpu { get; set; } + public virtual Company Company { get; set; } + public virtual ICollection GpusByMachine { get; set; } + public virtual ICollection ResolutionsByGpu { get; set; } + public virtual ICollection Software { get; set; } } } \ No newline at end of file diff --git a/Marechai.Database/Models/GpusBySoftwareVariant.cs b/Marechai.Database/Models/GpusBySoftwareVariant.cs new file mode 100644 index 00000000..8b233c43 --- /dev/null +++ b/Marechai.Database/Models/GpusBySoftwareVariant.cs @@ -0,0 +1,39 @@ +/****************************************************************************** +// MARECHAI: Master repository of computing history artifacts information +// ---------------------------------------------------------------------------- +// +// Author(s) : Natalia Portillo +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2003-2020 Natalia Portillo +*******************************************************************************/ + +using System.ComponentModel.DataAnnotations; + +namespace Marechai.Database.Models +{ + public class GpusBySoftwareVariant : BaseModel + { + [Required] + public virtual Gpu Gpu { get; set; } + [Required] + public virtual SoftwareVariant SoftwareVariant { get; set; } + public bool? Minimum { get; set; } + public bool? Recommended { get; set; } + } +} \ No newline at end of file diff --git a/Marechai.Database/Models/InstructionSet.cs b/Marechai.Database/Models/InstructionSet.cs index 6a05ad16..e6d4eea3 100644 --- a/Marechai.Database/Models/InstructionSet.cs +++ b/Marechai.Database/Models/InstructionSet.cs @@ -36,6 +36,7 @@ namespace Marechai.Database.Models [Required, StringLength(45), Remote("VerifyUnique", "InstructionSets", "Admin")] public string Name { get; set; } - public virtual ICollection Processors { get; set; } + public virtual ICollection Processors { get; set; } + public virtual ICollection Software { get; set; } } } \ No newline at end of file diff --git a/Marechai.Database/Models/InstructionSetsBySoftwareVariant.cs b/Marechai.Database/Models/InstructionSetsBySoftwareVariant.cs new file mode 100644 index 00000000..33afafbf --- /dev/null +++ b/Marechai.Database/Models/InstructionSetsBySoftwareVariant.cs @@ -0,0 +1,37 @@ +/****************************************************************************** +// MARECHAI: Master repository of computing history artifacts information +// ---------------------------------------------------------------------------- +// +// Author(s) : Natalia Portillo +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2003-2020 Natalia Portillo +*******************************************************************************/ + +using System.ComponentModel.DataAnnotations; + +namespace Marechai.Database.Models +{ + public class InstructionSetsBySoftwareVariant : BaseModel + { + [Required] + public virtual InstructionSet InstructionSet { get; set; } + [Required] + public virtual SoftwareVariant SoftwareVariant { get; set; } + } +} \ No newline at end of file diff --git a/Marechai.Database/Models/Iso639.cs b/Marechai.Database/Models/Iso639.cs index c36b224f..051c4eda 100644 --- a/Marechai.Database/Models/Iso639.cs +++ b/Marechai.Database/Models/Iso639.cs @@ -24,6 +24,7 @@ *******************************************************************************/ using System; +using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; @@ -53,5 +54,7 @@ namespace Marechai.Database.Models public string ReferenceName { get; set; } [Column(TypeName = "varchar(150)")] public string Comment { get; set; } + + public virtual ICollection Software { get; set; } } } \ No newline at end of file diff --git a/Marechai.Database/Models/LanguagesBySoftwareVariant.cs b/Marechai.Database/Models/LanguagesBySoftwareVariant.cs new file mode 100644 index 00000000..aecdef0e --- /dev/null +++ b/Marechai.Database/Models/LanguagesBySoftwareVariant.cs @@ -0,0 +1,37 @@ +/****************************************************************************** +// MARECHAI: Master repository of computing history artifacts information +// ---------------------------------------------------------------------------- +// +// Author(s) : Natalia Portillo +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2003-2020 Natalia Portillo +*******************************************************************************/ + +using System.ComponentModel.DataAnnotations; + +namespace Marechai.Database.Models +{ + public class LanguagesBySoftwareVariant : BaseModel + { + [Required] + public virtual Iso639 Language { get; set; } + [Required] + public virtual SoftwareVariant SoftwareVariant { get; set; } + } +} \ No newline at end of file diff --git a/Marechai.Database/Models/Machine.cs b/Marechai.Database/Models/Machine.cs index 0bc4172c..82898c7a 100644 --- a/Marechai.Database/Models/Machine.cs +++ b/Marechai.Database/Models/Machine.cs @@ -52,17 +52,18 @@ namespace Marechai.Database.Models [StringLength(50)] public string Model { get; set; } - public virtual Company Company { get; set; } - public virtual MachineFamily Family { get; set; } - public virtual ICollection Gpus { get; set; } - public virtual ICollection Memory { get; set; } - public virtual ICollection Processors { get; set; } - public virtual ICollection Sound { get; set; } - public virtual ICollection Storage { get; set; } - public virtual ICollection Photos { get; set; } - public virtual ICollection Screens { get; set; } - public virtual ICollection Documents { get; set; } - public virtual ICollection Books { get; set; } - public virtual ICollection Magazines { get; set; } + public virtual Company Company { get; set; } + public virtual MachineFamily Family { get; set; } + public virtual ICollection Gpus { get; set; } + public virtual ICollection Memory { get; set; } + public virtual ICollection Processors { get; set; } + public virtual ICollection Sound { get; set; } + public virtual ICollection Storage { get; set; } + public virtual ICollection Photos { get; set; } + public virtual ICollection Screens { get; set; } + public virtual ICollection Documents { get; set; } + public virtual ICollection Books { get; set; } + public virtual ICollection Magazines { get; set; } + public virtual ICollection Software { get; set; } } } \ No newline at end of file diff --git a/Marechai.Database/Models/MachineFamiliesBySoftwareVariant.cs b/Marechai.Database/Models/MachineFamiliesBySoftwareVariant.cs new file mode 100644 index 00000000..ae36f34f --- /dev/null +++ b/Marechai.Database/Models/MachineFamiliesBySoftwareVariant.cs @@ -0,0 +1,37 @@ +/****************************************************************************** +// MARECHAI: Master repository of computing history artifacts information +// ---------------------------------------------------------------------------- +// +// Author(s) : Natalia Portillo +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2003-2020 Natalia Portillo +*******************************************************************************/ + +using System.ComponentModel.DataAnnotations; + +namespace Marechai.Database.Models +{ + public class MachineFamiliesBySoftwareVariant : BaseModel + { + [Required] + public virtual MachineFamily MachineFamily { get; set; } + [Required] + public virtual SoftwareVariant SoftwareVariant { get; set; } + } +} \ No newline at end of file diff --git a/Marechai.Database/Models/MachineFamily.cs b/Marechai.Database/Models/MachineFamily.cs index 7b37e11e..0802c159 100644 --- a/Marechai.Database/Models/MachineFamily.cs +++ b/Marechai.Database/Models/MachineFamily.cs @@ -36,10 +36,11 @@ namespace Marechai.Database.Models [Required, StringLength(255)] public string Name { get; set; } - public virtual Company Company { get; set; } - public virtual ICollection Machines { get; set; } - public virtual ICollection Documents { get; set; } - public virtual ICollection Books { get; set; } - public virtual ICollection Magazines { get; set; } + public virtual Company Company { get; set; } + public virtual ICollection Machines { get; set; } + public virtual ICollection Documents { get; set; } + public virtual ICollection Books { get; set; } + public virtual ICollection Magazines { get; set; } + public virtual ICollection Software { get; set; } } } \ No newline at end of file diff --git a/Marechai.Database/Models/MachinesBySoftwareVariant.cs b/Marechai.Database/Models/MachinesBySoftwareVariant.cs new file mode 100644 index 00000000..c34e9bac --- /dev/null +++ b/Marechai.Database/Models/MachinesBySoftwareVariant.cs @@ -0,0 +1,37 @@ +/****************************************************************************** +// MARECHAI: Master repository of computing history artifacts information +// ---------------------------------------------------------------------------- +// +// Author(s) : Natalia Portillo +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2003-2020 Natalia Portillo +*******************************************************************************/ + +using System.ComponentModel.DataAnnotations; + +namespace Marechai.Database.Models +{ + public class MachinesBySoftwareVariant : BaseModel + { + [Required] + public virtual Machine Machine { get; set; } + [Required] + public virtual SoftwareVariant SoftwareVariant { get; set; } + } +} \ No newline at end of file diff --git a/Marechai.Database/Models/MarechaiContext.cs b/Marechai.Database/Models/MarechaiContext.cs index cb0f6aa3..83db49c5 100644 --- a/Marechai.Database/Models/MarechaiContext.cs +++ b/Marechai.Database/Models/MarechaiContext.cs @@ -120,6 +120,8 @@ namespace Marechai.Database.Models public virtual DbSet MediaFiles { get; set; } public virtual DbSet Dumps { get; set; } public virtual DbSet SoftwareFamilies { get; set; } + public virtual DbSet SoftwareVariants { get; set; } + public virtual DbSet StandaloneFiles { get; set; } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { @@ -1853,6 +1855,124 @@ namespace Marechai.Database.Models entity.HasOne(d => d.Person).WithMany(p => p.SoftwareVersions).OnDelete(DeleteBehavior.Cascade); entity.HasOne(d => d.SoftwareVersion).WithMany(p => p.People).OnDelete(DeleteBehavior.Cascade); }); + + modelBuilder.Entity(entity => + { + entity.HasIndex(e => e.Introduced); + entity.HasIndex(e => e.Name); + entity.HasIndex(e => e.CatalogueNumber); + entity.HasIndex(e => e.DistributionMode); + entity.HasIndex(e => e.MinimumMemory); + entity.HasIndex(e => e.PartNumber); + entity.HasIndex(e => e.ProductCode); + entity.HasIndex(e => e.RecommendedMemory); + entity.HasIndex(e => e.RequiredStorage); + entity.HasIndex(e => e.SerialNumber); + entity.HasIndex(e => e.Version); + + entity.HasOne(e => e.Parent).WithMany(e => e.Derivates).OnDelete(DeleteBehavior.SetNull); + entity.HasOne(e => e.SoftwareVersion).WithMany(e => e.Variants).OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Company).WithMany(p => p.SoftwareVariants).OnDelete(DeleteBehavior.Cascade); + entity.HasOne(d => d.SoftwareVariant).WithMany(p => p.Companies).OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity(entity => + { + entity.HasIndex(e => e.Minimum); + entity.HasIndex(e => e.Recommended); + + entity.HasOne(d => d.Gpu).WithMany(p => p.Software).OnDelete(DeleteBehavior.Cascade); + entity.HasOne(d => d.SoftwareVariant).WithMany(p => p.Gpus).OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.InstructionSet).WithMany(p => p.Software).OnDelete(DeleteBehavior.Cascade); + entity.HasOne(d => d.SoftwareVariant).WithMany(p => p.Architectures).OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Language).WithMany(p => p.Software).OnDelete(DeleteBehavior.Cascade); + entity.HasOne(d => d.SoftwareVariant).WithMany(p => p.Languages).OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.MachineFamily).WithMany(p => p.Software).OnDelete(DeleteBehavior.Cascade); + entity.HasOne(d => d.SoftwareVariant).WithMany(p => p.MachineFamilies).OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Machine).WithMany(p => p.Software).OnDelete(DeleteBehavior.Cascade); + entity.HasOne(d => d.SoftwareVariant).WithMany(p => p.Machines).OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Media).WithMany(p => p.Software).OnDelete(DeleteBehavior.Cascade); + entity.HasOne(d => d.SoftwareVariant).WithMany(p => p.Media).OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Person).WithMany(p => p.SoftwareVariants).OnDelete(DeleteBehavior.Cascade); + entity.HasOne(d => d.SoftwareVariant).WithMany(p => p.People).OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity(entity => + { + entity.HasIndex(e => e.Minimum); + entity.HasIndex(e => e.Recommended); + entity.HasIndex(e => e.Speed); + + entity.HasOne(d => d.Processor).WithMany(p => p.Software).OnDelete(DeleteBehavior.Cascade); + entity.HasOne(d => d.SoftwareVariant).WithMany(p => p.Processors).OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.SoftwareVariant).WithMany(p => p.RequiredOperatingSystems). + OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.SoftwareVariant).WithMany(p => p.RequiredSoftware). + OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.SoundSynth).WithMany(p => p.Software).OnDelete(DeleteBehavior.Cascade); + entity.HasOne(d => d.SoftwareVariant).WithMany(p => p.SupportedSound).OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.StandaloneFile).WithMany(p => p.DataStreams).OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity(entity => + { + entity.HasIndex(e => e.Path); + entity.HasIndex(e => e.Name); + entity.HasIndex(e => e.IsDirectory); + entity.HasIndex(e => e.CreationDate); + entity.HasIndex(e => e.AccessDate); + entity.HasIndex(e => e.StatusChangeDate); + entity.HasIndex(e => e.BackupDate); + entity.HasIndex(e => e.LastWriteDate); + entity.HasIndex(e => e.GroupId); + entity.HasIndex(e => e.UserId); + + entity.HasOne(d => d.SoftwareVariant).WithMany(p => p.Files).OnDelete(DeleteBehavior.Cascade); + }); } } } \ No newline at end of file diff --git a/Marechai.Database/Models/Media.cs b/Marechai.Database/Models/Media.cs index 50f8fb53..0aff0181 100644 --- a/Marechai.Database/Models/Media.cs +++ b/Marechai.Database/Models/Media.cs @@ -59,5 +59,6 @@ namespace Marechai.Database.Models public virtual ICollection LogicalPartitions { get; set; } public virtual ICollection MediaDumps { get; set; } public virtual ICollection Dumps { get; set; } + public virtual ICollection Software { get; set; } } } \ No newline at end of file diff --git a/Marechai.Database/Models/MediaBySoftwareVariant.cs b/Marechai.Database/Models/MediaBySoftwareVariant.cs new file mode 100644 index 00000000..5901282f --- /dev/null +++ b/Marechai.Database/Models/MediaBySoftwareVariant.cs @@ -0,0 +1,37 @@ +/****************************************************************************** +// MARECHAI: Master repository of computing history artifacts information +// ---------------------------------------------------------------------------- +// +// Author(s) : Natalia Portillo +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2003-2020 Natalia Portillo +*******************************************************************************/ + +using System.ComponentModel.DataAnnotations; + +namespace Marechai.Database.Models +{ + public class MediaBySoftwareVariant : BaseModel + { + [Required] + public virtual Media Media { get; set; } + [Required] + public virtual SoftwareVariant SoftwareVariant { get; set; } + } +} \ No newline at end of file diff --git a/Marechai.Database/Models/MediaFile.cs b/Marechai.Database/Models/MediaFile.cs index a0578068..ca46e29f 100644 --- a/Marechai.Database/Models/MediaFile.cs +++ b/Marechai.Database/Models/MediaFile.cs @@ -23,36 +23,12 @@ // Copyright © 2003-2020 Natalia Portillo *******************************************************************************/ -using System; using System.Collections.Generic; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using Aaru.CommonTypes.Structs; namespace Marechai.Database.Models { - public class MediaFile : BaseModel + public class MediaFile : BaseFile { - [StringLength(8192), Required] - public string Path { get; set; } - [StringLength(255), Required] - public string Name { get; set; } - [Required, DefaultValue('/')] - public char PathSeparator { get; set; } - public bool IsDirectory { get; set; } - public DateTime? CreationDate { get; set; } - public DateTime? AccessDate { get; set; } - public DateTime? StatusChangeDate { get; set; } - public DateTime? BackupDate { get; set; } - public DateTime? LastWriteDate { get; set; } - public FileAttributes Attributes { get; set; } - public ushort? PosixMode { get; set; } - public uint? DeviceNumber { get; set; } - public ulong? GroupId { get; set; } - public ulong? UserId { get; set; } - public ulong? Inode { get; set; } - public ulong? Links { get; set; } - public virtual ICollection DataStreams { get; set; } } } \ No newline at end of file diff --git a/Marechai.Database/Models/PeopleBySoftwareVariant.cs b/Marechai.Database/Models/PeopleBySoftwareVariant.cs new file mode 100644 index 00000000..8f2ef3a6 --- /dev/null +++ b/Marechai.Database/Models/PeopleBySoftwareVariant.cs @@ -0,0 +1,39 @@ +/****************************************************************************** +// MARECHAI: Master repository of computing history artifacts information +// ---------------------------------------------------------------------------- +// +// Author(s) : Natalia Portillo +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2003-2020 Natalia Portillo +*******************************************************************************/ + +using System.ComponentModel.DataAnnotations; + +namespace Marechai.Database.Models +{ + public class PeopleBySoftwareVariant : BaseModel + { + [Required] + public virtual SoftwareVariant SoftwareVariant { get; set; } + [Required] + public virtual Person Person { get; set; } + [Required] + public virtual DocumentRole Role { get; set; } + } +} \ No newline at end of file diff --git a/Marechai.Database/Models/Person.cs b/Marechai.Database/Models/Person.cs index 1f49020d..76c320f7 100644 --- a/Marechai.Database/Models/Person.cs +++ b/Marechai.Database/Models/Person.cs @@ -62,5 +62,6 @@ namespace Marechai.Database.Models public virtual DocumentPerson DocumentPerson { get; set; } public virtual ICollection SoftwareFamilies { get; set; } public virtual ICollection SoftwareVersions { get; set; } + public virtual ICollection SoftwareVariants { get; set; } } } \ No newline at end of file diff --git a/Marechai.Database/Models/Processor.cs b/Marechai.Database/Models/Processor.cs index a57b2bd6..9698c871 100644 --- a/Marechai.Database/Models/Processor.cs +++ b/Marechai.Database/Models/Processor.cs @@ -92,5 +92,6 @@ namespace Marechai.Database.Models public virtual InstructionSet InstructionSet { get; set; } public virtual ICollection InstructionSetExtensions { get; set; } public virtual ICollection ProcessorsByMachine { get; set; } + public virtual ICollection Software { get; set; } } } \ No newline at end of file diff --git a/Marechai.Database/Models/ProcessorsBySoftwareVariant.cs b/Marechai.Database/Models/ProcessorsBySoftwareVariant.cs new file mode 100644 index 00000000..098ea705 --- /dev/null +++ b/Marechai.Database/Models/ProcessorsBySoftwareVariant.cs @@ -0,0 +1,40 @@ +/****************************************************************************** +// MARECHAI: Master repository of computing history artifacts information +// ---------------------------------------------------------------------------- +// +// Author(s) : Natalia Portillo +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2003-2020 Natalia Portillo +*******************************************************************************/ + +using System.ComponentModel.DataAnnotations; + +namespace Marechai.Database.Models +{ + public class ProcessorsBySoftwareVariant : BaseModel + { + [Required] + public virtual Processor Processor { get; set; } + [Required] + public virtual SoftwareVariant SoftwareVariant { get; set; } + public float? Speed { get; set; } + public bool? Minimum { get; set; } + public bool? Recommended { get; set; } + } +} \ No newline at end of file diff --git a/Marechai.Database/Models/RequiredOperatingSystemsBySofwareVariant.cs b/Marechai.Database/Models/RequiredOperatingSystemsBySofwareVariant.cs new file mode 100644 index 00000000..3538dbde --- /dev/null +++ b/Marechai.Database/Models/RequiredOperatingSystemsBySofwareVariant.cs @@ -0,0 +1,37 @@ +/****************************************************************************** +// MARECHAI: Master repository of computing history artifacts information +// ---------------------------------------------------------------------------- +// +// Author(s) : Natalia Portillo +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2003-2020 Natalia Portillo +*******************************************************************************/ + +using System.ComponentModel.DataAnnotations; + +namespace Marechai.Database.Models +{ + public class RequiredOperatingSystemsBySofwareVariant : BaseModel + { + [Required] + public virtual SoftwareVersion OperatingSystem { get; set; } + [Required] + public virtual SoftwareVariant SoftwareVariant { get; set; } + } +} \ No newline at end of file diff --git a/Marechai.Database/Models/RequiredSoftwareBySoftwareVariant.cs b/Marechai.Database/Models/RequiredSoftwareBySoftwareVariant.cs new file mode 100644 index 00000000..fde142bf --- /dev/null +++ b/Marechai.Database/Models/RequiredSoftwareBySoftwareVariant.cs @@ -0,0 +1,37 @@ +/****************************************************************************** +// MARECHAI: Master repository of computing history artifacts information +// ---------------------------------------------------------------------------- +// +// Author(s) : Natalia Portillo +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2003-2020 Natalia Portillo +*******************************************************************************/ + +using System.ComponentModel.DataAnnotations; + +namespace Marechai.Database.Models +{ + public class RequiredSoftwareBySoftwareVariant : BaseModel + { + [Required] + public virtual SoftwareVersion SoftwareVersion { get; set; } + [Required] + public virtual SoftwareVariant SoftwareVariant { get; set; } + } +} \ No newline at end of file diff --git a/Marechai.Database/Models/SoftwareVariant.cs b/Marechai.Database/Models/SoftwareVariant.cs new file mode 100644 index 00000000..282f262e --- /dev/null +++ b/Marechai.Database/Models/SoftwareVariant.cs @@ -0,0 +1,64 @@ +/****************************************************************************** +// MARECHAI: Master repository of computing history artifacts information +// ---------------------------------------------------------------------------- +// +// Author(s) : Natalia Portillo +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2003-2020 Natalia Portillo +*******************************************************************************/ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace Marechai.Database.Models +{ + public class SoftwareVariant : BaseModel + { + public string Name { get; set; } + public string Version { get; set; } + public DateTime? Introduced { get; set; } + public virtual SoftwareVariant Parent { get; set; } + [Required] + public virtual SoftwareVersion SoftwareVersion { get; set; } + public ulong? MinimumMemory { get; set; } + public ulong? RecommendedMemory { get; set; } + public ulong? RequiredStorage { get; set; } + public string PartNumber { get; set; } + public string SerialNumber { get; set; } + public string ProductCode { get; set; } + public string CatalogueNumber { get; set; } + public DistributionMode DistributionMode { get; set; } + + public virtual ICollection Derivates { get; set; } + public virtual ICollection Companies { get; set; } + public virtual ICollection Gpus { get; set; } + public virtual ICollection Architectures { get; set; } + public virtual ICollection Languages { get; set; } + public virtual ICollection MachineFamilies { get; set; } + public virtual ICollection Machines { get; set; } + public virtual ICollection Media { get; set; } + public virtual ICollection People { get; set; } + public virtual ICollection Processors { get; set; } + public virtual ICollection RequiredOperatingSystems { get; set; } + public virtual ICollection RequiredSoftware { get; set; } + public virtual ICollection SupportedSound { get; set; } + public virtual ICollection Files { get; set; } + } +} \ No newline at end of file diff --git a/Marechai.Database/Models/SoftwareVersion.cs b/Marechai.Database/Models/SoftwareVersion.cs index d6d20c79..ea767b35 100644 --- a/Marechai.Database/Models/SoftwareVersion.cs +++ b/Marechai.Database/Models/SoftwareVersion.cs @@ -43,5 +43,6 @@ namespace Marechai.Database.Models public virtual SoftwareVersion Next { get; set; } public virtual ICollection Companies { get; set; } public virtual ICollection People { get; set; } + public virtual ICollection Variants { get; set; } } } \ No newline at end of file diff --git a/Marechai.Database/Models/SoundBySoftwareVariant.cs b/Marechai.Database/Models/SoundBySoftwareVariant.cs new file mode 100644 index 00000000..2bda7205 --- /dev/null +++ b/Marechai.Database/Models/SoundBySoftwareVariant.cs @@ -0,0 +1,37 @@ +/****************************************************************************** +// MARECHAI: Master repository of computing history artifacts information +// ---------------------------------------------------------------------------- +// +// Author(s) : Natalia Portillo +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2003-2020 Natalia Portillo +*******************************************************************************/ + +using System.ComponentModel.DataAnnotations; + +namespace Marechai.Database.Models +{ + public class SoundBySoftwareVariant : BaseModel + { + [Required] + public virtual SoundSynth SoundSynth { get; set; } + [Required] + public virtual SoftwareVariant SoftwareVariant { get; set; } + } +} \ No newline at end of file diff --git a/Marechai.Database/Models/SoundSynth.cs b/Marechai.Database/Models/SoundSynth.cs index ca07e763..bd76e55c 100644 --- a/Marechai.Database/Models/SoundSynth.cs +++ b/Marechai.Database/Models/SoundSynth.cs @@ -53,7 +53,8 @@ namespace Marechai.Database.Models public int? WhiteNoise { get; set; } public int? Type { get; set; } - public virtual Company Company { get; set; } - public virtual ICollection SoundByMachine { get; set; } + public virtual Company Company { get; set; } + public virtual ICollection SoundByMachine { get; set; } + public virtual ICollection Software { get; set; } } } \ No newline at end of file diff --git a/Marechai.Database/Models/StandaloneFile.cs b/Marechai.Database/Models/StandaloneFile.cs new file mode 100644 index 00000000..0d782717 --- /dev/null +++ b/Marechai.Database/Models/StandaloneFile.cs @@ -0,0 +1,38 @@ +/****************************************************************************** +// MARECHAI: Master repository of computing history artifacts information +// ---------------------------------------------------------------------------- +// +// Author(s) : Natalia Portillo +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2003-2020 Natalia Portillo +*******************************************************************************/ + +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace Marechai.Database.Models +{ + public class StandaloneFile : BaseFile + { + [Required] + public virtual SoftwareVariant SoftwareVariant { get; set; } + + public virtual ICollection DataStreams { get; set; } + } +} \ No newline at end of file diff --git a/Marechai/Marechai.csproj b/Marechai/Marechai.csproj index 0ecf2af2..7a1a5792 100644 --- a/Marechai/Marechai.csproj +++ b/Marechai/Marechai.csproj @@ -2,7 +2,7 @@ netcoreapp3.1 - 4.0.0.1713 + 4.0.0.1723 Canary Islands Computer Museum Copyright © 2003-2020 Natalia Portillo Canary Islands Computer Museum Website