From 73bd8ee4ce4440d544ba7ff2beec34a79f679e92 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Fri, 8 May 2026 23:14:39 +0100 Subject: [PATCH] Consolidate SoundSynth data retrieval into a single endpoint - Added a new migration to rename and create indexes for SoundSynthPhotos. - Updated MarechaiContext to include new composite indexes for efficient querying. - Refactored SoundSynthsController to introduce a new GetFullAsync method that consolidates multiple data retrievals into a single call. - Modified the View component to utilize the new consolidated endpoint, reducing the number of HTTP requests. - Enhanced SoundSynthsService with a new method to fetch the full SoundSynth payload in one round-trip. --- .../Models/SoundSynthFullDto.cs | 129 + .../Item/Full/FullRequestBuilder.cs | 108 + .../SoundSynths/Item/ItemRequestBuilder.cs | 6 + Marechai.ApiClient/kiota-lock.json | 2 +- Marechai.Data/Dtos/SoundSynthFullDto.cs | 98 + ...ndSynthPhotosSoundSynthIdIndex.Designer.cs | 11063 ++++++++++++++++ ...59_AddSoundSynthPhotosSoundSynthIdIndex.cs | 37 + .../MarechaiContextModelSnapshot.cs | 6 +- Marechai.Database/Models/MarechaiContext.cs | 9 + .../Controllers/SoundSynthsController.cs | 225 +- Marechai/Pages/SoundSynths/View.razor.cs | 35 +- Marechai/Services/SoundSynthsService.cs | 23 + 12 files changed, 11687 insertions(+), 54 deletions(-) create mode 100644 Marechai.ApiClient/Models/SoundSynthFullDto.cs create mode 100644 Marechai.ApiClient/SoundSynths/Item/Full/FullRequestBuilder.cs create mode 100644 Marechai.Data/Dtos/SoundSynthFullDto.cs create mode 100644 Marechai.Database/Migrations/20260508201459_AddSoundSynthPhotosSoundSynthIdIndex.Designer.cs create mode 100644 Marechai.Database/Migrations/20260508201459_AddSoundSynthPhotosSoundSynthIdIndex.cs diff --git a/Marechai.ApiClient/Models/SoundSynthFullDto.cs b/Marechai.ApiClient/Models/SoundSynthFullDto.cs new file mode 100644 index 00000000..ef5f6fe1 --- /dev/null +++ b/Marechai.ApiClient/Models/SoundSynthFullDto.cs @@ -0,0 +1,129 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace Marechai.ApiClient.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class SoundSynthFullDto : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The company_logo property + public Guid? CompanyLogo { get; set; } + /// The description_html property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DescriptionHtml { get; set; } +#nullable restore +#else + public string DescriptionHtml { get; set; } +#endif + /// The description_language_code property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DescriptionLanguageCode { get; set; } +#nullable restore +#else + public string DescriptionLanguageCode { get; set; } +#endif + /// The description_text property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DescriptionText { get; set; } +#nullable restore +#else + public string DescriptionText { get; set; } +#endif + /// The machines property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Machines { get; set; } +#nullable restore +#else + public List Machines { get; set; } +#endif + /// The photos property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Photos { get; set; } +#nullable restore +#else + public List Photos { get; set; } +#endif + /// The sound_synth property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::Marechai.ApiClient.Models.SoundSynthDto? SoundSynth { get; set; } +#nullable restore +#else + public global::Marechai.ApiClient.Models.SoundSynthDto SoundSynth { get; set; } +#endif + /// The videos property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Videos { get; set; } +#nullable restore +#else + public List Videos { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SoundSynthFullDto() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::Marechai.ApiClient.Models.SoundSynthFullDto CreateFromDiscriminatorValue(IParseNode parseNode) + { + if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); + return new global::Marechai.ApiClient.Models.SoundSynthFullDto(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "company_logo", n => { CompanyLogo = n.GetGuidValue(); } }, + { "description_html", n => { DescriptionHtml = n.GetStringValue(); } }, + { "description_language_code", n => { DescriptionLanguageCode = n.GetStringValue(); } }, + { "description_text", n => { DescriptionText = n.GetStringValue(); } }, + { "machines", n => { Machines = n.GetCollectionOfObjectValues(global::Marechai.ApiClient.Models.MachineDto.CreateFromDiscriminatorValue)?.AsList(); } }, + { "photos", n => { Photos = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "sound_synth", n => { SoundSynth = n.GetObjectValue(global::Marechai.ApiClient.Models.SoundSynthDto.CreateFromDiscriminatorValue); } }, + { "videos", n => { Videos = n.GetCollectionOfObjectValues(global::Marechai.ApiClient.Models.SoundSynthVideoDto.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); + writer.WriteGuidValue("company_logo", CompanyLogo); + writer.WriteStringValue("description_html", DescriptionHtml); + writer.WriteStringValue("description_language_code", DescriptionLanguageCode); + writer.WriteStringValue("description_text", DescriptionText); + writer.WriteCollectionOfObjectValues("machines", Machines); + writer.WriteCollectionOfPrimitiveValues("photos", Photos); + writer.WriteObjectValue("sound_synth", SoundSynth); + writer.WriteCollectionOfObjectValues("videos", Videos); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/SoundSynths/Item/Full/FullRequestBuilder.cs b/Marechai.ApiClient/SoundSynths/Item/Full/FullRequestBuilder.cs new file mode 100644 index 00000000..5958e95e --- /dev/null +++ b/Marechai.ApiClient/SoundSynths/Item/Full/FullRequestBuilder.cs @@ -0,0 +1,108 @@ +// +#pragma warning disable CS0618 +using Marechai.ApiClient.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Marechai.ApiClient.SoundSynths.Item.Full +{ + /// + /// Builds and executes requests for operations under \sound-synths\{-id}\full + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class FullRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public FullRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sound-synths/{%2Did}/full{?lang*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public FullRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sound-synths/{%2Did}/full{?lang*}", rawUrl) + { + } + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + { "404", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::Marechai.ApiClient.Models.SoundSynthFullDto.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, text/plain;q=0.9"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::Marechai.ApiClient.SoundSynths.Item.Full.FullRequestBuilder WithUrl(string rawUrl) + { + return new global::Marechai.ApiClient.SoundSynths.Item.Full.FullRequestBuilder(rawUrl, RequestAdapter); + } + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class FullRequestBuilderGetQueryParameters + #pragma warning restore CS1591 + { +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("lang")] + public string? Lang { get; set; } +#nullable restore +#else + [QueryParameter("lang")] + public string Lang { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class FullRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/SoundSynths/Item/ItemRequestBuilder.cs b/Marechai.ApiClient/SoundSynths/Item/ItemRequestBuilder.cs index 9ba0cc3c..a3f248f5 100644 --- a/Marechai.ApiClient/SoundSynths/Item/ItemRequestBuilder.cs +++ b/Marechai.ApiClient/SoundSynths/Item/ItemRequestBuilder.cs @@ -3,6 +3,7 @@ using Marechai.ApiClient.Models; using Marechai.ApiClient.SoundSynths.Item.Description; using Marechai.ApiClient.SoundSynths.Item.Descriptions; +using Marechai.ApiClient.SoundSynths.Item.Full; using Marechai.ApiClient.SoundSynths.Item.Machines; using Marechai.ApiClient.SoundSynths.Item.Photos; using Marechai.ApiClient.SoundSynths.Item.Videos; @@ -32,6 +33,11 @@ namespace Marechai.ApiClient.SoundSynths.Item { get => new global::Marechai.ApiClient.SoundSynths.Item.Descriptions.DescriptionsRequestBuilder(PathParameters, RequestAdapter); } + /// The full property + public global::Marechai.ApiClient.SoundSynths.Item.Full.FullRequestBuilder Full + { + get => new global::Marechai.ApiClient.SoundSynths.Item.Full.FullRequestBuilder(PathParameters, RequestAdapter); + } /// The machines property public global::Marechai.ApiClient.SoundSynths.Item.Machines.MachinesRequestBuilder Machines { diff --git a/Marechai.ApiClient/kiota-lock.json b/Marechai.ApiClient/kiota-lock.json index 278206cb..2498b65a 100644 --- a/Marechai.ApiClient/kiota-lock.json +++ b/Marechai.ApiClient/kiota-lock.json @@ -1,5 +1,5 @@ { - "descriptionHash": "18CCAA5AB1EB61E4C6AD4D508A4A990449F492E780F84384BD5721DDEC3F4EB07301E868DC18FB336E887B60816D3EA00E73CD801CF35979D08DE5A788482FC7", + "descriptionHash": "389F8BA108D981456765FE8C3A9288855C430D007CA1DEA039290889224411A5630995CA2A8D9CCFC43727EC38FA727627E08ACB6E9FEB19709049107313B727", "descriptionLocation": "../../../../../tmp/openapi.json", "lockFileVersion": "1.0.0", "kiotaVersion": "1.31.1", diff --git a/Marechai.Data/Dtos/SoundSynthFullDto.cs b/Marechai.Data/Dtos/SoundSynthFullDto.cs new file mode 100644 index 00000000..f39c2485 --- /dev/null +++ b/Marechai.Data/Dtos/SoundSynthFullDto.cs @@ -0,0 +1,98 @@ +/****************************************************************************** +// 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-2026 Natalia Portillo +*******************************************************************************/ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Text.Json.Serialization; + +namespace Marechai.Data.Dtos; + +/// +/// Consolidated payload for the public /soundsynth/{Id} view page. Replaces 5 sequential +/// HTTP round-trips (head + machines + description + photos + videos) with a single +/// response. The head + company name + company logo are pulled in one projected query +/// (logo via inline correlated subquery so it costs zero extra DB round-trips); the +/// description language fallback is collapsed into a single ordered query; the child +/// collections are fetched in parallel using independent +/// instances from IDbContextFactory (DbContext is not thread-safe; sharing the +/// request-scoped context across parallel branches throws InvalidOperationException). +/// +public class SoundSynthFullDto +{ + // [Required] is needed in addition to the non-nullable type so the generated + // OpenAPI schema is a plain $ref instead of `oneOf:[null, $ref]`. With the + // oneOf-with-null shape Kiota generates a "composed type wrapper" that + // requires a discriminator field that doesn't exist in the JSON, leaving the + // inner DTO un-populated. See pattern in BookFullDto.Book, GpuFullDto.Gpu and + // ProcessorFullDto.Processor. + [JsonPropertyName("sound_synth")] + [Required] + public SoundSynthDto SoundSynth { get; set; } + + /// + /// Asset GUID of the company logo to display next to the sound synth header. Picked + /// from the company's logos with the introduced-year preference applied server-side + /// (logos with Year >= introducedYear sort first, then ascending by year). + /// Null when the synth has no company or the company has no logos. + /// + [JsonPropertyName("company_logo")] + public Guid? CompanyLogo { get; set; } + + /// + /// HTML-rendered description in the requested language (with English fallback applied + /// server-side via a single ordered query). Null at runtime when the synth has no + /// description in either the requested language or English. + /// + [JsonPropertyName("description_html")] + public string? DescriptionHtml { get; set; } + + /// + /// Plain-text (markdown source) description in the requested language. Mirrors + /// for callers that prefer raw markdown over rendered + /// HTML. Null when no description was found. + /// + [JsonPropertyName("description_text")] + public string? DescriptionText { get; set; } + + /// + /// Language code of the description that was actually returned (the requested language + /// or "eng" if the fallback fired). Null when no description was found. + /// + [JsonPropertyName("description_language_code")] + public string? DescriptionLanguageCode { get; set; } + + [JsonPropertyName("machines")] + [Required] + public List Machines { get; set; } = new(); + + [JsonPropertyName("photos")] + [Required] + public List Photos { get; set; } = new(); + + [JsonPropertyName("videos")] + [Required] + public List Videos { get; set; } = new(); +} diff --git a/Marechai.Database/Migrations/20260508201459_AddSoundSynthPhotosSoundSynthIdIndex.Designer.cs b/Marechai.Database/Migrations/20260508201459_AddSoundSynthPhotosSoundSynthIdIndex.Designer.cs new file mode 100644 index 00000000..4334da5c --- /dev/null +++ b/Marechai.Database/Migrations/20260508201459_AddSoundSynthPhotosSoundSynthIdIndex.Designer.cs @@ -0,0 +1,11063 @@ +// +using System; +using Marechai.Database.Models; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace Marechai.Database.Migrations +{ + [DbContext(typeof(MarechaiContext))] + [Migration("20260508201459_AddSoundSynthPhotosSoundSynthIdIndex")] + partial class AddSoundSynthPhotosSoundSynthIdIndex + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "9.0.11") + .HasAnnotation("Proxies:ChangeTracking", false) + .HasAnnotation("Proxies:CheckEquality", false) + .HasAnnotation("Proxies:LazyLoading", true) + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + + modelBuilder.Entity("Marechai.Database.Models.ApplicationRole", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("longtext"); + + b.Property("Created") + .HasColumnType("datetime(6)"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex"); + + b.ToTable("AspNetRoles", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.ApplicationUser", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AccessFailedCount") + .HasColumnType("int"); + + b.Property("AvatarGuid") + .HasColumnType("char(36)"); + + b.Property("Bio") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("longtext"); + + b.Property("DisplayName") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("EmailConfirmed") + .HasColumnType("bit(1)"); + + b.Property("Facebook") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("GitHub") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("IsSystemAccount") + .HasColumnType("bit(1)"); + + b.Property("LinkedIn") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Location") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("LockoutEnabled") + .HasColumnType("bit(1)"); + + b.Property("LockoutEnd") + .HasColumnType("datetime(6)"); + + b.Property("Mastodon") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("OriginalAvatarExtension") + .HasMaxLength(10) + .HasColumnType("varchar(10)"); + + b.Property("PasswordHash") + .HasColumnType("longtext"); + + b.Property("PhoneNumber") + .HasColumnType("longtext"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("bit(1)"); + + b.Property("PreferredThemeId") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("SecurityStamp") + .HasColumnType("longtext"); + + b.Property("Twitter") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("TwoFactorEnabled") + .HasColumnType("bit(1)"); + + b.Property("TwoFactorViaAuthenticator") + .HasColumnType("bit(1)"); + + b.Property("TwoFactorViaEmail") + .HasColumnType("bit(1)"); + + b.Property("UseGravatar") + .HasColumnType("bit(1)"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Website") + .HasMaxLength(500) + .HasColumnType("varchar(500)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex"); + + b.ToTable("AspNetUsers", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.Audit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AffectedColumns") + .HasColumnType("json"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Keys") + .HasColumnType("json"); + + b.Property("NewValues") + .HasColumnType("json"); + + b.Property("OldValues") + .HasColumnType("json"); + + b.Property("Table") + .HasColumnType("varchar(255)"); + + b.Property("Type") + .HasColumnType("tinyint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("UserId") + .IsRequired() + .HasColumnType("varchar(255)"); + + 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"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CountryId") + .HasColumnType("smallint(3)"); + + b.Property("CoverGuid") + .HasColumnType("char(36)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Edition") + .HasColumnType("int"); + + b.Property("Isbn") + .HasMaxLength(13) + .HasColumnType("varchar(13)"); + + b.Property("NativeTitle") + .HasColumnType("varchar(255)"); + + b.Property("OriginalCoverExtension") + .HasColumnType("longtext"); + + b.Property("Pages") + .HasColumnType("smallint"); + + b.Property("PreviousId") + .HasColumnType("bigint"); + + b.Property("Published") + .HasColumnType("datetime(6)"); + + b.Property("PublishedPrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("SortTitle") + .HasColumnType("longtext"); + + b.Property("SourceId") + .HasColumnType("bigint"); + + b.Property("Title") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + 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("Title"); + + b.ToTable("Books"); + }); + + modelBuilder.Entity("Marechai.Database.Models.BookScan", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Author") + .HasColumnType("varchar(255)"); + + b.Property("BookId") + .HasColumnType("bigint"); + + b.Property("ColorSpace") + .HasColumnType("smallint unsigned"); + + b.Property("Comments") + .HasColumnType("varchar(255)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("ExifVersion") + .HasColumnType("varchar(255)"); + + b.Property("HorizontalResolution") + .HasColumnType("double"); + + b.Property("OriginalExtension") + .HasColumnType("longtext"); + + b.Property("Page") + .HasColumnType("int unsigned"); + + b.Property("ResolutionUnit") + .HasColumnType("smallint unsigned"); + + b.Property("ScannerManufacturer") + .HasColumnType("varchar(255)"); + + b.Property("ScannerModel") + .HasColumnType("varchar(255)"); + + b.Property("SoftwareUsed") + .HasColumnType("varchar(255)"); + + b.Property("Type") + .HasColumnType("int unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("UploadDate") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.Property("VerticalResolution") + .HasColumnType("double"); + + b.HasKey("Id"); + + b.HasIndex("Author"); + + b.HasIndex("BookId"); + + b.HasIndex("ColorSpace"); + + b.HasIndex("Comments"); + + b.HasIndex("CreationDate"); + + b.HasIndex("ExifVersion"); + + b.HasIndex("HorizontalResolution"); + + b.HasIndex("Page"); + + b.HasIndex("ResolutionUnit"); + + b.HasIndex("ScannerManufacturer"); + + b.HasIndex("ScannerModel"); + + b.HasIndex("SoftwareUsed"); + + b.HasIndex("Type"); + + b.HasIndex("UploadDate"); + + b.HasIndex("UserId"); + + b.HasIndex("VerticalResolution"); + + b.ToTable("BookScans"); + }); + + modelBuilder.Entity("Marechai.Database.Models.BookSynopsis", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("BookId") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("LanguageCode") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("char(3)"); + + b.Property("Text") + .IsRequired() + .HasMaxLength(262144) + .HasColumnType("longtext"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("LanguageCode"); + + b.HasIndex("Text") + .HasAnnotation("MySql:FullTextIndex", true); + + b.HasIndex("BookId", "LanguageCode") + .IsUnique() + .HasDatabaseName("idx_book_synopses_book_language"); + + b.ToTable("BookSynopses"); + }); + + modelBuilder.Entity("Marechai.Database.Models.BooksByMachine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("BookId") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("MachineId") + .HasColumnType("int(11)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + 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"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("BookId") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("MachineFamilyId") + .HasColumnType("int(11)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("BookId"); + + b.HasIndex("MachineFamilyId"); + + b.ToTable("BooksByMachineFamilies"); + }); + + modelBuilder.Entity("Marechai.Database.Models.BrowserTest", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Agif") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue((sbyte)0) + .HasColumnName("agif"); + + b.Property("Browser") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("browser") + .HasDefaultValueSql("''"); + + b.Property("Colors") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue((sbyte)0) + .HasColumnName("colors"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Flash") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue((sbyte)0) + .HasColumnName("flash"); + + b.Property("Frames") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue((sbyte)0) + .HasColumnName("frames"); + + b.Property("Gif87") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue((sbyte)0) + .HasColumnName("gif87"); + + b.Property("Gif89") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue((sbyte)0) + .HasColumnName("gif89"); + + b.Property("Jpeg") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue((sbyte)0) + .HasColumnName("jpeg"); + + b.Property("Js") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue((sbyte)0) + .HasColumnName("js"); + + b.Property("Os") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(32) + .HasColumnType("varchar(32)") + .HasColumnName("os") + .HasDefaultValueSql("''"); + + b.Property("Platform") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(8) + .HasColumnType("varchar(8)") + .HasColumnName("platform") + .HasDefaultValueSql("''"); + + b.Property("Png") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue((sbyte)0) + .HasColumnName("png"); + + b.Property("Pngt") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue((sbyte)0) + .HasColumnName("pngt"); + + b.Property("Table") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue((sbyte)0) + .HasColumnName("table"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("UserAgent") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("user_agent") + .HasDefaultValueSql("''"); + + b.Property("Version") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("version") + .HasDefaultValueSql("''"); + + b.HasKey("Id"); + + b.HasIndex("Browser") + .HasDatabaseName("idx_browser_tests_browser"); + + b.HasIndex("Os") + .HasDatabaseName("idx_browser_tests_os"); + + b.HasIndex("Platform") + .HasDatabaseName("idx_browser_tests_platform"); + + b.HasIndex("UserAgent") + .HasDatabaseName("idx_browser_tests_user_agent"); + + b.HasIndex("Version") + .HasDatabaseName("idx_browser_tests_version"); + + b.ToTable("browser_tests", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.CollectedBook", b => + { + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.Property("BookId") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.HasKey("UserId", "BookId"); + + b.HasIndex("BookId"); + + b.ToTable("CollectedBooks"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CollectedDocument", b => + { + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.Property("DocumentId") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.HasKey("UserId", "DocumentId"); + + b.HasIndex("DocumentId"); + + b.ToTable("CollectedDocuments"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CollectedSoftwareRelease", b => + { + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.Property("SoftwareReleaseId") + .HasColumnType("bigint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.HasKey("UserId", "SoftwareReleaseId"); + + b.HasIndex("SoftwareReleaseId"); + + b.ToTable("CollectedSoftwareReleases"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CompaniesByBook", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("BookId") + .HasColumnType("bigint"); + + b.Property("CompanyId") + .HasColumnType("int(11)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("char(3)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + 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"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CompanyId") + .HasColumnType("int(11)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("DocumentId") + .HasColumnType("bigint"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("char(3)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + 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"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CompanyId") + .HasColumnType("int(11)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("MagazineId") + .HasColumnType("bigint"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("char(3)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("CompanyId"); + + b.HasIndex("MagazineId"); + + b.HasIndex("RoleId"); + + b.ToTable("CompaniesByMagazines"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Company", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Address") + .HasMaxLength(80) + .HasColumnType("varchar(80)") + .HasColumnName("address"); + + b.Property("City") + .HasMaxLength(80) + .HasColumnType("varchar(80)") + .HasColumnName("city"); + + b.Property("CountryId") + .HasColumnType("smallint(3)") + .HasColumnName("country"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Facebook") + .HasMaxLength(45) + .HasColumnType("varchar(45)") + .HasColumnName("facebook"); + + b.Property("Founded") + .HasColumnType("datetime") + .HasColumnName("founded"); + + b.Property("FoundedPrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("LegalName") + .HasColumnType("longtext"); + + b.Property("Name") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("varchar(128)") + .HasColumnName("name") + .HasDefaultValueSql("''"); + + b.Property("PostalCode") + .HasMaxLength(25) + .HasColumnType("varchar(25)") + .HasColumnName("postal_code"); + + b.Property("Province") + .HasMaxLength(80) + .HasColumnType("varchar(80)") + .HasColumnName("province"); + + b.Property("Sold") + .HasColumnType("datetime") + .HasColumnName("sold"); + + b.Property("SoldPrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("SoldToId") + .HasColumnType("int(11)") + .HasColumnName("sold_to"); + + b.Property("Status") + .HasColumnType("int(11)") + .HasColumnName("status"); + + b.Property("Twitter") + .HasMaxLength(45) + .HasColumnType("varchar(45)") + .HasColumnName("twitter"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("Website") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("website"); + + b.HasKey("Id"); + + b.HasIndex("Address") + .HasDatabaseName("idx_companies_address"); + + b.HasIndex("City") + .HasDatabaseName("idx_companies_city"); + + b.HasIndex("CountryId") + .HasDatabaseName("idx_companies_country"); + + b.HasIndex("Facebook") + .HasDatabaseName("idx_companies_facebook"); + + b.HasIndex("Founded") + .HasDatabaseName("idx_companies_founded"); + + b.HasIndex("Name") + .HasDatabaseName("idx_companies_name"); + + b.HasIndex("PostalCode") + .HasDatabaseName("idx_companies_postal_code"); + + b.HasIndex("Province") + .HasDatabaseName("idx_companies_province"); + + b.HasIndex("Sold") + .HasDatabaseName("idx_companies_sold"); + + b.HasIndex("SoldToId") + .HasDatabaseName("idx_companies_sold_to"); + + b.HasIndex("Status") + .HasDatabaseName("idx_companies_status"); + + b.HasIndex("Twitter") + .HasDatabaseName("idx_companies_twitter"); + + b.HasIndex("Website") + .HasDatabaseName("idx_companies_website"); + + b.ToTable("companies", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.CompanyBySoftwareFamily", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CompanyId") + .HasColumnType("int(11)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("char(3)"); + + b.Property("SoftwareFamilyId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("CompanyId"); + + b.HasIndex("RoleId"); + + b.HasIndex("SoftwareFamilyId"); + + b.ToTable("CompaniesBySoftwareFamilies"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CompanyBySoftwareVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CompanyId") + .HasColumnType("int(11)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("char(3)"); + + b.Property("SoftwareVersionId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("CompanyId"); + + b.HasIndex("RoleId"); + + b.HasIndex("SoftwareVersionId"); + + b.ToTable("CompaniesBySoftwareVersions"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CompanyDescription", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CompanyId") + .HasColumnType("int(11)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Html") + .HasMaxLength(262144) + .HasColumnType("longtext"); + + b.Property("LanguageCode") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("char(3)"); + + b.Property("Text") + .IsRequired() + .HasMaxLength(262144) + .HasColumnType("longtext"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("LanguageCode"); + + b.HasIndex("Text") + .HasAnnotation("MySql:FullTextIndex", true); + + b.HasIndex("CompanyId", "LanguageCode") + .IsUnique() + .HasDatabaseName("idx_company_descriptions_company_language"); + + b.ToTable("CompanyDescriptions"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CompanyLogo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CompanyId") + .HasColumnType("int(11)") + .HasColumnName("company_id"); + + b.Property("Guid") + .HasColumnType("char(36)") + .HasColumnName("logo_guid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("Year") + .HasColumnType("int(4)") + .HasColumnName("year"); + + b.HasKey("Id", "CompanyId", "Guid"); + + b.HasIndex("CompanyId") + .HasDatabaseName("idx_company_id"); + + b.HasIndex("Guid") + .HasDatabaseName("idx_guid"); + + b.HasIndex("Id") + .IsUnique() + .HasDatabaseName("idx_id"); + + b.ToTable("company_logos", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.Conversation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("IsSystemThread") + .HasColumnType("bit(1)"); + + b.Property("Subject") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("IsSystemThread"); + + b.ToTable("Conversations"); + }); + + modelBuilder.Entity("Marechai.Database.Models.ConversationParticipant", b => + { + b.Property("ConversationId") + .HasColumnType("bigint"); + + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.Property("JoinedOn") + .HasColumnType("datetime(6)"); + + b.Property("LeftOn") + .HasColumnType("datetime(6)"); + + b.HasKey("ConversationId", "UserId"); + + b.HasIndex("UserId"); + + b.ToTable("ConversationParticipants"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CurrencyInflation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("CurrencyCode") + .IsRequired() + .HasColumnType("varchar(3)"); + + b.Property("Inflation") + .HasColumnType("float"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + 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"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("DestinationCode") + .IsRequired() + .HasColumnType("varchar(3)"); + + b.Property("End") + .HasColumnType("datetime(6)"); + + b.Property("Ratio") + .HasColumnType("float"); + + b.Property("SourceCode") + .IsRequired() + .HasColumnType("varchar(3)"); + + b.Property("Start") + .HasColumnType("datetime(6)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + 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"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AccoustId") + .HasColumnType("varchar(255)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Hack") + .HasColumnType("bit(1)"); + + b.Property("HackGroup") + .HasColumnType("varchar(255)"); + + b.Property("Infected") + .HasColumnType("bit(1)"); + + b.Property("Magic") + .HasColumnType("varchar(255)"); + + b.Property("Malware") + .HasColumnType("varchar(255)"); + + b.Property("Md5") + .HasColumnType("binary(16)"); + + b.Property("Mime") + .HasColumnType("varchar(255)"); + + 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)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + 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"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CountryId") + .HasColumnType("smallint(3)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("NativeTitle") + .HasColumnType("varchar(255)"); + + b.Property("Published") + .HasColumnType("datetime(6)"); + + b.Property("PublishedPrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("SortTitle") + .HasColumnType("longtext"); + + b.Property("Title") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("CountryId"); + + b.HasIndex("NativeTitle"); + + b.HasIndex("Published"); + + b.HasIndex("Title"); + + b.ToTable("Documents"); + }); + + 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)"); + + b.HasKey("Id"); + + b.HasIndex("Enabled"); + + b.HasIndex("Name"); + + b.ToTable("DocumentRoles"); + }); + + modelBuilder.Entity("Marechai.Database.Models.DocumentScan", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Author") + .HasColumnType("varchar(255)"); + + b.Property("ColorSpace") + .HasColumnType("smallint unsigned"); + + b.Property("Comments") + .HasColumnType("varchar(255)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("DocumentId") + .HasColumnType("bigint"); + + b.Property("ExifVersion") + .HasColumnType("varchar(255)"); + + b.Property("HorizontalResolution") + .HasColumnType("double"); + + b.Property("OriginalExtension") + .HasColumnType("longtext"); + + b.Property("Page") + .HasColumnType("int unsigned"); + + b.Property("ResolutionUnit") + .HasColumnType("smallint unsigned"); + + b.Property("ScannerManufacturer") + .HasColumnType("varchar(255)"); + + b.Property("ScannerModel") + .HasColumnType("varchar(255)"); + + b.Property("SoftwareUsed") + .HasColumnType("varchar(255)"); + + b.Property("Type") + .HasColumnType("int unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("UploadDate") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.Property("VerticalResolution") + .HasColumnType("double"); + + b.HasKey("Id"); + + b.HasIndex("Author"); + + b.HasIndex("ColorSpace"); + + b.HasIndex("Comments"); + + b.HasIndex("CreationDate"); + + b.HasIndex("DocumentId"); + + b.HasIndex("ExifVersion"); + + b.HasIndex("HorizontalResolution"); + + b.HasIndex("Page"); + + b.HasIndex("ResolutionUnit"); + + b.HasIndex("ScannerManufacturer"); + + b.HasIndex("ScannerModel"); + + b.HasIndex("SoftwareUsed"); + + b.HasIndex("Type"); + + b.HasIndex("UploadDate"); + + b.HasIndex("UserId"); + + b.HasIndex("VerticalResolution"); + + b.ToTable("DocumentScans"); + }); + + modelBuilder.Entity("Marechai.Database.Models.DocumentSynopsis", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("DocumentId") + .HasColumnType("bigint"); + + b.Property("LanguageCode") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("char(3)"); + + b.Property("Text") + .IsRequired() + .HasMaxLength(262144) + .HasColumnType("longtext"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("LanguageCode"); + + b.HasIndex("Text") + .HasAnnotation("MySql:FullTextIndex", true); + + b.HasIndex("DocumentId", "LanguageCode") + .IsUnique() + .HasDatabaseName("idx_document_synopses_document_language"); + + b.ToTable("DocumentSynopses"); + }); + + modelBuilder.Entity("Marechai.Database.Models.DocumentsByMachine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("DocumentId") + .HasColumnType("bigint"); + + b.Property("MachineId") + .HasColumnType("int(11)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + 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"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("DocumentId") + .HasColumnType("bigint"); + + b.Property("MachineFamilyId") + .HasColumnType("int(11)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("MachineFamilyId"); + + b.ToTable("DocumentsByMachineFamily", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.Dump", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("DumpDate") + .HasColumnType("datetime(6)"); + + b.Property("Dumper") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("DumpingGroup") + .HasColumnType("varchar(255)"); + + b.Property("MediaDumpId") + .HasColumnType("bigint unsigned"); + + b.Property("MediaId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("UserId") + .HasColumnType("varchar(255)"); + + 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"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("DumpId") + .HasColumnType("bigint unsigned"); + + b.Property("Extents") + .IsRequired() + .HasColumnType("json"); + + b.Property("Firmware") + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("Manufacturer") + .HasMaxLength(48) + .HasColumnType("varchar(48)"); + + b.Property("Model") + .IsRequired() + .HasMaxLength(48) + .HasColumnType("varchar(48)"); + + b.Property("Revision") + .HasMaxLength(48) + .HasColumnType("varchar(48)"); + + b.Property("Serial") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("SoftwareName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("SoftwareOperatingSystem") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("SoftwareVersion") + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + 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"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("FileId") + .HasColumnType("bigint unsigned"); + + b.Property("Name") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("Size") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + 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"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("FileDataStreamId") + .HasColumnType("bigint unsigned"); + + b.Property("MediaFileId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + 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"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("FileDataStreamId") + .HasColumnType("bigint unsigned"); + + b.Property("StandaloneFileId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + 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"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("FileId") + .HasColumnType("bigint unsigned"); + + b.Property("FilesystemId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + 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"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("ApplicationIdentifier") + .HasColumnType("varchar(255)"); + + 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)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("DataPreparerIdentifier") + .HasColumnType("varchar(255)"); + + 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)"); + + b.Property("ModificationDate") + .HasColumnType("datetime(6)"); + + b.Property("PublisherIdentifier") + .HasColumnType("varchar(255)"); + + b.Property("Serial") + .HasColumnType("varchar(255)"); + + b.Property("SystemIdentifier") + .HasColumnType("varchar(255)"); + + b.Property("Type") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("VolumeSetIdentifier") + .HasColumnType("varchar(255)"); + + 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"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("FilesystemId") + .HasColumnType("bigint unsigned"); + + b.Property("PartitionId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + 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"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("FilesystemId") + .HasColumnType("bigint unsigned"); + + b.Property("MediaDumpFileImageId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("FilesystemId"); + + b.HasIndex("MediaDumpFileImageId"); + + b.ToTable("FilesystemsByMediaDumpFile"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Forbidden", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Browser") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("char(128)") + .HasColumnName("browser") + .HasDefaultValueSql("''"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Date") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("char(20)") + .HasColumnName("date") + .HasDefaultValueSql("''"); + + b.Property("Ip") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("char(16)") + .HasColumnName("ip") + .HasDefaultValueSql("''"); + + b.Property("Referer") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("char(255)") + .HasColumnName("referer") + .HasDefaultValueSql("''"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("Browser") + .HasDatabaseName("idx_forbidden_browser"); + + b.HasIndex("Date") + .HasDatabaseName("idx_forbidden_date"); + + b.HasIndex("Ip") + .HasDatabaseName("idx_forbidden_ip"); + + b.HasIndex("Referer") + .HasDatabaseName("idx_forbidden_referer"); + + b.ToTable("forbidden", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.GenreBySoftware", b => + { + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("GenreId") + .HasColumnType("int"); + + b.HasKey("SoftwareId", "GenreId"); + + b.HasIndex("GenreId"); + + b.ToTable("GenresBySoftware"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Gpu", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CompanyId") + .HasColumnType("int(11)") + .HasColumnName("company"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("DieSize") + .HasColumnType("float") + .HasColumnName("die_size"); + + b.Property("Introduced") + .HasColumnType("datetime") + .HasColumnName("introduced"); + + b.Property("IntroducedPrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("ModelCode") + .HasMaxLength(45) + .HasColumnType("varchar(45)") + .HasColumnName("model_code"); + + b.Property("Name") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(128) + .HasColumnType("char(128)") + .HasColumnName("name") + .HasDefaultValueSql("''"); + + b.Property("Package") + .HasMaxLength(45) + .HasColumnType("varchar(45)") + .HasColumnName("package"); + + b.Property("Process") + .HasMaxLength(45) + .HasColumnType("varchar(45)") + .HasColumnName("process"); + + b.Property("ProcessNm") + .HasColumnType("float") + .HasColumnName("process_nm"); + + b.Property("Transistors") + .HasColumnType("bigint(20)") + .HasColumnName("transistors"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("CompanyId") + .HasDatabaseName("idx_gpus_company"); + + b.HasIndex("DieSize") + .HasDatabaseName("idx_gpus_die_size"); + + b.HasIndex("Introduced") + .HasDatabaseName("idx_gpus_introduced"); + + b.HasIndex("ModelCode") + .HasDatabaseName("idx_gpus_model_code"); + + b.HasIndex("Name") + .HasDatabaseName("idx_gpus_name"); + + b.HasIndex("Package") + .HasDatabaseName("idx_gpus_package"); + + b.HasIndex("Process") + .HasDatabaseName("idx_gpus_process"); + + b.HasIndex("ProcessNm") + .HasDatabaseName("idx_gpus_process_nm"); + + b.HasIndex("Transistors") + .HasDatabaseName("idx_gpus_transistors"); + + b.ToTable("gpus", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.GpuDescription", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("GpuId") + .HasColumnType("int(11)"); + + b.Property("Html") + .HasMaxLength(262144) + .HasColumnType("longtext"); + + b.Property("LanguageCode") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("char(3)") + .UseCollation("utf8mb4_general_ci"); + + b.Property("Text") + .IsRequired() + .HasMaxLength(262144) + .HasColumnType("longtext"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("LanguageCode"); + + b.HasIndex("Text") + .HasAnnotation("MySql:FullTextIndex", true); + + b.HasIndex("GpuId", "LanguageCode") + .IsUnique() + .HasDatabaseName("idx_gpu_descriptions_gpu_language"); + + b.ToTable("GpuDescriptions"); + }); + + modelBuilder.Entity("Marechai.Database.Models.GpuPhoto", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Aperture") + .HasColumnType("double"); + + b.Property("Author") + .HasColumnType("varchar(255)"); + + b.Property("CameraManufacturer") + .HasColumnType("varchar(255)"); + + b.Property("CameraModel") + .HasColumnType("varchar(255)"); + + b.Property("ColorSpace") + .HasColumnType("smallint unsigned"); + + b.Property("Comments") + .HasColumnType("varchar(255)"); + + b.Property("Contrast") + .HasColumnType("smallint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("DigitalZoomRatio") + .HasColumnType("double"); + + b.Property("ExifVersion") + .HasColumnType("varchar(255)"); + + 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("GpuId") + .HasColumnType("int(11)"); + + b.Property("HorizontalResolution") + .HasColumnType("double"); + + b.Property("IsoRating") + .HasColumnType("smallint unsigned"); + + b.Property("Lens") + .HasColumnType("varchar(255)"); + + 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"); + + 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)"); + + b.Property("Source") + .HasColumnType("longtext"); + + b.Property("SubjectDistanceRange") + .HasColumnType("smallint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("UploadDate") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("UserId") + .HasColumnType("varchar(255)"); + + 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("GpuId") + .HasDatabaseName("idx_gpu_photos_gpu"); + + b.HasIndex("HorizontalResolution"); + + b.HasIndex("IsoRating"); + + b.HasIndex("Lens"); + + b.HasIndex("LicenseId"); + + b.HasIndex("LightSource"); + + 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.HasIndex("GpuId", "CreatedOn", "Id") + .HasDatabaseName("idx_gpu_photos_gpu_created"); + + b.ToTable("GpuPhotos"); + }); + + modelBuilder.Entity("Marechai.Database.Models.GpuVideo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("GpuId") + .HasColumnType("int(11)"); + + b.Property("Provider") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("Title") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("VideoId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("GpuId"); + + b.HasIndex("GpuId", "Provider", "VideoId") + .IsUnique(); + + b.ToTable("GpuVideos"); + }); + + modelBuilder.Entity("Marechai.Database.Models.GpusByMachine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint(20)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("GpuId") + .HasColumnType("int(11)") + .HasColumnName("gpu"); + + b.Property("MachineId") + .HasColumnType("int(11)") + .HasColumnName("machine"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("GpuId") + .HasDatabaseName("idx_gpus_by_machine_gpus"); + + b.HasIndex("MachineId") + .HasDatabaseName("idx_gpus_by_machine_machine"); + + b.ToTable("gpus_by_machine", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.InstructionSet", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(45) + .HasColumnType("varchar(45)") + .HasColumnName("instruction_set"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.ToTable("instruction_sets", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.InstructionSetExtension", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Extension") + .IsRequired() + .HasMaxLength(45) + .HasColumnType("varchar(45)") + .HasColumnName("extension"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.ToTable("instruction_set_extensions", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.InstructionSetExtensionsByProcessor", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("ProcessorId") + .HasColumnType("int(11)") + .HasColumnName("processor_id"); + + b.Property("ExtensionId") + .HasColumnType("int(11)") + .HasColumnName("extension_id"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id", "ProcessorId", "ExtensionId"); + + b.HasIndex("ExtensionId") + .HasDatabaseName("idx_setextension_extension"); + + b.HasIndex("ProcessorId") + .HasDatabaseName("idx_setextension_processor"); + + b.ToTable("instruction_set_extensions_by_processor", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.Iso31661Numeric", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("smallint(3)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("name"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("Name") + .HasDatabaseName("idx_name"); + + b.ToTable("iso3166_1_numeric", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.Iso4217", b => + { + b.Property("Code") + .HasMaxLength(3) + .HasColumnType("varchar(3)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("MinorUnits") + .HasColumnType("tinyint unsigned"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("varchar(150)"); + + b.Property("Numeric") + .HasColumnType("smallint(3)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + 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)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Part1") + .HasColumnType("char(2)"); + + b.Property("Part2B") + .HasColumnType("char(3)"); + + b.Property("Part2T") + .HasColumnType("char(3)"); + + b.Property("ReferenceName") + .IsRequired() + .HasColumnType("varchar(150)") + .HasColumnName("Ref_Name"); + + b.Property("Scope") + .IsRequired() + .HasColumnType("char(1)"); + + b.Property("Type") + .IsRequired() + .HasColumnType("char(1)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + 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", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.LanguageBySoftwareRelease", b => + { + b.Property("SoftwareReleaseId") + .HasColumnType("bigint unsigned"); + + b.Property("LanguageCode") + .HasMaxLength(3) + .HasColumnType("char(3)") + .UseCollation("utf8mb4_general_ci"); + + b.HasKey("SoftwareReleaseId", "LanguageCode"); + + b.HasIndex("LanguageCode"); + + b.ToTable("LanguageBySoftwareRelease"); + }); + + modelBuilder.Entity("Marechai.Database.Models.License", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("FsfApproved") + .HasColumnType("bit(1)"); + + b.Property("Link") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("OsiApproved") + .HasColumnType("bit(1)"); + + b.Property("SPDX") + .HasColumnType("varchar(255)"); + + b.Property("Text") + .HasMaxLength(131072) + .HasColumnType("longtext"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + 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() + .HasColumnType("int(11)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Browser") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("char(128)") + .HasColumnName("browser") + .HasDefaultValueSql("''"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Date") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("char(20)") + .HasColumnName("date") + .HasDefaultValueSql("''"); + + b.Property("Ip") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("char(16)") + .HasColumnName("ip") + .HasDefaultValueSql("''"); + + b.Property("Referer") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("char(255)") + .HasColumnName("referer") + .HasDefaultValueSql("''"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("Browser") + .HasDatabaseName("idx_log_browser"); + + b.HasIndex("Date") + .HasDatabaseName("idx_log_date"); + + b.HasIndex("Ip") + .HasDatabaseName("idx_log_ip"); + + b.HasIndex("Referer") + .HasDatabaseName("idx_log_referer"); + + b.ToTable("log", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.LogicalPartition", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Description") + .HasColumnType("varchar(255)"); + + b.Property("FirstSector") + .HasColumnType("bigint unsigned"); + + b.Property("LastSector") + .HasColumnType("bigint unsigned"); + + b.Property("Name") + .HasColumnType("varchar(255)"); + + b.Property("Scheme") + .HasColumnType("varchar(255)"); + + b.Property("Sequence") + .HasColumnType("int unsigned"); + + b.Property("Size") + .HasColumnType("bigint unsigned"); + + b.Property("Type") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + 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"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("MediaId") + .HasColumnType("bigint unsigned"); + + b.Property("PartitionId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("MediaId"); + + b.HasIndex("PartitionId"); + + b.ToTable("LogicalPartitionsByMedia"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Machine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CompanyId") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("company") + .HasDefaultValueSql("'0'"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("FamilyId") + .HasColumnType("int(11)") + .HasColumnName("family"); + + b.Property("Introduced") + .HasColumnType("datetime") + .HasColumnName("introduced"); + + b.Property("IntroducedPrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("Model") + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasColumnName("model"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("name"); + + b.Property("Prototype") + .HasColumnType("bit(1)"); + + b.Property("Type") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasDefaultValue(0) + .HasColumnName("type"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("CompanyId") + .HasDatabaseName("idx_machines_company"); + + b.HasIndex("FamilyId") + .HasDatabaseName("idx_machines_family"); + + b.HasIndex("Introduced") + .HasDatabaseName("idx_machines_introduced"); + + b.HasIndex("Model") + .HasDatabaseName("idx_machines_model"); + + b.HasIndex("Name") + .HasDatabaseName("idx_machines_name"); + + b.HasIndex("Type") + .HasDatabaseName("idx_machines_type"); + + b.ToTable("machines", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.MachineDescription", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Html") + .HasMaxLength(262144) + .HasColumnType("longtext"); + + b.Property("LanguageCode") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("char(3)") + .UseCollation("utf8mb4_general_ci"); + + b.Property("MachineId") + .HasColumnType("int(11)"); + + b.Property("Text") + .IsRequired() + .HasMaxLength(262144) + .HasColumnType("longtext"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("LanguageCode"); + + b.HasIndex("Text") + .HasAnnotation("MySql:FullTextIndex", true); + + b.HasIndex("MachineId", "LanguageCode") + .IsUnique() + .HasDatabaseName("idx_machine_descriptions_machine_language"); + + b.ToTable("MachineDescriptions"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MachineFamily", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CompanyId") + .HasColumnType("int(11)") + .HasColumnName("company"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("name"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("CompanyId") + .HasDatabaseName("idx_machine_families_company"); + + b.HasIndex("Name") + .HasDatabaseName("idx_machine_families_name"); + + b.ToTable("machine_families", (string)null); + }); + + 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)"); + + b.Property("CameraManufacturer") + .HasColumnType("varchar(255)"); + + b.Property("CameraModel") + .HasColumnType("varchar(255)"); + + b.Property("ColorSpace") + .HasColumnType("smallint unsigned"); + + b.Property("Comments") + .HasColumnType("varchar(255)"); + + b.Property("Contrast") + .HasColumnType("smallint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("DigitalZoomRatio") + .HasColumnType("double"); + + b.Property("ExifVersion") + .HasColumnType("varchar(255)"); + + 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)"); + + 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"); + + 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)"); + + b.Property("Source") + .HasColumnType("longtext"); + + b.Property("SubjectDistanceRange") + .HasColumnType("smallint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("UploadDate") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("UserId") + .HasColumnType("varchar(255)"); + + 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") + .HasDatabaseName("idx_machine_photos_machine"); + + 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.HasIndex("MachineId", "CreatedOn", "Id") + .HasDatabaseName("idx_machine_photos_machine_created"); + + b.ToTable("MachinePhotos"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MachineVideo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("MachineId") + .HasColumnType("int(11)"); + + b.Property("Provider") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("Title") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("VideoId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("MachineId"); + + b.HasIndex("MachineId", "Provider", "VideoId") + .IsUnique(); + + b.ToTable("MachineVideos"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Magazine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CountryId") + .HasColumnType("smallint(3)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("FirstPublication") + .HasColumnType("datetime(6)"); + + b.Property("FirstPublicationPrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("Issn") + .HasMaxLength(8) + .HasColumnType("varchar(8)"); + + b.Property("NativeTitle") + .HasColumnType("varchar(255)"); + + b.Property("Published") + .HasColumnType("datetime(6)"); + + b.Property("PublishedPrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("SortTitle") + .HasColumnType("longtext"); + + b.Property("Title") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("CountryId"); + + b.HasIndex("FirstPublication"); + + b.HasIndex("Issn"); + + b.HasIndex("NativeTitle"); + + b.HasIndex("Published"); + + b.HasIndex("Title"); + + b.ToTable("Magazines"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MagazineIssue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Caption") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("IssueNumber") + .HasColumnType("int unsigned"); + + b.Property("MagazineId") + .HasColumnType("bigint"); + + b.Property("NativeCaption") + .HasColumnType("varchar(255)"); + + b.Property("Pages") + .HasColumnType("smallint"); + + b.Property("ProductCode") + .HasMaxLength(18) + .HasColumnType("varchar(18)"); + + b.Property("Published") + .HasColumnType("datetime(6)"); + + b.Property("PublishedPrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + 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.MagazineScan", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Author") + .HasColumnType("varchar(255)"); + + b.Property("ColorSpace") + .HasColumnType("smallint unsigned"); + + b.Property("Comments") + .HasColumnType("varchar(255)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("ExifVersion") + .HasColumnType("varchar(255)"); + + b.Property("HorizontalResolution") + .HasColumnType("double"); + + b.Property("MagazineId") + .HasColumnType("bigint"); + + b.Property("OriginalExtension") + .HasColumnType("longtext"); + + b.Property("Page") + .HasColumnType("int unsigned"); + + b.Property("ResolutionUnit") + .HasColumnType("smallint unsigned"); + + b.Property("ScannerManufacturer") + .HasColumnType("varchar(255)"); + + b.Property("ScannerModel") + .HasColumnType("varchar(255)"); + + b.Property("SoftwareUsed") + .HasColumnType("varchar(255)"); + + b.Property("Type") + .HasColumnType("int unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("UploadDate") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.Property("VerticalResolution") + .HasColumnType("double"); + + b.HasKey("Id"); + + b.HasIndex("Author"); + + b.HasIndex("ColorSpace"); + + b.HasIndex("Comments"); + + b.HasIndex("CreationDate"); + + b.HasIndex("ExifVersion"); + + b.HasIndex("HorizontalResolution"); + + b.HasIndex("MagazineId"); + + b.HasIndex("Page"); + + b.HasIndex("ResolutionUnit"); + + b.HasIndex("ScannerManufacturer"); + + b.HasIndex("ScannerModel"); + + b.HasIndex("SoftwareUsed"); + + b.HasIndex("Type"); + + b.HasIndex("UploadDate"); + + b.HasIndex("UserId"); + + b.HasIndex("VerticalResolution"); + + b.ToTable("MagazineScans"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MagazineSynopsis", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("LanguageCode") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("char(3)"); + + b.Property("MagazineId") + .HasColumnType("bigint"); + + b.Property("Text") + .IsRequired() + .HasMaxLength(262144) + .HasColumnType("longtext"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("LanguageCode"); + + b.HasIndex("Text") + .HasAnnotation("MySql:FullTextIndex", true); + + b.HasIndex("MagazineId", "LanguageCode") + .IsUnique() + .HasDatabaseName("idx_magazine_synopses_magazine_language"); + + b.ToTable("MagazineSynopses"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MagazinesByMachine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("MachineId") + .HasColumnType("int(11)"); + + b.Property("MagazineId") + .HasColumnType("bigint"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + 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"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("MachineFamilyId") + .HasColumnType("int(11)"); + + b.Property("MagazineId") + .HasColumnType("bigint"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("MachineFamilyId"); + + b.HasIndex("MagazineId"); + + b.ToTable("MagazinesByMachinesFamilies"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MarechaiDb", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Updated") + .ValueGeneratedOnAdd() + .HasColumnType("datetime") + .HasColumnName("updated") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .HasColumnType("int(11)") + .HasColumnName("version"); + + b.HasKey("Id"); + + b.ToTable("marechai_db", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.MasteringText", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Layer") + .HasColumnType("smallint"); + + b.Property("MediaId") + .HasColumnType("bigint unsigned"); + + b.Property("Side") + .HasColumnType("smallint"); + + b.Property("Text") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("Type") + .HasColumnType("tinyint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("MediaId"); + + b.HasIndex("Text"); + + b.HasIndex("Type"); + + b.ToTable("MasteringTexts"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Media", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Barcode") + .HasColumnType("varchar(255)"); + + b.Property("BlockSizes") + .HasColumnType("json"); + + b.Property("CatalogueNumber") + .HasColumnType("varchar(255)"); + + b.Property("CopyProtection") + .HasColumnType("varchar(255)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Firmware") + .HasColumnType("varchar(255)"); + + b.Property("LastSequence") + .HasColumnType("smallint unsigned"); + + b.Property("Layers") + .HasColumnType("smallint unsigned"); + + b.Property("LogicalBlockSize") + .HasColumnType("int"); + + b.Property("MagazineIssueId") + .HasColumnType("bigint"); + + b.Property("Manufacturer") + .HasColumnType("varchar(255)"); + + b.Property("Model") + .HasColumnType("varchar(255)"); + + b.Property("PartNumber") + .HasColumnType("varchar(255)"); + + b.Property("PhysicalBlockSize") + .HasColumnType("int"); + + b.Property("Revision") + .HasColumnType("varchar(255)"); + + b.Property("Sectors") + .HasColumnType("bigint unsigned"); + + b.Property("Sequence") + .HasColumnType("smallint unsigned"); + + b.Property("SerialNumber") + .HasColumnType("varchar(255)"); + + 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("TableOfContents") + .HasColumnType("json"); + + b.Property("Title") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("Tracks") + .HasColumnType("smallint unsigned"); + + b.Property("Type") + .HasColumnType("int unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("WriteOffset") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("Barcode"); + + b.HasIndex("CatalogueNumber"); + + b.HasIndex("CopyProtection"); + + b.HasIndex("Firmware"); + + b.HasIndex("MagazineIssueId"); + + 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.MediaDump", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Format") + .HasColumnType("varchar(255)"); + + b.Property("MediaId") + .HasColumnType("bigint unsigned"); + + b.Property("Status") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + 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"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + 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)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + 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"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AccoustId") + .HasColumnType("varchar(255)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + 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)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + 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"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + 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)"); + + b.Property("Status") + .HasColumnType("tinyint unsigned"); + + b.Property("TrackId") + .HasColumnType("bigint unsigned"); + + b.Property("TrackSequence") + .HasColumnType("smallint"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + 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"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Format") + .HasColumnType("varchar(255)"); + + 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)"); + + b.Property("TrackSequence") + .HasColumnType("smallint"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + 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"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + 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)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + 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() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("Path") + .IsRequired() + .HasMaxLength(8192) + .HasColumnType("varchar(8192)"); + + b.Property("PathSeparator") + .IsRequired() + .HasColumnType("varchar(1)"); + + b.Property("PosixMode") + .HasColumnType("smallint unsigned"); + + b.Property("StatusChangeDate") + .HasColumnType("datetime(6)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + 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.MediaTagDump", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("FileId") + .HasColumnType("bigint unsigned"); + + b.Property("MediaDumpId") + .HasColumnType("bigint unsigned"); + + b.Property("Type") + .HasColumnType("int"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("FileId"); + + b.HasIndex("MediaDumpId"); + + b.HasIndex("Type"); + + b.ToTable("MediaTagDumps"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MemoryByMachine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint(20)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("MachineId") + .HasColumnType("int(11)") + .HasColumnName("machine"); + + b.Property("Size") + .HasColumnType("bigint(20)") + .HasColumnName("size"); + + b.Property("Speed") + .HasColumnType("double") + .HasColumnName("speed"); + + b.Property("Type") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasDefaultValue(0) + .HasColumnName("type"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("Usage") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasDefaultValue(0) + .HasColumnName("usage"); + + b.HasKey("Id"); + + b.HasIndex("MachineId") + .HasDatabaseName("idx_memory_by_machine_machine"); + + b.HasIndex("Size") + .HasDatabaseName("idx_memory_by_machine_size"); + + b.HasIndex("Speed") + .HasDatabaseName("idx_memory_by_machine_speed"); + + b.HasIndex("Type") + .HasDatabaseName("idx_memory_by_machine_type"); + + b.HasIndex("Usage") + .HasDatabaseName("idx_memory_by_machine_usage"); + + b.ToTable("memory_by_machine", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.Message", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Body") + .IsRequired() + .HasMaxLength(5000) + .HasColumnType("varchar(5000)"); + + b.Property("ConversationId") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("IsSystemAuthored") + .HasColumnType("bit(1)"); + + b.Property("ParentMessageId") + .HasColumnType("bigint"); + + b.Property("SenderId") + .HasColumnType("varchar(255)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("ParentMessageId"); + + b.HasIndex("SenderId"); + + b.HasIndex("ConversationId", "CreatedOn"); + + b.ToTable("Messages"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MessageReport", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Explanation") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.Property("IsResolved") + .HasColumnType("bit(1)"); + + b.Property("MessageId") + .HasColumnType("bigint"); + + b.Property("Reason") + .HasColumnType("int"); + + b.Property("ReporterId") + .HasColumnType("varchar(255)"); + + b.Property("ResolvedByUserId") + .HasColumnType("varchar(255)"); + + b.Property("ResolvedOn") + .HasColumnType("datetime(6)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("IsResolved"); + + b.HasIndex("MessageId"); + + b.HasIndex("ReporterId"); + + b.HasIndex("ResolvedByUserId"); + + b.ToTable("MessageReports"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MessageState", b => + { + b.Property("MessageId") + .HasColumnType("bigint"); + + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.Property("DeletedAt") + .HasColumnType("datetime(6)"); + + b.Property("IsRead") + .HasColumnType("bit(1)"); + + b.Property("ReadAt") + .HasColumnType("datetime(6)"); + + b.HasKey("MessageId", "UserId"); + + b.HasIndex("UserId", "IsRead", "DeletedAt"); + + b.ToTable("MessageStates"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MinimumGpuBySoftwareRelease", b => + { + b.Property("ReleaseId") + .HasColumnType("bigint unsigned"); + + b.Property("GpuId") + .HasColumnType("int(11)"); + + b.HasKey("ReleaseId", "GpuId"); + + b.HasIndex("GpuId"); + + b.ToTable("MinimumGpuBySoftwareRelease"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MobyGamesCoverDownloadState", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Countries") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("CoverPageUrl") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("CoverType") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("ErrorMessage") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("GroupId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("MobyGameId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("OriginalUrl") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("Platform") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ProcessedOn") + .HasColumnType("datetime(6)"); + + b.Property("SoftwareCoverId") + .HasColumnType("char(36)"); + + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("SoftwareReleaseId") + .HasColumnType("bigint unsigned"); + + b.Property("Status") + .HasColumnType("tinyint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.ToTable("MobyGamesCoverDownloadStates"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MobyGamesImportState", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("BatchNumber") + .HasColumnType("int"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("ErrorMessage") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("MobyGameId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("MobyNumericId") + .HasColumnType("int"); + + b.Property("ProcessedOn") + .HasColumnType("datetime(6)"); + + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("Status") + .HasColumnType("tinyint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("MobyGameId") + .IsUnique(); + + b.HasIndex("Status"); + + b.ToTable("MobyGamesImportStates"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MobyGamesPromoArtDownloadState", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Caption") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("ErrorMessage") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("GroupName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("MobyGameId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("OriginalUrl") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("ProcessedOn") + .HasColumnType("datetime(6)"); + + b.Property("PromoPageUrl") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("SoftwarePromoArtId") + .HasColumnType("char(36)"); + + b.Property("Status") + .HasColumnType("tinyint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("MobyGameId"); + + b.HasIndex("PromoPageUrl") + .IsUnique(); + + b.HasIndex("Status"); + + b.ToTable("MobyGamesPromoArtDownloadStates"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MobyGamesRejection", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("GameName") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("MobyGameId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Reason") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("RejectedOn") + .HasColumnType("datetime(6)"); + + b.Property("ReviewAction") + .HasColumnType("tinyint unsigned"); + + b.Property("ReviewedOn") + .HasColumnType("datetime(6)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("MobyGameId"); + + b.HasIndex("ReviewAction"); + + b.ToTable("MobyGamesRejections"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MobyGamesReviewImportState", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("ErrorMessage") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("MobyGameId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProcessedOn") + .HasColumnType("datetime(6)"); + + b.Property("ReviewsImported") + .HasColumnType("int"); + + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("Status") + .HasColumnType("tinyint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("MobyGameId") + .IsUnique(); + + b.HasIndex("Status"); + + b.ToTable("MobyGamesReviewImportStates"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MobyGamesScreenshotDownloadState", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Caption") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("ErrorMessage") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("MobyGameId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("OriginalUrl") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("Platform") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ProcessedOn") + .HasColumnType("datetime(6)"); + + b.Property("ScreenshotPageUrl") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("SoftwareScreenshotId") + .HasColumnType("char(36)"); + + b.Property("Status") + .HasColumnType("tinyint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("MobyGameId"); + + b.HasIndex("ScreenshotPageUrl") + .IsUnique(); + + b.HasIndex("Status"); + + b.ToTable("MobyGamesScreenshotDownloadStates"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MobyGamesVideoImportState", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("ErrorMessage") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("ExtractedVideoId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("MobyGameId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProcessedOn") + .HasColumnType("datetime(6)"); + + b.Property("Provider") + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("SoftwareVideoId") + .HasColumnType("bigint"); + + b.Property("Status") + .HasColumnType("tinyint unsigned"); + + b.Property("Title") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("VideoUrl") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.HasKey("Id"); + + b.HasIndex("MobyGameId"); + + b.HasIndex("SoftwareId"); + + b.HasIndex("Status"); + + b.HasIndex("VideoUrl"); + + b.ToTable("MobyGamesVideoImportStates"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MoneyDonation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Donator") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("char(128)") + .HasColumnName("donator") + .HasDefaultValueSql("''"); + + b.Property("Quantity") + .ValueGeneratedOnAdd() + .HasColumnType("decimal(11,2)") + .HasColumnName("quantity") + .HasDefaultValueSql("'0.00'"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("Donator") + .HasDatabaseName("idx_money_donations_donator"); + + b.HasIndex("Quantity") + .HasDatabaseName("idx_money_donations_quantity"); + + b.ToTable("money_donations", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.News", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AddedId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint(20)") + .HasColumnName("added_id") + .HasDefaultValueSql("'0'"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Date") + .HasColumnType("datetime") + .HasColumnName("date"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Type") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasDefaultValue(1) + .HasColumnName("type"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("AddedId") + .HasDatabaseName("idx_news_ip"); + + b.HasIndex("Date") + .HasDatabaseName("idx_news_date"); + + b.HasIndex("Type") + .HasDatabaseName("idx_news_type"); + + b.ToTable("news", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.OwnedMachine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AcquisitionDate") + .HasColumnType("datetime(6)"); + + b.Property("AcquisitionDatePrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("Boxed") + .HasColumnType("bit(1)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("LastStatusDate") + .HasColumnType("datetime(6)"); + + b.Property("LastStatusDatePrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("LostDate") + .HasColumnType("datetime(6)"); + + b.Property("LostDatePrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("MachineId") + .HasColumnType("int(11)"); + + b.Property("Manuals") + .HasColumnType("bit(1)"); + + b.Property("SerialNumber") + .HasColumnType("varchar(255)"); + + 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)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("UserId") + .HasColumnType("varchar(255)"); + + 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.PeopleByBook", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("BookId") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("PersonId") + .HasColumnType("int"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("char(3)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + 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"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CompanyId") + .HasColumnType("int(11)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("End") + .HasColumnType("datetime(6)"); + + b.Property("EndPrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("Ongoing") + .HasColumnType("bit(1)"); + + b.Property("PersonId") + .HasColumnType("int"); + + b.Property("Position") + .HasColumnType("varchar(255)"); + + b.Property("Start") + .HasColumnType("datetime(6)"); + + b.Property("StartPrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("CompanyId"); + + b.HasIndex("End"); + + b.HasIndex("PersonId"); + + b.HasIndex("Position"); + + b.HasIndex("Start"); + + b.ToTable("PeopleByCompany", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.PeopleByDocument", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("DocumentId") + .HasColumnType("bigint"); + + b.Property("PersonId") + .HasColumnType("int"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("char(3)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + 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"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("MagazineId") + .HasColumnType("bigint"); + + b.Property("PersonId") + .HasColumnType("int"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("char(3)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("MagazineId"); + + b.HasIndex("PersonId"); + + b.HasIndex("RoleId"); + + b.ToTable("PeopleByMagazines"); + }); + + modelBuilder.Entity("Marechai.Database.Models.PeopleBySoftware", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("PersonId") + .HasColumnType("int"); + + b.Property("Role") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("RoleId") + .HasColumnType("char(3)"); + + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("PersonId"); + + b.HasIndex("RoleId"); + + b.HasIndex("SoftwareId", "PersonId", "Role") + .IsUnique(); + + b.ToTable("PeopleBySoftware"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Person", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Alias") + .HasColumnType("varchar(255)"); + + b.Property("BirthDate") + .HasColumnType("datetime(6)"); + + b.Property("BirthDatePrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("CountryOfBirthId") + .HasColumnType("smallint(3)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("DeathDate") + .HasColumnType("datetime(6)"); + + b.Property("DeathDatePrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("DisplayName") + .HasColumnType("varchar(255)"); + + b.Property("Facebook") + .HasColumnType("varchar(255)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("Photo") + .HasColumnType("char(36)"); + + b.Property("Surname") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("Twitter") + .HasColumnType("varchar(255)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("Webpage") + .HasColumnType("varchar(255)"); + + 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() + .HasColumnType("int(11)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AddrBus") + .HasColumnType("int(11)") + .HasColumnName("addr_bus"); + + b.Property("CompanyId") + .HasColumnType("int(11)") + .HasColumnName("company"); + + b.Property("Cores") + .HasColumnType("int(11)") + .HasColumnName("cores"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("DataBus") + .HasColumnType("int(11)") + .HasColumnName("data_bus"); + + b.Property("DieSize") + .HasColumnType("float") + .HasColumnName("die_size"); + + b.Property("FprSize") + .HasColumnType("int(11)") + .HasColumnName("FPR_size"); + + b.Property("Fprs") + .HasColumnType("int(11)") + .HasColumnName("FPRs"); + + b.Property("GprSize") + .HasColumnType("int(11)") + .HasColumnName("GPR_size"); + + b.Property("Gprs") + .HasColumnType("int(11)") + .HasColumnName("GPRs"); + + b.Property("InstructionSetId") + .HasColumnType("int(11)") + .HasColumnName("instruction_set"); + + b.Property("Introduced") + .HasColumnType("datetime") + .HasColumnName("introduced"); + + b.Property("IntroducedPrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("L1Data") + .HasColumnType("float") + .HasColumnName("L1_data"); + + b.Property("L1Instruction") + .HasColumnType("float") + .HasColumnName("L1_instruction"); + + b.Property("L2") + .HasColumnType("float"); + + b.Property("L3") + .HasColumnType("float"); + + b.Property("ModelCode") + .HasMaxLength(45) + .HasColumnType("varchar(45)") + .HasColumnName("model_code"); + + b.Property("Name") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("char(50)") + .HasColumnName("name") + .HasDefaultValueSql("''"); + + b.Property("Package") + .HasMaxLength(45) + .HasColumnType("varchar(45)") + .HasColumnName("package"); + + b.Property("Process") + .HasMaxLength(45) + .HasColumnType("varchar(45)") + .HasColumnName("process"); + + b.Property("ProcessNm") + .HasColumnType("float") + .HasColumnName("process_nm"); + + b.Property("SimdRegisters") + .HasColumnType("int(11)") + .HasColumnName("SIMD_registers"); + + b.Property("SimdSize") + .HasColumnType("int(11)") + .HasColumnName("SIMD_size"); + + b.Property("Speed") + .HasColumnType("double") + .HasColumnName("speed"); + + b.Property("ThreadsPerCore") + .HasColumnType("int(11)") + .HasColumnName("threads_per_core"); + + b.Property("Transistors") + .HasColumnType("bigint(20)") + .HasColumnName("transistors"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("AddrBus") + .HasDatabaseName("idx_processors_addr_bus"); + + b.HasIndex("CompanyId") + .HasDatabaseName("idx_processors_company"); + + b.HasIndex("Cores") + .HasDatabaseName("idx_processors_cores"); + + b.HasIndex("DataBus") + .HasDatabaseName("idx_processors_data_bus"); + + b.HasIndex("DieSize") + .HasDatabaseName("idx_processors_die_size"); + + b.HasIndex("FprSize") + .HasDatabaseName("idx_processors_FPR_size"); + + b.HasIndex("Fprs") + .HasDatabaseName("idx_processors_FPRs"); + + b.HasIndex("GprSize") + .HasDatabaseName("idx_processors_GPR_size"); + + b.HasIndex("Gprs") + .HasDatabaseName("idx_processors_GPRs"); + + b.HasIndex("InstructionSetId") + .HasDatabaseName("idx_processors_instruction_set"); + + b.HasIndex("Introduced") + .HasDatabaseName("idx_processors_introduced"); + + b.HasIndex("L1Data") + .HasDatabaseName("idx_processors_L1_data"); + + b.HasIndex("L1Instruction") + .HasDatabaseName("idx_processors_L1_instruction"); + + b.HasIndex("L2") + .HasDatabaseName("idx_processors_L2"); + + b.HasIndex("L3") + .HasDatabaseName("idx_processors_L3"); + + b.HasIndex("ModelCode") + .HasDatabaseName("idx_processors_model_code"); + + b.HasIndex("Name") + .HasDatabaseName("idx_processors_name"); + + b.HasIndex("Package") + .HasDatabaseName("idx_processors_package"); + + b.HasIndex("Process") + .HasDatabaseName("idx_processors_process"); + + b.HasIndex("ProcessNm") + .HasDatabaseName("idx_processors_process_nm"); + + b.HasIndex("SimdRegisters") + .HasDatabaseName("idx_processors_SIMD_registers"); + + b.HasIndex("SimdSize") + .HasDatabaseName("idx_processors_SIMD_size"); + + b.HasIndex("Speed") + .HasDatabaseName("idx_processors_speed"); + + b.HasIndex("ThreadsPerCore") + .HasDatabaseName("idx_processors_threads_per_core"); + + b.HasIndex("Transistors") + .HasDatabaseName("idx_processors_transistors"); + + b.ToTable("processors", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.ProcessorDescription", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Html") + .HasMaxLength(262144) + .HasColumnType("longtext"); + + b.Property("LanguageCode") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("char(3)") + .UseCollation("utf8mb4_general_ci"); + + b.Property("ProcessorId") + .HasColumnType("int(11)"); + + b.Property("Text") + .IsRequired() + .HasMaxLength(262144) + .HasColumnType("longtext"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("LanguageCode"); + + b.HasIndex("Text") + .HasAnnotation("MySql:FullTextIndex", true); + + b.HasIndex("ProcessorId", "LanguageCode") + .IsUnique() + .HasDatabaseName("idx_processor_descriptions_processor_language"); + + b.ToTable("ProcessorDescriptions"); + }); + + modelBuilder.Entity("Marechai.Database.Models.ProcessorPhoto", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Aperture") + .HasColumnType("double"); + + b.Property("Author") + .HasColumnType("varchar(255)"); + + b.Property("CameraManufacturer") + .HasColumnType("varchar(255)"); + + b.Property("CameraModel") + .HasColumnType("varchar(255)"); + + b.Property("ColorSpace") + .HasColumnType("smallint unsigned"); + + b.Property("Comments") + .HasColumnType("varchar(255)"); + + b.Property("Contrast") + .HasColumnType("smallint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("DigitalZoomRatio") + .HasColumnType("double"); + + b.Property("ExifVersion") + .HasColumnType("varchar(255)"); + + 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)"); + + 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"); + + b.Property("ProcessorId") + .HasColumnType("int(11)"); + + 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)"); + + b.Property("Source") + .HasColumnType("longtext"); + + b.Property("SubjectDistanceRange") + .HasColumnType("smallint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("UploadDate") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("UserId") + .HasColumnType("varchar(255)"); + + 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("ProcessorId") + .HasDatabaseName("idx_processor_photos_processor"); + + 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.HasIndex("ProcessorId", "CreatedOn", "Id") + .HasDatabaseName("idx_processor_photos_processor_created"); + + b.ToTable("ProcessorPhotos"); + }); + + modelBuilder.Entity("Marechai.Database.Models.ProcessorVideo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("ProcessorId") + .HasColumnType("int(11)"); + + b.Property("Provider") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("Title") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("VideoId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("ProcessorId"); + + b.HasIndex("ProcessorId", "Provider", "VideoId") + .IsUnique(); + + b.ToTable("ProcessorVideos"); + }); + + modelBuilder.Entity("Marechai.Database.Models.ProcessorsByMachine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint(20)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("MachineId") + .HasColumnType("int(11)") + .HasColumnName("machine"); + + b.Property("ProcessorId") + .HasColumnType("int(11)") + .HasColumnName("processor"); + + b.Property("Speed") + .HasColumnType("float") + .HasColumnName("speed"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("MachineId") + .HasDatabaseName("idx_processors_by_machine_machine"); + + b.HasIndex("ProcessorId") + .HasDatabaseName("idx_processors_by_machine_processor"); + + b.HasIndex("Speed") + .HasDatabaseName("idx_processors_by_machine_speed"); + + b.ToTable("processors_by_machine", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.RecommendedGpuBySoftwareRelease", b => + { + b.Property("ReleaseId") + .HasColumnType("bigint unsigned"); + + b.Property("GpuId") + .HasColumnType("int(11)"); + + b.HasKey("ReleaseId", "GpuId"); + + b.HasIndex("GpuId"); + + b.ToTable("RecommendedGpuBySoftwareRelease"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Resolution", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Chars") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue((sbyte)0) + .HasColumnName("chars"); + + b.Property("Colors") + .HasColumnType("bigint(20)") + .HasColumnName("colors"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Grayscale") + .HasColumnType("bit(1)"); + + b.Property("Height") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("height") + .HasDefaultValueSql("'0'"); + + b.Property("Palette") + .HasColumnType("bigint(20)") + .HasColumnName("palette"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("Width") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("width") + .HasDefaultValueSql("'0'"); + + b.HasKey("Id"); + + b.HasIndex("Colors") + .HasDatabaseName("idx_resolutions_colors"); + + b.HasIndex("Height") + .HasDatabaseName("idx_resolutions_height"); + + b.HasIndex("Palette") + .HasDatabaseName("idx_resolutions_palette"); + + b.HasIndex("Width") + .HasDatabaseName("idx_resolutions_width"); + + b.HasIndex("Width", "Height") + .HasDatabaseName("idx_resolutions_resolution"); + + b.HasIndex("Width", "Height", "Colors") + .HasDatabaseName("idx_resolutions_resolution_with_color"); + + b.HasIndex("Width", "Height", "Colors", "Palette") + .HasDatabaseName("idx_resolutions_resolution_with_color_and_palette"); + + b.ToTable("resolutions", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.ResolutionsByGpu", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint(20)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("GpuId") + .HasColumnType("int(11)") + .HasColumnName("gpu"); + + b.Property("ResolutionId") + .HasColumnType("int(11)") + .HasColumnName("resolution"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("GpuId") + .HasDatabaseName("idx_resolutions_by_gpu_gpu"); + + b.HasIndex("ResolutionId") + .HasDatabaseName("idx_resolutions_by_gpu_resolution"); + + b.ToTable("resolutions_by_gpu", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.ResolutionsByScreen", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("ResolutionId") + .HasColumnType("int(11)"); + + b.Property("ScreenId") + .HasColumnType("int"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("ResolutionId"); + + b.HasIndex("ScreenId"); + + b.ToTable("ResolutionsByScreen"); + }); + + modelBuilder.Entity("Marechai.Database.Models.ReviewReport", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Explanation") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.Property("IsResolved") + .HasColumnType("bit(1)"); + + b.Property("Reason") + .HasColumnType("int"); + + b.Property("ReporterId") + .HasColumnType("varchar(255)"); + + b.Property("ResolvedByUserId") + .HasColumnType("varchar(255)"); + + b.Property("ResolvedOn") + .HasColumnType("datetime(6)"); + + b.Property("ReviewId") + .HasColumnType("bigint"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("IsResolved"); + + b.HasIndex("ResolvedByUserId"); + + b.HasIndex("ReviewId"); + + b.HasIndex("ReporterId", "ReviewId") + .IsUnique(); + + b.ToTable("ReviewReports"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Screen", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + 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)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + 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"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("MachineId") + .HasColumnType("int(11)"); + + b.Property("ScreenId") + .HasColumnType("int"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("MachineId"); + + b.HasIndex("ScreenId"); + + b.ToTable("ScreensByMachine"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Software", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("BaseSoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("FamilyId") + .HasColumnType("bigint unsigned"); + + b.Property("Kind") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("PredecessorId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("BaseSoftwareId"); + + b.HasIndex("FamilyId"); + + b.HasIndex("Name"); + + b.HasIndex("PredecessorId"); + + b.ToTable("Softwares"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareAttribute", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Category") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Key") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("SoftwareReleaseId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("Value") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.HasKey("Id"); + + b.HasIndex("SoftwareReleaseId", "Category", "Key"); + + b.ToTable("SoftwareAttributes"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareBarcode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Code") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("ReleaseId") + .HasColumnType("bigint unsigned"); + + b.Property("Type") + .HasColumnType("tinyint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("Code") + .IsUnique(); + + b.HasIndex("ReleaseId"); + + b.ToTable("SoftwareBarcodes"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareBySoftwareRelease", b => + { + b.Property("ReleaseId") + .HasColumnType("bigint unsigned"); + + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.HasKey("ReleaseId", "SoftwareId"); + + b.HasIndex("SoftwareId"); + + b.ToTable("SoftwareBySoftwareRelease"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareCompanyRole", b => + { + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("CompanyId") + .HasColumnType("int(11)"); + + b.Property("RoleId") + .HasColumnType("char(3)"); + + b.HasKey("SoftwareId", "CompanyId", "RoleId"); + + b.HasIndex("CompanyId"); + + b.HasIndex("RoleId"); + + b.ToTable("SoftwareCompanyRoles"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareCover", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Caption") + .HasColumnType("longtext"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("OriginalExtension") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("SoftwareReleaseId") + .HasColumnType("bigint unsigned"); + + b.Property("Type") + .HasColumnType("tinyint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("SoftwareReleaseId"); + + b.ToTable("SoftwareCovers"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareCriticReview", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("MagazineId") + .HasColumnType("bigint"); + + b.Property("NormalizedScore") + .HasColumnType("int"); + + b.Property("OriginalScore") + .HasColumnType("float"); + + b.Property("OriginalScoreMaximum") + .HasColumnType("float"); + + b.Property("PlatformId") + .HasColumnType("bigint unsigned"); + + b.Property("ReviewDate") + .HasColumnType("datetime(6)"); + + b.Property("ReviewDatePrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("ReviewText") + .HasColumnType("longtext"); + + b.Property("ReviewUrl") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("MagazineId"); + + b.HasIndex("PlatformId"); + + b.HasIndex("SoftwareId"); + + b.HasIndex("SoftwareId", "MagazineId", "PlatformId") + .IsUnique(); + + b.ToTable("SoftwareCriticReviews"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareDescription", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Html") + .HasMaxLength(262144) + .HasColumnType("longtext"); + + b.Property("LanguageCode") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("char(3)") + .UseCollation("utf8mb4_general_ci"); + + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("Text") + .IsRequired() + .HasMaxLength(262144) + .HasColumnType("longtext"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("LanguageCode"); + + b.HasIndex("Text") + .HasAnnotation("MySql:FullTextIndex", true); + + b.HasIndex("SoftwareId", "LanguageCode") + .IsUnique() + .HasDatabaseName("idx_software_descriptions_software_language"); + + b.ToTable("SoftwareDescriptions"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareFamily", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Introduced") + .HasColumnType("datetime(6)"); + + b.Property("IntroducedPrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("ParentId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("Introduced"); + + b.HasIndex("Name"); + + b.HasIndex("ParentId"); + + b.ToTable("SoftwareFamilies"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareGenre", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Type") + .HasColumnType("tinyint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("Name", "Type") + .IsUnique(); + + b.ToTable("SoftwareGenres"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareOSCompatibility", b => + { + b.Property("SoftwareVersionId") + .HasColumnType("bigint unsigned"); + + b.Property("OSVersionId") + .HasColumnType("bigint unsigned"); + + b.HasKey("SoftwareVersionId", "OSVersionId"); + + b.HasIndex("OSVersionId"); + + b.ToTable("SoftwareOSCompatibility"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwarePlatform", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("SoftwarePlatforms"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwarePlatformsByMachine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint(20)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("MachineId") + .HasColumnType("int(11)") + .HasColumnName("machine"); + + b.Property("SoftwarePlatformId") + .HasColumnType("bigint(20) unsigned") + .HasColumnName("software_platform"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("MachineId") + .HasDatabaseName("idx_software_platforms_by_machine_machine"); + + b.HasIndex("SoftwarePlatformId") + .HasDatabaseName("idx_software_platforms_by_machine_software_platform"); + + b.ToTable("software_platforms_by_machine", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareProductCode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Code") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Issuer") + .HasColumnType("tinyint unsigned"); + + b.Property("ReleaseId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("ReleaseId"); + + b.HasIndex("Issuer", "Code") + .IsUnique(); + + b.ToTable("SoftwareProductCodes"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwarePromoArt", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Caption") + .HasColumnType("longtext"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("GroupId") + .HasColumnType("int"); + + b.Property("OriginalExtension") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("GroupId"); + + b.HasIndex("SoftwareId"); + + b.ToTable("SoftwarePromoArt"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwarePromoArtGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("SoftwarePromoArtGroups"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareRelease", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("IsCompilation") + .HasColumnType("bit(1)"); + + b.Property("PlatformId") + .HasColumnType("bigint unsigned"); + + b.Property("PublisherId") + .HasColumnType("int(11)"); + + b.Property("ReleaseDate") + .HasColumnType("datetime(6)"); + + b.Property("ReleaseDatePrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("SoftwareVersionId") + .HasColumnType("bigint unsigned"); + + b.Property("Title") + .HasColumnType("longtext"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("PlatformId"); + + b.HasIndex("PublisherId"); + + b.HasIndex("SoftwareId"); + + b.HasIndex("SoftwareVersionId", "PlatformId"); + + b.ToTable("SoftwareReleases"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareRequirement", b => + { + b.Property("SoftwareVersionId") + .HasColumnType("bigint unsigned"); + + b.Property("RequiredSoftwareVersionId") + .HasColumnType("bigint unsigned"); + + b.Property("RequirementType") + .HasColumnType("tinyint unsigned"); + + b.HasKey("SoftwareVersionId", "RequiredSoftwareVersionId", "RequirementType"); + + b.HasIndex("RequiredSoftwareVersionId"); + + b.ToTable("SoftwareRequirements"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareRole", b => + { + b.Property("Id") + .HasColumnType("char(3)"); + + b.Property("Enabled") + .ValueGeneratedOnAdd() + .HasColumnType("bit(1)") + .HasDefaultValue(true); + + b.Property("Name") + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("Enabled"); + + b.HasIndex("Name"); + + b.ToTable("SoftwareRoles"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareScreenshot", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Caption") + .HasColumnType("longtext"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("OriginalExtension") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("SoftwarePlatformId") + .HasColumnType("bigint unsigned"); + + b.Property("SoftwareVersionId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("SoftwareId"); + + b.HasIndex("SoftwarePlatformId"); + + b.HasIndex("SoftwareVersionId"); + + b.ToTable("SoftwareScreenshots"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareUserRating", b => + { + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Rating") + .HasColumnType("float"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("UserId", "SoftwareId"); + + b.HasIndex("SoftwareId"); + + b.ToTable("SoftwareUserRatings"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareUserReview", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("IsAnonymous") + .HasColumnType("bit(1)"); + + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("TheBad") + .HasColumnType("text"); + + b.Property("TheGood") + .HasColumnType("text"); + + b.Property("TheUgly") + .HasColumnType("text"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("SoftwareId"); + + b.HasIndex("UserId"); + + b.HasIndex("UserId", "SoftwareId") + .IsUnique(); + + b.ToTable("SoftwareUserReviews"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareUserReviewVote", b => + { + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.Property("ReviewId") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("IsUpvote") + .HasColumnType("bit(1)"); + + b.HasKey("UserId", "ReviewId"); + + b.HasIndex("ReviewId"); + + b.ToTable("SoftwareUserReviewVotes"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Codename") + .HasColumnType("longtext"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("LicenseId") + .HasColumnType("int"); + + b.Property("ParentVersionId") + .HasColumnType("bigint unsigned"); + + b.Property("PublicVersion") + .HasColumnType("longtext"); + + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("VersionString") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("LicenseId"); + + b.HasIndex("ParentVersionId"); + + b.HasIndex("SoftwareId"); + + b.HasIndex("VersionString"); + + b.ToTable("SoftwareVersions"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareVersionBySoftwareRelease", b => + { + b.Property("ReleaseId") + .HasColumnType("bigint unsigned"); + + b.Property("SoftwareVersionId") + .HasColumnType("bigint unsigned"); + + b.HasKey("ReleaseId", "SoftwareVersionId"); + + b.HasIndex("SoftwareVersionId"); + + b.ToTable("SoftwareVersionBySoftwareRelease"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareVideo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Provider") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("Title") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("VideoId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("SoftwareId"); + + b.HasIndex("SoftwareId", "Provider", "VideoId") + .IsUnique(); + + b.ToTable("SoftwareVideos"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoundByMachine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint(20)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("MachineId") + .HasColumnType("int(11)") + .HasColumnName("machine"); + + b.Property("SoundSynthId") + .HasColumnType("int(11)") + .HasColumnName("sound_synth"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("MachineId") + .HasDatabaseName("idx_sound_by_machine_machine"); + + b.HasIndex("SoundSynthId") + .HasDatabaseName("idx_sound_by_machine_sound_synth"); + + b.ToTable("sound_by_machine", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoundSynth", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CompanyId") + .HasColumnType("int(11)") + .HasColumnName("company"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Depth") + .HasColumnType("int(11)") + .HasColumnName("depth"); + + b.Property("Frequency") + .HasColumnType("double") + .HasColumnName("frequency"); + + b.Property("Introduced") + .HasColumnType("datetime") + .HasColumnName("introduced"); + + b.Property("IntroducedPrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("ModelCode") + .HasMaxLength(45) + .HasColumnType("varchar(45)") + .HasColumnName("model_code"); + + b.Property("Name") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("char(50)") + .HasColumnName("name") + .HasDefaultValueSql("''"); + + b.Property("SquareWave") + .HasColumnType("int(11)") + .HasColumnName("square_wave"); + + b.Property("Type") + .HasColumnType("int(11)") + .HasColumnName("type"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("Voices") + .HasColumnType("int(11)") + .HasColumnName("voices"); + + b.Property("WhiteNoise") + .HasColumnType("int(11)") + .HasColumnName("white_noise"); + + b.HasKey("Id"); + + b.HasIndex("CompanyId") + .HasDatabaseName("idx_sound_synths_company"); + + b.HasIndex("Depth") + .HasDatabaseName("idx_sound_synths_depth"); + + b.HasIndex("Frequency") + .HasDatabaseName("idx_sound_synths_frequency"); + + b.HasIndex("Introduced") + .HasDatabaseName("idx_sound_synths_introduced"); + + b.HasIndex("ModelCode") + .HasDatabaseName("idx_sound_synths_model_code"); + + b.HasIndex("Name") + .HasDatabaseName("idx_sound_synths_name"); + + b.HasIndex("SquareWave") + .HasDatabaseName("idx_sound_synths_square_wave"); + + b.HasIndex("Type") + .HasDatabaseName("idx_sound_synths_type"); + + b.HasIndex("Voices") + .HasDatabaseName("idx_sound_synths_voices"); + + b.HasIndex("WhiteNoise") + .HasDatabaseName("idx_sound_synths_white_noise"); + + b.ToTable("sound_synths", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoundSynthBySoftwareRelease", b => + { + b.Property("ReleaseId") + .HasColumnType("bigint unsigned"); + + b.Property("SoundSynthId") + .HasColumnType("int(11)"); + + b.HasKey("ReleaseId", "SoundSynthId"); + + b.HasIndex("SoundSynthId"); + + b.ToTable("SoundSynthBySoftwareRelease"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoundSynthDescription", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Html") + .HasMaxLength(262144) + .HasColumnType("longtext"); + + b.Property("LanguageCode") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("char(3)") + .UseCollation("utf8mb4_general_ci"); + + b.Property("SoundSynthId") + .HasColumnType("int(11)"); + + b.Property("Text") + .IsRequired() + .HasMaxLength(262144) + .HasColumnType("longtext"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("LanguageCode"); + + b.HasIndex("Text") + .HasAnnotation("MySql:FullTextIndex", true); + + b.HasIndex("SoundSynthId", "LanguageCode") + .IsUnique() + .HasDatabaseName("idx_sound_synth_descriptions_sound_synth_language"); + + b.ToTable("SoundSynthDescriptions"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoundSynthPhoto", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Aperture") + .HasColumnType("double"); + + b.Property("Author") + .HasColumnType("varchar(255)"); + + b.Property("CameraManufacturer") + .HasColumnType("varchar(255)"); + + b.Property("CameraModel") + .HasColumnType("varchar(255)"); + + b.Property("ColorSpace") + .HasColumnType("smallint unsigned"); + + b.Property("Comments") + .HasColumnType("varchar(255)"); + + b.Property("Contrast") + .HasColumnType("smallint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("DigitalZoomRatio") + .HasColumnType("double"); + + b.Property("ExifVersion") + .HasColumnType("varchar(255)"); + + 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)"); + + 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"); + + 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)"); + + b.Property("SoundSynthId") + .HasColumnType("int(11)"); + + b.Property("Source") + .HasColumnType("longtext"); + + b.Property("SubjectDistanceRange") + .HasColumnType("smallint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("UploadDate") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("UserId") + .HasColumnType("varchar(255)"); + + 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("ResolutionUnit"); + + b.HasIndex("Saturation"); + + b.HasIndex("SceneCaptureType"); + + b.HasIndex("SensingMethod"); + + b.HasIndex("Sharpness"); + + b.HasIndex("SoftwareUsed"); + + b.HasIndex("SoundSynthId") + .HasDatabaseName("idx_sound_synth_photos_sound_synth"); + + b.HasIndex("SubjectDistanceRange"); + + b.HasIndex("UploadDate"); + + b.HasIndex("UserId"); + + b.HasIndex("VerticalResolution"); + + b.HasIndex("WhiteBalance"); + + b.HasIndex("SoundSynthId", "CreatedOn", "Id") + .HasDatabaseName("idx_sound_synth_photos_sound_synth_created"); + + b.ToTable("SoundSynthPhotos"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoundSynthVideo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Provider") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("SoundSynthId") + .HasColumnType("int(11)"); + + b.Property("Title") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("VideoId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("SoundSynthId"); + + b.HasIndex("SoundSynthId", "Provider", "VideoId") + .IsUnique(); + + b.ToTable("SoundSynthVideos"); + }); + + modelBuilder.Entity("Marechai.Database.Models.StandaloneFile", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + 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)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + 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() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("Path") + .IsRequired() + .HasMaxLength(8192) + .HasColumnType("varchar(8192)"); + + b.Property("PathSeparator") + .IsRequired() + .HasColumnType("varchar(1)"); + + b.Property("PosixMode") + .HasColumnType("smallint unsigned"); + + b.Property("SoftwareReleaseId") + .HasColumnType("bigint unsigned"); + + b.Property("StatusChangeDate") + .HasColumnType("datetime(6)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + 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("SoftwareReleaseId"); + + b.HasIndex("StatusChangeDate"); + + b.HasIndex("UserId"); + + b.ToTable("StandaloneFiles"); + }); + + modelBuilder.Entity("Marechai.Database.Models.StorageByMachine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint(20)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Capacity") + .HasColumnType("bigint(20)") + .HasColumnName("capacity"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Interface") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasDefaultValue(0) + .HasColumnName("interface"); + + b.Property("MachineId") + .HasColumnType("int(11)") + .HasColumnName("machine"); + + b.Property("Type") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasDefaultValue(0) + .HasColumnName("type"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("Capacity") + .HasDatabaseName("idx_storage_capacity"); + + b.HasIndex("Interface") + .HasDatabaseName("idx_storage_interface"); + + b.HasIndex("MachineId") + .HasDatabaseName("idx_storage_machine"); + + b.HasIndex("Type") + .HasDatabaseName("idx_storage_type"); + + b.ToTable("storage_by_machine", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.UnM49", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("smallint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ParentId") + .HasColumnType("smallint"); + + b.Property("Type") + .HasColumnType("tinyint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("ParentId"); + + b.HasIndex("Type"); + + b.ToTable("UnM49"); + }); + + modelBuilder.Entity("Marechai.Database.Models.UnM49BySoftwareRelease", b => + { + b.Property("SoftwareReleaseId") + .HasColumnType("bigint unsigned"); + + b.Property("UnM49Id") + .HasColumnType("smallint"); + + b.HasKey("SoftwareReleaseId", "UnM49Id"); + + b.HasIndex("UnM49Id"); + + b.ToTable("UnM49BySoftwareRelease"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("longtext"); + + b.Property("ClaimValue") + .HasColumnType("longtext"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("longtext"); + + b.Property("ClaimValue") + .HasColumnType("longtext"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderDisplayName") + .HasColumnType("longtext"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.Property("RoleId") + .HasColumnType("varchar(255)"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.Property("LoginProvider") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.Audit", b => + { + b.HasOne("Marechai.Database.Models.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + 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"); + + b.Navigation("Country"); + + b.Navigation("Previous"); + + b.Navigation("Source"); + }); + + modelBuilder.Entity("Marechai.Database.Models.BookScan", b => + { + b.HasOne("Marechai.Database.Models.Book", "Book") + .WithMany("Scans") + .HasForeignKey("BookId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "User") + .WithMany("BookScans") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("Book"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Marechai.Database.Models.BookSynopsis", b => + { + b.HasOne("Marechai.Database.Models.Book", "Book") + .WithMany("Synopses") + .HasForeignKey("BookId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Iso639", "Language") + .WithMany() + .HasForeignKey("LanguageCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_book_synopses_language"); + + b.Navigation("Book"); + + b.Navigation("Language"); + }); + + 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(); + + b.Navigation("Book"); + + b.Navigation("Machine"); + }); + + 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(); + + b.Navigation("Book"); + + b.Navigation("MachineFamily"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CollectedBook", b => + { + b.HasOne("Marechai.Database.Models.Book", "Book") + .WithMany("CollectedBy") + .HasForeignKey("BookId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "User") + .WithMany("CollectedBooks") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Book"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CollectedDocument", b => + { + b.HasOne("Marechai.Database.Models.Document", "Document") + .WithMany("CollectedBy") + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "User") + .WithMany("CollectedDocuments") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Document"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CollectedSoftwareRelease", b => + { + b.HasOne("Marechai.Database.Models.SoftwareRelease", "SoftwareRelease") + .WithMany("CollectedBy") + .HasForeignKey("SoftwareReleaseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "User") + .WithMany("CollectedSoftwareReleases") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("SoftwareRelease"); + + b.Navigation("User"); + }); + + 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.Company", "Company") + .WithMany("Books") + .HasForeignKey("CompanyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.DocumentRole", "Role") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Book"); + + b.Navigation("Company"); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CompaniesByDocument", b => + { + b.HasOne("Marechai.Database.Models.Company", "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(); + + b.Navigation("Company"); + + b.Navigation("Document"); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CompaniesByMagazine", b => + { + b.HasOne("Marechai.Database.Models.Company", "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(); + + b.Navigation("Company"); + + b.Navigation("Magazine"); + + b.Navigation("Role"); + }); + + 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"); + + b.Navigation("Country"); + + b.Navigation("SoldTo"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CompanyBySoftwareFamily", b => + { + b.HasOne("Marechai.Database.Models.Company", "Company") + .WithMany("SoftwareFamilies2") + .HasForeignKey("CompanyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareRole", "Role") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareFamily", "SoftwareFamily") + .WithMany("Companies") + .HasForeignKey("SoftwareFamilyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Company"); + + b.Navigation("Role"); + + b.Navigation("SoftwareFamily"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CompanyBySoftwareVersion", b => + { + b.HasOne("Marechai.Database.Models.Company", "Company") + .WithMany("SoftwareVersions") + .HasForeignKey("CompanyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareRole", "Role") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareVersion", "SoftwareVersion") + .WithMany("Companies") + .HasForeignKey("SoftwareVersionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Company"); + + b.Navigation("Role"); + + b.Navigation("SoftwareVersion"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CompanyDescription", b => + { + b.HasOne("Marechai.Database.Models.Company", "Company") + .WithMany("Descriptions") + .HasForeignKey("CompanyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Iso639", "Language") + .WithMany() + .HasForeignKey("LanguageCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_company_descriptions_language"); + + b.Navigation("Company"); + + b.Navigation("Language"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CompanyLogo", b => + { + b.HasOne("Marechai.Database.Models.Company", "Company") + .WithMany("Logos") + .HasForeignKey("CompanyId") + .IsRequired() + .HasConstraintName("fk_company_logos_company1"); + + b.Navigation("Company"); + }); + + modelBuilder.Entity("Marechai.Database.Models.ConversationParticipant", b => + { + b.HasOne("Marechai.Database.Models.Conversation", "Conversation") + .WithMany("Participants") + .HasForeignKey("ConversationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Conversation"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CurrencyInflation", b => + { + b.HasOne("Marechai.Database.Models.Iso4217", "Currency") + .WithMany() + .HasForeignKey("CurrencyCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Currency"); + }); + + 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(); + + b.Navigation("Destination"); + + b.Navigation("Source"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Document", b => + { + b.HasOne("Marechai.Database.Models.Iso31661Numeric", "Country") + .WithMany("Documents") + .HasForeignKey("CountryId"); + + b.Navigation("Country"); + }); + + modelBuilder.Entity("Marechai.Database.Models.DocumentScan", b => + { + b.HasOne("Marechai.Database.Models.Document", "Document") + .WithMany("Scans") + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "User") + .WithMany("DocumentScans") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("Document"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Marechai.Database.Models.DocumentSynopsis", b => + { + b.HasOne("Marechai.Database.Models.Document", "Document") + .WithMany("Synopses") + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Iso639", "Language") + .WithMany() + .HasForeignKey("LanguageCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_document_synopses_language"); + + b.Navigation("Document"); + + b.Navigation("Language"); + }); + + 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(); + + b.Navigation("Document"); + + b.Navigation("Machine"); + }); + + 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(); + + b.Navigation("Document"); + + b.Navigation("MachineFamily"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Dump", b => + { + b.HasOne("Marechai.Database.Models.MediaDump", "MediaDump") + .WithMany("Dumps") + .HasForeignKey("MediaDumpId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Media", "Media") + .WithMany("Dumps") + .HasForeignKey("MediaId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "User") + .WithMany("Dumps") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("Media"); + + b.Navigation("MediaDump"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Marechai.Database.Models.DumpHardware", b => + { + b.HasOne("Marechai.Database.Models.Dump", "Dump") + .WithMany("DumpHardware") + .HasForeignKey("DumpId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Dump"); + }); + + modelBuilder.Entity("Marechai.Database.Models.FileDataStream", b => + { + b.HasOne("Marechai.Database.Models.DbFile", "File") + .WithMany() + .HasForeignKey("FileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("File"); + }); + + 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(); + + b.Navigation("FileDataStream"); + + b.Navigation("MediaFile"); + }); + + 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(); + + b.Navigation("FileDataStream"); + + b.Navigation("StandaloneFile"); + }); + + 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(); + + b.Navigation("File"); + + b.Navigation("Filesystem"); + }); + + 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(); + + b.Navigation("Filesystem"); + + b.Navigation("Partition"); + }); + + 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(); + + b.Navigation("Filesystem"); + + b.Navigation("MediaDumpFileImage"); + }); + + modelBuilder.Entity("Marechai.Database.Models.GenreBySoftware", b => + { + b.HasOne("Marechai.Database.Models.SoftwareGenre", "Genre") + .WithMany("Softwares") + .HasForeignKey("GenreId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Software", "Software") + .WithMany("Genres") + .HasForeignKey("SoftwareId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Genre"); + + b.Navigation("Software"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Gpu", b => + { + b.HasOne("Marechai.Database.Models.Company", "Company") + .WithMany("Gpus") + .HasForeignKey("CompanyId") + .HasConstraintName("fk_gpus_company"); + + b.Navigation("Company"); + }); + + modelBuilder.Entity("Marechai.Database.Models.GpuDescription", b => + { + b.HasOne("Marechai.Database.Models.Gpu", "Gpu") + .WithMany("Descriptions") + .HasForeignKey("GpuId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Iso639", "Language") + .WithMany() + .HasForeignKey("LanguageCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_gpu_descriptions_language"); + + b.Navigation("Gpu"); + + b.Navigation("Language"); + }); + + modelBuilder.Entity("Marechai.Database.Models.GpuPhoto", b => + { + b.HasOne("Marechai.Database.Models.Gpu", "Gpu") + .WithMany("Photos") + .HasForeignKey("GpuId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.License", "License") + .WithMany() + .HasForeignKey("LicenseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("Gpu"); + + b.Navigation("License"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Marechai.Database.Models.GpuVideo", b => + { + b.HasOne("Marechai.Database.Models.Gpu", "Gpu") + .WithMany("Videos") + .HasForeignKey("GpuId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Gpu"); + }); + + modelBuilder.Entity("Marechai.Database.Models.GpusByMachine", b => + { + b.HasOne("Marechai.Database.Models.Gpu", "Gpu") + .WithMany("GpusByMachine") + .HasForeignKey("GpuId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_gpus_by_machine_gpu"); + + b.HasOne("Marechai.Database.Models.Machine", "Machine") + .WithMany("Gpus") + .HasForeignKey("MachineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_gpus_by_machine_machine"); + + b.Navigation("Gpu"); + + b.Navigation("Machine"); + }); + + modelBuilder.Entity("Marechai.Database.Models.InstructionSetExtensionsByProcessor", b => + { + b.HasOne("Marechai.Database.Models.InstructionSetExtension", "Extension") + .WithMany("InstructionSetExtensionsByProcessor") + .HasForeignKey("ExtensionId") + .IsRequired() + .HasConstraintName("fk_extension_extension_id"); + + b.HasOne("Marechai.Database.Models.Processor", "Processor") + .WithMany("InstructionSetExtensions") + .HasForeignKey("ProcessorId") + .IsRequired() + .HasConstraintName("fk_extension_processor_id"); + + b.Navigation("Extension"); + + b.Navigation("Processor"); + }); + + modelBuilder.Entity("Marechai.Database.Models.LanguageBySoftwareRelease", b => + { + b.HasOne("Marechai.Database.Models.Iso639", "Language") + .WithMany() + .HasForeignKey("LanguageCode") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareRelease", "SoftwareRelease") + .WithMany("Languages") + .HasForeignKey("SoftwareReleaseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Language"); + + b.Navigation("SoftwareRelease"); + }); + + 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(); + + b.Navigation("Media"); + + b.Navigation("Partition"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Machine", b => + { + b.HasOne("Marechai.Database.Models.Company", "Company") + .WithMany("Machines") + .HasForeignKey("CompanyId") + .IsRequired() + .HasConstraintName("fk_machines_company"); + + b.HasOne("Marechai.Database.Models.MachineFamily", "Family") + .WithMany("Machines") + .HasForeignKey("FamilyId") + .HasConstraintName("fk_machines_family"); + + b.Navigation("Company"); + + b.Navigation("Family"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MachineDescription", b => + { + b.HasOne("Marechai.Database.Models.Iso639", "Language") + .WithMany() + .HasForeignKey("LanguageCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_machine_descriptions_language"); + + b.HasOne("Marechai.Database.Models.Machine", "Machine") + .WithMany("Descriptions") + .HasForeignKey("MachineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Language"); + + b.Navigation("Machine"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MachineFamily", b => + { + b.HasOne("Marechai.Database.Models.Company", "Company") + .WithMany("MachineFamilies") + .HasForeignKey("CompanyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_machine_families_company"); + + b.Navigation("Company"); + }); + + 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); + + b.Navigation("License"); + + b.Navigation("Machine"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MachineVideo", b => + { + b.HasOne("Marechai.Database.Models.Machine", "Machine") + .WithMany("Videos") + .HasForeignKey("MachineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Machine"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Magazine", b => + { + b.HasOne("Marechai.Database.Models.Iso31661Numeric", "Country") + .WithMany("Magazines") + .HasForeignKey("CountryId"); + + b.Navigation("Country"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MagazineIssue", b => + { + b.HasOne("Marechai.Database.Models.Magazine", "Magazine") + .WithMany("Issues") + .HasForeignKey("MagazineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Magazine"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MagazineScan", b => + { + b.HasOne("Marechai.Database.Models.MagazineIssue", "Magazine") + .WithMany("Scans") + .HasForeignKey("MagazineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "User") + .WithMany("MagazineScans") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("Magazine"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MagazineSynopsis", b => + { + b.HasOne("Marechai.Database.Models.Iso639", "Language") + .WithMany() + .HasForeignKey("LanguageCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_magazine_synopses_language"); + + b.HasOne("Marechai.Database.Models.Magazine", "Magazine") + .WithMany("Synopses") + .HasForeignKey("MagazineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Language"); + + b.Navigation("Magazine"); + }); + + 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(); + + b.Navigation("Machine"); + + b.Navigation("Magazine"); + }); + + 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(); + + b.Navigation("MachineFamily"); + + b.Navigation("Magazine"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MasteringText", b => + { + b.HasOne("Marechai.Database.Models.Media", "Media") + .WithMany("MasteringTexts") + .HasForeignKey("MediaId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Media"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Media", b => + { + b.HasOne("Marechai.Database.Models.MagazineIssue", "MagazineIssue") + .WithMany("Coverdiscs") + .HasForeignKey("MagazineIssueId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("MagazineIssue"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaDump", b => + { + b.HasOne("Marechai.Database.Models.Media", "Media") + .WithMany("MediaDumps") + .HasForeignKey("MediaId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Media"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaDumpFileImage", b => + { + b.HasOne("Marechai.Database.Models.MediaDump", "MediaDump") + .WithMany("Files") + .HasForeignKey("MediaDumpId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MediaDump"); + }); + + 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(); + + b.Navigation("MediaDump"); + }); + + 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); + + b.Navigation("MediaDump"); + + b.Navigation("Track"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaDumpTrackImage", b => + { + b.HasOne("Marechai.Database.Models.MediaDump", "MediaDump") + .WithMany("Tracks") + .HasForeignKey("MediaDumpId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("MediaDump"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaTagDump", b => + { + b.HasOne("Marechai.Database.Models.DbFile", "File") + .WithMany() + .HasForeignKey("FileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.MediaDump", "MediaDump") + .WithMany("Tags") + .HasForeignKey("MediaDumpId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("File"); + + b.Navigation("MediaDump"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MemoryByMachine", b => + { + b.HasOne("Marechai.Database.Models.Machine", "Machine") + .WithMany("Memory") + .HasForeignKey("MachineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_memory_by_machine_machine"); + + b.Navigation("Machine"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Message", b => + { + b.HasOne("Marechai.Database.Models.Conversation", "Conversation") + .WithMany("Messages") + .HasForeignKey("ConversationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Message", "ParentMessage") + .WithMany() + .HasForeignKey("ParentMessageId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "Sender") + .WithMany() + .HasForeignKey("SenderId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("Conversation"); + + b.Navigation("ParentMessage"); + + b.Navigation("Sender"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MessageReport", b => + { + b.HasOne("Marechai.Database.Models.Message", "Message") + .WithMany() + .HasForeignKey("MessageId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "Reporter") + .WithMany() + .HasForeignKey("ReporterId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "ResolvedBy") + .WithMany() + .HasForeignKey("ResolvedByUserId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("Message"); + + b.Navigation("Reporter"); + + b.Navigation("ResolvedBy"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MessageState", b => + { + b.HasOne("Marechai.Database.Models.Message", "Message") + .WithMany("States") + .HasForeignKey("MessageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Message"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MinimumGpuBySoftwareRelease", b => + { + b.HasOne("Marechai.Database.Models.Gpu", "Gpu") + .WithMany("MinimumForSoftwareReleases") + .HasForeignKey("GpuId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareRelease", "Release") + .WithMany("MinimumGpus") + .HasForeignKey("ReleaseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Gpu"); + + b.Navigation("Release"); + }); + + 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); + + b.Navigation("Machine"); + + b.Navigation("User"); + }); + + 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.Person", "Person") + .WithMany("Books") + .HasForeignKey("PersonId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.DocumentRole", "Role") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Book"); + + b.Navigation("Person"); + + b.Navigation("Role"); + }); + + 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(); + + b.Navigation("Company"); + + b.Navigation("Person"); + }); + + 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.Person", "Person") + .WithMany("Documents") + .HasForeignKey("PersonId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.DocumentRole", "Role") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Document"); + + b.Navigation("Person"); + + b.Navigation("Role"); + }); + + 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.Person", "Person") + .WithMany("Magazines") + .HasForeignKey("PersonId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.DocumentRole", "Role") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Magazine"); + + b.Navigation("Person"); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("Marechai.Database.Models.PeopleBySoftware", b => + { + b.HasOne("Marechai.Database.Models.Person", "Person") + .WithMany() + .HasForeignKey("PersonId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.DocumentRole", "DocumentRole") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Marechai.Database.Models.Software", "Software") + .WithMany("Credits") + .HasForeignKey("SoftwareId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DocumentRole"); + + b.Navigation("Person"); + + b.Navigation("Software"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Person", b => + { + b.HasOne("Marechai.Database.Models.Iso31661Numeric", "CountryOfBirth") + .WithMany("People") + .HasForeignKey("CountryOfBirthId"); + + b.Navigation("CountryOfBirth"); + }); + + 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"); + + b.Navigation("Company"); + + b.Navigation("InstructionSet"); + }); + + modelBuilder.Entity("Marechai.Database.Models.ProcessorDescription", b => + { + b.HasOne("Marechai.Database.Models.Iso639", "Language") + .WithMany() + .HasForeignKey("LanguageCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_processor_descriptions_language"); + + b.HasOne("Marechai.Database.Models.Processor", "Processor") + .WithMany("Descriptions") + .HasForeignKey("ProcessorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Language"); + + b.Navigation("Processor"); + }); + + modelBuilder.Entity("Marechai.Database.Models.ProcessorPhoto", b => + { + b.HasOne("Marechai.Database.Models.License", "License") + .WithMany() + .HasForeignKey("LicenseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Processor", "Processor") + .WithMany("Photos") + .HasForeignKey("ProcessorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("License"); + + b.Navigation("Processor"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Marechai.Database.Models.ProcessorVideo", b => + { + b.HasOne("Marechai.Database.Models.Processor", "Processor") + .WithMany("Videos") + .HasForeignKey("ProcessorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Processor"); + }); + + modelBuilder.Entity("Marechai.Database.Models.ProcessorsByMachine", b => + { + b.HasOne("Marechai.Database.Models.Machine", "Machine") + .WithMany("Processors") + .HasForeignKey("MachineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_processors_by_machine_machine"); + + b.HasOne("Marechai.Database.Models.Processor", "Processor") + .WithMany("ProcessorsByMachine") + .HasForeignKey("ProcessorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_processors_by_machine_processor"); + + b.Navigation("Machine"); + + b.Navigation("Processor"); + }); + + modelBuilder.Entity("Marechai.Database.Models.RecommendedGpuBySoftwareRelease", b => + { + b.HasOne("Marechai.Database.Models.Gpu", "Gpu") + .WithMany("RecommendedForSoftwareReleases") + .HasForeignKey("GpuId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareRelease", "Release") + .WithMany("RecommendedGpus") + .HasForeignKey("ReleaseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Gpu"); + + b.Navigation("Release"); + }); + + modelBuilder.Entity("Marechai.Database.Models.ResolutionsByGpu", b => + { + b.HasOne("Marechai.Database.Models.Gpu", "Gpu") + .WithMany("ResolutionsByGpu") + .HasForeignKey("GpuId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_resolutions_by_gpu_gpu"); + + b.HasOne("Marechai.Database.Models.Resolution", "Resolution") + .WithMany("ResolutionsByGpu") + .HasForeignKey("ResolutionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_resolutions_by_gpu_resolution"); + + b.Navigation("Gpu"); + + b.Navigation("Resolution"); + }); + + 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(); + + b.Navigation("Resolution"); + + b.Navigation("Screen"); + }); + + modelBuilder.Entity("Marechai.Database.Models.ReviewReport", b => + { + b.HasOne("Marechai.Database.Models.ApplicationUser", "Reporter") + .WithMany("ReviewReports") + .HasForeignKey("ReporterId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "ResolvedBy") + .WithMany() + .HasForeignKey("ResolvedByUserId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Marechai.Database.Models.SoftwareUserReview", "Review") + .WithMany("Reports") + .HasForeignKey("ReviewId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Reporter"); + + b.Navigation("ResolvedBy"); + + b.Navigation("Review"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Screen", b => + { + b.HasOne("Marechai.Database.Models.Resolution", "NativeResolution") + .WithMany("Screens") + .HasForeignKey("NativeResolutionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("NativeResolution"); + }); + + 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(); + + b.Navigation("Machine"); + + b.Navigation("Screen"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Software", b => + { + b.HasOne("Marechai.Database.Models.Software", "BaseSoftware") + .WithMany("Addons") + .HasForeignKey("BaseSoftwareId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Marechai.Database.Models.SoftwareFamily", "Family") + .WithMany("Softwares") + .HasForeignKey("FamilyId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Marechai.Database.Models.Software", "Predecessor") + .WithMany("Successors") + .HasForeignKey("PredecessorId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("BaseSoftware"); + + b.Navigation("Family"); + + b.Navigation("Predecessor"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareAttribute", b => + { + b.HasOne("Marechai.Database.Models.SoftwareRelease", "SoftwareRelease") + .WithMany("Attributes") + .HasForeignKey("SoftwareReleaseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("SoftwareRelease"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareBarcode", b => + { + b.HasOne("Marechai.Database.Models.SoftwareRelease", "Release") + .WithMany("Barcodes") + .HasForeignKey("ReleaseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Release"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareBySoftwareRelease", b => + { + b.HasOne("Marechai.Database.Models.SoftwareRelease", "Release") + .WithMany("IncludedSoftware") + .HasForeignKey("ReleaseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Software", "Software") + .WithMany("CompilationReleases") + .HasForeignKey("SoftwareId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Release"); + + b.Navigation("Software"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareCompanyRole", b => + { + b.HasOne("Marechai.Database.Models.Company", "Company") + .WithMany("SoftwareRoles") + .HasForeignKey("CompanyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareRole", "Role") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Software", "Software") + .WithMany("CompanyRoles") + .HasForeignKey("SoftwareId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Company"); + + b.Navigation("Role"); + + b.Navigation("Software"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareCover", b => + { + b.HasOne("Marechai.Database.Models.SoftwareRelease", "Release") + .WithMany("Covers") + .HasForeignKey("SoftwareReleaseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Release"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareCriticReview", b => + { + b.HasOne("Marechai.Database.Models.Magazine", "Magazine") + .WithMany() + .HasForeignKey("MagazineId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwarePlatform", "Platform") + .WithMany() + .HasForeignKey("PlatformId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Marechai.Database.Models.Software", "Software") + .WithMany("CriticReviews") + .HasForeignKey("SoftwareId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Magazine"); + + b.Navigation("Platform"); + + b.Navigation("Software"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareDescription", b => + { + b.HasOne("Marechai.Database.Models.Iso639", "Language") + .WithMany() + .HasForeignKey("LanguageCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_software_descriptions_language"); + + b.HasOne("Marechai.Database.Models.Software", "Software") + .WithMany("Descriptions") + .HasForeignKey("SoftwareId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Language"); + + b.Navigation("Software"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareFamily", b => + { + b.HasOne("Marechai.Database.Models.SoftwareFamily", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Parent"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareOSCompatibility", b => + { + b.HasOne("Marechai.Database.Models.SoftwareVersion", "OSVersion") + .WithMany() + .HasForeignKey("OSVersionId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareVersion", "SoftwareVersion") + .WithMany("OSCompatibility") + .HasForeignKey("SoftwareVersionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("OSVersion"); + + b.Navigation("SoftwareVersion"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwarePlatformsByMachine", b => + { + b.HasOne("Marechai.Database.Models.Machine", "Machine") + .WithMany("SoftwarePlatforms") + .HasForeignKey("MachineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_software_platforms_by_machine_machine"); + + b.HasOne("Marechai.Database.Models.SoftwarePlatform", "SoftwarePlatform") + .WithMany("Machines") + .HasForeignKey("SoftwarePlatformId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_software_platforms_by_machine_software_platform"); + + b.Navigation("Machine"); + + b.Navigation("SoftwarePlatform"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareProductCode", b => + { + b.HasOne("Marechai.Database.Models.SoftwareRelease", "Release") + .WithMany("ProductCodes") + .HasForeignKey("ReleaseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Release"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwarePromoArt", b => + { + b.HasOne("Marechai.Database.Models.SoftwarePromoArtGroup", "Group") + .WithMany("PromoArt") + .HasForeignKey("GroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Software", "Software") + .WithMany("PromoArt") + .HasForeignKey("SoftwareId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Group"); + + b.Navigation("Software"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareRelease", b => + { + b.HasOne("Marechai.Database.Models.SoftwarePlatform", "Platform") + .WithMany("SoftwareReleases") + .HasForeignKey("PlatformId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Marechai.Database.Models.Company", "Publisher") + .WithMany("SoftwareReleases") + .HasForeignKey("PublisherId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Software", "Software") + .WithMany("DirectReleases") + .HasForeignKey("SoftwareId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("Marechai.Database.Models.SoftwareVersion", "SoftwareVersion") + .WithMany("Releases") + .HasForeignKey("SoftwareVersionId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("Platform"); + + b.Navigation("Publisher"); + + b.Navigation("Software"); + + b.Navigation("SoftwareVersion"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareRequirement", b => + { + b.HasOne("Marechai.Database.Models.SoftwareVersion", "RequiredSoftwareVersion") + .WithMany() + .HasForeignKey("RequiredSoftwareVersionId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareVersion", "SoftwareVersion") + .WithMany("Requirements") + .HasForeignKey("SoftwareVersionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("RequiredSoftwareVersion"); + + b.Navigation("SoftwareVersion"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareScreenshot", b => + { + b.HasOne("Marechai.Database.Models.Software", "Software") + .WithMany("Screenshots") + .HasForeignKey("SoftwareId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwarePlatform", "Platform") + .WithMany("Screenshots") + .HasForeignKey("SoftwarePlatformId"); + + b.HasOne("Marechai.Database.Models.SoftwareVersion", "Version") + .WithMany("Screenshots") + .HasForeignKey("SoftwareVersionId"); + + b.Navigation("Platform"); + + b.Navigation("Software"); + + b.Navigation("Version"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareUserRating", b => + { + b.HasOne("Marechai.Database.Models.Software", "Software") + .WithMany("UserRatings") + .HasForeignKey("SoftwareId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "User") + .WithMany("SoftwareRatings") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Software"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareUserReview", b => + { + b.HasOne("Marechai.Database.Models.Software", "Software") + .WithMany("UserReviews") + .HasForeignKey("SoftwareId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "User") + .WithMany("SoftwareReviews") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("Software"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareUserReviewVote", b => + { + b.HasOne("Marechai.Database.Models.SoftwareUserReview", "Review") + .WithMany("Votes") + .HasForeignKey("ReviewId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "User") + .WithMany("ReviewVotes") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Review"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareVersion", b => + { + b.HasOne("Marechai.Database.Models.License", "License") + .WithMany() + .HasForeignKey("LicenseId"); + + b.HasOne("Marechai.Database.Models.SoftwareVersion", "ParentVersion") + .WithMany("Children") + .HasForeignKey("ParentVersionId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("Marechai.Database.Models.Software", "Software") + .WithMany("Versions") + .HasForeignKey("SoftwareId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("License"); + + b.Navigation("ParentVersion"); + + b.Navigation("Software"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareVersionBySoftwareRelease", b => + { + b.HasOne("Marechai.Database.Models.SoftwareRelease", "Release") + .WithMany("IncludedVersions") + .HasForeignKey("ReleaseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareVersion", "SoftwareVersion") + .WithMany("CompilationReleases") + .HasForeignKey("SoftwareVersionId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Release"); + + b.Navigation("SoftwareVersion"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareVideo", b => + { + b.HasOne("Marechai.Database.Models.Software", "Software") + .WithMany("Videos") + .HasForeignKey("SoftwareId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Software"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoundByMachine", b => + { + b.HasOne("Marechai.Database.Models.Machine", "Machine") + .WithMany("Sound") + .HasForeignKey("MachineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_sound_by_machine_machine"); + + b.HasOne("Marechai.Database.Models.SoundSynth", "SoundSynth") + .WithMany("SoundByMachine") + .HasForeignKey("SoundSynthId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_sound_by_machine_sound_synth"); + + b.Navigation("Machine"); + + b.Navigation("SoundSynth"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoundSynth", b => + { + b.HasOne("Marechai.Database.Models.Company", "Company") + .WithMany("SoundSynths") + .HasForeignKey("CompanyId") + .HasConstraintName("fk_sound_synths_company"); + + b.Navigation("Company"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoundSynthBySoftwareRelease", b => + { + b.HasOne("Marechai.Database.Models.SoftwareRelease", "Release") + .WithMany("SupportedSoundSynths") + .HasForeignKey("ReleaseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoundSynth", "SoundSynth") + .WithMany("SupportedBySoftwareReleases") + .HasForeignKey("SoundSynthId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Release"); + + b.Navigation("SoundSynth"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoundSynthDescription", b => + { + b.HasOne("Marechai.Database.Models.Iso639", "Language") + .WithMany() + .HasForeignKey("LanguageCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_sound_synth_descriptions_language"); + + b.HasOne("Marechai.Database.Models.SoundSynth", "SoundSynth") + .WithMany("Descriptions") + .HasForeignKey("SoundSynthId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Language"); + + b.Navigation("SoundSynth"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoundSynthPhoto", b => + { + b.HasOne("Marechai.Database.Models.License", "License") + .WithMany() + .HasForeignKey("LicenseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoundSynth", "SoundSynth") + .WithMany("Photos") + .HasForeignKey("SoundSynthId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("License"); + + b.Navigation("SoundSynth"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoundSynthVideo", b => + { + b.HasOne("Marechai.Database.Models.SoundSynth", "SoundSynth") + .WithMany("Videos") + .HasForeignKey("SoundSynthId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("SoundSynth"); + }); + + modelBuilder.Entity("Marechai.Database.Models.StandaloneFile", b => + { + b.HasOne("Marechai.Database.Models.SoftwareRelease", "SoftwareRelease") + .WithMany() + .HasForeignKey("SoftwareReleaseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("SoftwareRelease"); + }); + + modelBuilder.Entity("Marechai.Database.Models.StorageByMachine", b => + { + b.HasOne("Marechai.Database.Models.Machine", "Machine") + .WithMany("Storage") + .HasForeignKey("MachineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_storage_by_machine_machine"); + + b.Navigation("Machine"); + }); + + modelBuilder.Entity("Marechai.Database.Models.UnM49", b => + { + b.HasOne("Marechai.Database.Models.UnM49", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Parent"); + }); + + modelBuilder.Entity("Marechai.Database.Models.UnM49BySoftwareRelease", b => + { + b.HasOne("Marechai.Database.Models.SoftwareRelease", "SoftwareRelease") + .WithMany("Regions") + .HasForeignKey("SoftwareReleaseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.UnM49", "UnM49") + .WithMany("SoftwareReleases") + .HasForeignKey("UnM49Id") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("SoftwareRelease"); + + b.Navigation("UnM49"); + }); + + 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(); + }); + + modelBuilder.Entity("Marechai.Database.Models.ApplicationUser", b => + { + b.Navigation("BookScans"); + + b.Navigation("CollectedBooks"); + + b.Navigation("CollectedDocuments"); + + b.Navigation("CollectedSoftwareReleases"); + + b.Navigation("DocumentScans"); + + b.Navigation("Dumps"); + + b.Navigation("MagazineScans"); + + b.Navigation("OwnedMachines"); + + b.Navigation("Photos"); + + b.Navigation("ReviewReports"); + + b.Navigation("ReviewVotes"); + + b.Navigation("SoftwareRatings"); + + b.Navigation("SoftwareReviews"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Book", b => + { + b.Navigation("CollectedBy"); + + b.Navigation("Companies"); + + b.Navigation("Derivates"); + + b.Navigation("MachineFamilies"); + + b.Navigation("Machines"); + + b.Navigation("Next"); + + b.Navigation("People"); + + b.Navigation("Scans"); + + b.Navigation("Synopses"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Company", b => + { + b.Navigation("Books"); + + b.Navigation("Descriptions"); + + b.Navigation("Documents"); + + b.Navigation("Gpus"); + + b.Navigation("InverseSoldToNavigation"); + + b.Navigation("Logos"); + + b.Navigation("MachineFamilies"); + + b.Navigation("Machines"); + + b.Navigation("Magazines"); + + b.Navigation("People"); + + b.Navigation("Processors"); + + b.Navigation("SoftwareFamilies2"); + + b.Navigation("SoftwareReleases"); + + b.Navigation("SoftwareRoles"); + + b.Navigation("SoftwareVersions"); + + b.Navigation("SoundSynths"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Conversation", b => + { + b.Navigation("Messages"); + + b.Navigation("Participants"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Document", b => + { + b.Navigation("CollectedBy"); + + b.Navigation("Companies"); + + b.Navigation("MachineFamilies"); + + b.Navigation("Machines"); + + b.Navigation("People"); + + b.Navigation("Scans"); + + b.Navigation("Synopses"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Dump", b => + { + b.Navigation("DumpHardware"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Filesystem", b => + { + b.Navigation("Files"); + + b.Navigation("MediaDumpFileImages"); + + b.Navigation("Partitions"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Gpu", b => + { + b.Navigation("Descriptions"); + + b.Navigation("GpusByMachine"); + + b.Navigation("MinimumForSoftwareReleases"); + + b.Navigation("Photos"); + + b.Navigation("RecommendedForSoftwareReleases"); + + b.Navigation("ResolutionsByGpu"); + + b.Navigation("Videos"); + }); + + modelBuilder.Entity("Marechai.Database.Models.InstructionSet", b => + { + b.Navigation("Processors"); + }); + + modelBuilder.Entity("Marechai.Database.Models.InstructionSetExtension", b => + { + b.Navigation("InstructionSetExtensionsByProcessor"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Iso31661Numeric", b => + { + b.Navigation("Books"); + + b.Navigation("Companies"); + + b.Navigation("Documents"); + + b.Navigation("Magazines"); + + b.Navigation("People"); + }); + + modelBuilder.Entity("Marechai.Database.Models.License", b => + { + b.Navigation("Photos"); + }); + + modelBuilder.Entity("Marechai.Database.Models.LogicalPartition", b => + { + b.Navigation("Filesystems"); + + b.Navigation("Media"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Machine", b => + { + b.Navigation("Books"); + + b.Navigation("Descriptions"); + + b.Navigation("Documents"); + + b.Navigation("Gpus"); + + b.Navigation("Magazines"); + + b.Navigation("Memory"); + + b.Navigation("Photos"); + + b.Navigation("Processors"); + + b.Navigation("Screens"); + + b.Navigation("SoftwarePlatforms"); + + b.Navigation("Sound"); + + b.Navigation("Storage"); + + b.Navigation("Videos"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MachineFamily", b => + { + b.Navigation("Books"); + + b.Navigation("Documents"); + + b.Navigation("Machines"); + + b.Navigation("Magazines"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Magazine", b => + { + b.Navigation("Companies"); + + b.Navigation("Issues"); + + b.Navigation("Synopses"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MagazineIssue", b => + { + b.Navigation("Coverdiscs"); + + b.Navigation("MachineFamilies"); + + b.Navigation("Machines"); + + b.Navigation("People"); + + b.Navigation("Scans"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Media", b => + { + b.Navigation("Dumps"); + + b.Navigation("LogicalPartitions"); + + b.Navigation("MasteringTexts"); + + b.Navigation("MediaDumps"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaDump", b => + { + b.Navigation("Dumps"); + + b.Navigation("Files"); + + b.Navigation("Image"); + + b.Navigation("Subchannel"); + + b.Navigation("Tags"); + + b.Navigation("Tracks"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaDumpFileImage", b => + { + b.Navigation("Filesystems"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaDumpTrackImage", b => + { + b.Navigation("Subchannel"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaFile", b => + { + b.Navigation("DataStreams"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Message", b => + { + b.Navigation("States"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Person", b => + { + b.Navigation("Books"); + + b.Navigation("Companies"); + + b.Navigation("Documents"); + + b.Navigation("Magazines"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Processor", b => + { + b.Navigation("Descriptions"); + + b.Navigation("InstructionSetExtensions"); + + b.Navigation("Photos"); + + b.Navigation("ProcessorsByMachine"); + + b.Navigation("Videos"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Resolution", b => + { + b.Navigation("ResolutionsByGpu"); + + b.Navigation("ResolutionsByScreen"); + + b.Navigation("Screens"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Screen", b => + { + b.Navigation("Resolutions"); + + b.Navigation("ScreensByMachines"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Software", b => + { + b.Navigation("Addons"); + + b.Navigation("CompanyRoles"); + + b.Navigation("CompilationReleases"); + + b.Navigation("Credits"); + + b.Navigation("CriticReviews"); + + b.Navigation("Descriptions"); + + b.Navigation("DirectReleases"); + + b.Navigation("Genres"); + + b.Navigation("PromoArt"); + + b.Navigation("Screenshots"); + + b.Navigation("Successors"); + + b.Navigation("UserRatings"); + + b.Navigation("UserReviews"); + + b.Navigation("Versions"); + + b.Navigation("Videos"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareFamily", b => + { + b.Navigation("Children"); + + b.Navigation("Companies"); + + b.Navigation("Softwares"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareGenre", b => + { + b.Navigation("Softwares"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwarePlatform", b => + { + b.Navigation("Machines"); + + b.Navigation("Screenshots"); + + b.Navigation("SoftwareReleases"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwarePromoArtGroup", b => + { + b.Navigation("PromoArt"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareRelease", b => + { + b.Navigation("Attributes"); + + b.Navigation("Barcodes"); + + b.Navigation("CollectedBy"); + + b.Navigation("Covers"); + + b.Navigation("IncludedSoftware"); + + b.Navigation("IncludedVersions"); + + b.Navigation("Languages"); + + b.Navigation("MinimumGpus"); + + b.Navigation("ProductCodes"); + + b.Navigation("RecommendedGpus"); + + b.Navigation("Regions"); + + b.Navigation("SupportedSoundSynths"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareUserReview", b => + { + b.Navigation("Reports"); + + b.Navigation("Votes"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareVersion", b => + { + b.Navigation("Children"); + + b.Navigation("Companies"); + + b.Navigation("CompilationReleases"); + + b.Navigation("OSCompatibility"); + + b.Navigation("Releases"); + + b.Navigation("Requirements"); + + b.Navigation("Screenshots"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoundSynth", b => + { + b.Navigation("Descriptions"); + + b.Navigation("Photos"); + + b.Navigation("SoundByMachine"); + + b.Navigation("SupportedBySoftwareReleases"); + + b.Navigation("Videos"); + }); + + modelBuilder.Entity("Marechai.Database.Models.StandaloneFile", b => + { + b.Navigation("DataStreams"); + }); + + modelBuilder.Entity("Marechai.Database.Models.UnM49", b => + { + b.Navigation("Children"); + + b.Navigation("SoftwareReleases"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Marechai.Database/Migrations/20260508201459_AddSoundSynthPhotosSoundSynthIdIndex.cs b/Marechai.Database/Migrations/20260508201459_AddSoundSynthPhotosSoundSynthIdIndex.cs new file mode 100644 index 00000000..ce182206 --- /dev/null +++ b/Marechai.Database/Migrations/20260508201459_AddSoundSynthPhotosSoundSynthIdIndex.cs @@ -0,0 +1,37 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Marechai.Database.Migrations +{ + /// + public partial class AddSoundSynthPhotosSoundSynthIdIndex : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.RenameIndex( + name: "IX_SoundSynthPhotos_SoundSynthId", + table: "SoundSynthPhotos", + newName: "idx_sound_synth_photos_sound_synth"); + + migrationBuilder.CreateIndex( + name: "idx_sound_synth_photos_sound_synth_created", + table: "SoundSynthPhotos", + columns: new[] { "SoundSynthId", "CreatedOn", "Id" }); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropIndex( + name: "idx_sound_synth_photos_sound_synth_created", + table: "SoundSynthPhotos"); + + migrationBuilder.RenameIndex( + name: "idx_sound_synth_photos_sound_synth", + table: "SoundSynthPhotos", + newName: "IX_SoundSynthPhotos_SoundSynthId"); + } + } +} diff --git a/Marechai.Database/Migrations/MarechaiContextModelSnapshot.cs b/Marechai.Database/Migrations/MarechaiContextModelSnapshot.cs index f4fe4fc9..6bfa69ae 100644 --- a/Marechai.Database/Migrations/MarechaiContextModelSnapshot.cs +++ b/Marechai.Database/Migrations/MarechaiContextModelSnapshot.cs @@ -8047,7 +8047,8 @@ namespace Marechai.Database.Migrations b.HasIndex("SoftwareUsed"); - b.HasIndex("SoundSynthId"); + b.HasIndex("SoundSynthId") + .HasDatabaseName("idx_sound_synth_photos_sound_synth"); b.HasIndex("SubjectDistanceRange"); @@ -8059,6 +8060,9 @@ namespace Marechai.Database.Migrations b.HasIndex("WhiteBalance"); + b.HasIndex("SoundSynthId", "CreatedOn", "Id") + .HasDatabaseName("idx_sound_synth_photos_sound_synth_created"); + b.ToTable("SoundSynthPhotos"); }); diff --git a/Marechai.Database/Models/MarechaiContext.cs b/Marechai.Database/Models/MarechaiContext.cs index fca06ae2..6ad3f39a 100644 --- a/Marechai.Database/Models/MarechaiContext.cs +++ b/Marechai.Database/Models/MarechaiContext.cs @@ -1344,6 +1344,15 @@ public class MarechaiContext : IdentityDbContext e.WhiteBalance); + // FK index for /sound-synths/{id}/photos lookups (matches the + // MachinePhoto/GpuPhoto/ProcessorPhoto pattern: this FK was missing + // among the 30+ EXIF indexes). Composite (SoundSynthId, CreatedOn, + // Id) backs the OrderBy(CreatedOn).ThenBy(Id) sort. + entity.HasIndex(e => e.SoundSynthId).HasDatabaseName("idx_sound_synth_photos_sound_synth"); + + entity.HasIndex(e => new { e.SoundSynthId, e.CreatedOn, e.Id }) + .HasDatabaseName("idx_sound_synth_photos_sound_synth_created"); + entity.HasOne(d => d.SoundSynth).WithMany(p => p.Photos).OnDelete(DeleteBehavior.Cascade); entity.HasOne(d => d.User).WithMany().OnDelete(DeleteBehavior.SetNull); diff --git a/Marechai.Server/Controllers/SoundSynthsController.cs b/Marechai.Server/Controllers/SoundSynthsController.cs index 0149a129..53cba282 100644 --- a/Marechai.Server/Controllers/SoundSynthsController.cs +++ b/Marechai.Server/Controllers/SoundSynthsController.cs @@ -41,7 +41,9 @@ namespace Marechai.Server.Controllers; [Route("/sound-synths")] [ApiController] -public class SoundSynthsController(MarechaiContext context) : ControllerBase +public class SoundSynthsController( + MarechaiContext context, + IDbContextFactory dbFactory) : ControllerBase { [HttpGet] [AllowAnonymous] @@ -122,7 +124,8 @@ public class SoundSynthsController(MarechaiContext context) : ControllerBase [AllowAnonymous] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status400BadRequest)] - public Task GetAsync(int id) => context.SoundSynths.Where(s => s.Id == id) + public Task GetAsync(int id) => context.SoundSynths.AsNoTracking() + .Where(s => s.Id == id) .Select(s => new SoundSynthDto { Id = s.Id, @@ -141,6 +144,160 @@ public class SoundSynthsController(MarechaiContext context) : ControllerBase }) .FirstOrDefaultAsync(); + /// + /// Consolidated payload for the public /soundsynth/{Id} view page. Replaces five + /// sequential HTTP round-trips (head + machines + description + photos + videos) + /// with a single response. The head + company name + company logo are projected in + /// one query (logo is an inline correlated subquery so it costs zero extra DB + /// round-trips); the description language fallback is collapsed into a single + /// ordered query; the three child collections are fetched in parallel using + /// independent instances from IDbContextFactory + /// (DbContext is not thread-safe; sharing the request-scoped context across parallel + /// branches throws InvalidOperationException). + /// + [HttpGet("{id:int}/full")] + [AllowAnonymous] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status404NotFound)] + public async Task> GetFullAsync(int id, [FromQuery] string lang = "eng") + { + // Head + description + the three child collections only depend on `id` + // (from the URL) and not on any value projected by the head query, so we + // fire all FIVE queries in parallel using independent DbContext instances + // from the factory. Compared to running head first and then the children + // in parallel, this saves one full ~180 ms RTT in the common case. The + // company-logo lookup is folded into the head query as an inline + // correlated subquery so it adds zero extra DB round-trips. + await using var headCtx = await dbFactory.CreateDbContextAsync(); + await using var descriptionCtx = await dbFactory.CreateDbContextAsync(); + await using var machinesCtx = await dbFactory.CreateDbContextAsync(); + await using var photosCtx = await dbFactory.CreateDbContextAsync(); + await using var videosCtx = await dbFactory.CreateDbContextAsync(); + + // Head + company name + company logo in a single projected join. + // The CompanyLogo lookup uses an inline correlated subquery ordered + // such that logos issued on or after the synth's introduction year sort + // first (key 0), then any other logo by ascending year. Returns null + // when the synth does not exist; we surface that as 404 below. + var headTask = headCtx.SoundSynths.AsNoTracking() + .Where(s => s.Id == id) + .Select(s => new + { + s.Id, + s.Name, + s.CompanyId, + CompanyName = s.Company.Name, + s.ModelCode, + s.Introduced, + s.IntroducedPrecision, + s.Voices, + s.Frequency, + s.Depth, + s.SquareWave, + s.WhiteNoise, + s.Type, + CompanyLogo = s.Company.Logos + .OrderBy(l => s.Introduced.HasValue && l.Year >= s.Introduced.Value.Year + ? 0 + : 1) + .ThenBy(l => l.Year) + .Select(l => (Guid?)l.Guid) + .FirstOrDefault() + }) + .FirstOrDefaultAsync(); + + // Description: collapse the original two-step lookup (try requested + // lang, then English fallback) into a single ordered query. Matches + // for the requested language sort first (key 0); English fallback is + // key 1; FirstOrDefaultAsync returns the preferred row. + var descriptionTask = descriptionCtx.SoundSynthDescriptions.AsNoTracking() + .Where(d => d.SoundSynthId == id && (d.LanguageCode == lang || d.LanguageCode == "eng")) + .OrderBy(d => d.LanguageCode == lang ? 0 : 1) + .Select(d => new { d.Html, d.Text, d.LanguageCode }) + .FirstOrDefaultAsync(); + + // Mirrors GetMachinesBySoundSynthAsync. + Task> machinesTask = machinesCtx.SoundByMachine.AsNoTracking() + .Where(s => s.SoundSynthId == id) + .Select(s => s.Machine) + .OrderBy(m => m.Company.Name) + .ThenBy(m => m.Name) + .Select(m => new MachineDto + { + Id = m.Id, + Company = m.Company.Name, + CompanyId = m.Company.Id, + Name = m.Name, + Model = m.Model, + Introduced = m.Introduced, + IntroducedPrecision = m.IntroducedPrecision, + Type = m.Type, + FamilyId = m.FamilyId + }) + .ToListAsync(); + + // Mirrors SoundSynthPhotosController.GetGuidsBySoundSynthAsync. + Task> photosTask = photosCtx.SoundSynthPhotos.AsNoTracking() + .Where(p => p.SoundSynthId == id) + .OrderBy(p => p.CreatedOn) + .ThenBy(p => p.Id) + .Select(p => p.Id) + .ToListAsync(); + + // Mirrors SoundSynthVideosController.GetVideosBySoundSynthAsync. + Task> videosTask = videosCtx.SoundSynthVideos.AsNoTracking() + .Where(v => v.SoundSynthId == id) + .OrderBy(v => v.Title) + .Select(v => new SoundSynthVideoDto + { + Id = v.Id, + SoundSynthId = v.SoundSynthId, + SoundSynthName = v.SoundSynth.Name, + Provider = v.Provider, + VideoId = v.VideoId, + Title = v.Title + }) + .ToListAsync(); + + await Task.WhenAll(headTask, descriptionTask, machinesTask, photosTask, videosTask); + + var head = headTask.Result; + + if(head is null) return NotFound(); + + var synth = new SoundSynthDto + { + Id = head.Id, + Name = head.Name, + CompanyId = head.CompanyId, + CompanyName = head.CompanyName, + ModelCode = head.ModelCode, + Introduced = head.Introduced, + IntroducedPrecision = head.IntroducedPrecision, + Voices = head.Voices, + Frequency = head.Frequency, + Depth = head.Depth, + SquareWave = head.SquareWave, + WhiteNoise = head.WhiteNoise, + Type = head.Type + }; + + var description = descriptionTask.Result; + + return new SoundSynthFullDto + { + SoundSynth = synth, + CompanyLogo = head.CompanyLogo, + DescriptionHtml = description?.Html, + DescriptionText = description?.Text, + DescriptionLanguageCode = description?.LanguageCode, + Machines = machinesTask.Result, + Photos = photosTask.Result, + Videos = videosTask.Result + }; + } + [HttpPut("{id:int}")] [Authorize(Roles = "Admin,UberAdmin")] [ProducesResponseType(StatusCodes.Status200OK)] @@ -257,13 +414,14 @@ public class SoundSynthsController(MarechaiContext context) : ControllerBase [ProducesResponseType(StatusCodes.Status400BadRequest)] public async Task GetDescriptionTextAsync(int id, [FromQuery] string lang = "eng") { - SoundSynthDescription description = - await context.SoundSynthDescriptions.FirstOrDefaultAsync(d => d.SoundSynthId == id && d.LanguageCode == lang); - - // Fallback to English if requested language not found - if(description is null && lang != "eng") - description = await context.SoundSynthDescriptions.FirstOrDefaultAsync(d => d.SoundSynthId == id && - d.LanguageCode == "eng"); + // Single ordered query: requested-language matches sort first (key 0), + // English fallback is key 1. Saves one ~RTT vs the original two-step + // lookup when the fallback fires. + var description = await context.SoundSynthDescriptions.AsNoTracking() + .Where(d => d.SoundSynthId == id && (d.LanguageCode == lang || d.LanguageCode == "eng")) + .OrderBy(d => d.LanguageCode == lang ? 0 : 1) + .Select(d => new { d.Html, d.Text }) + .FirstOrDefaultAsync(); return description?.Html ?? description?.Text; } @@ -289,38 +447,23 @@ public class SoundSynthsController(MarechaiContext context) : ControllerBase [AllowAnonymous] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status400BadRequest)] - public async Task GetDescriptionAsync(int id, [FromQuery] string lang = "eng") - { - SoundSynthDescriptionDto description = await context.SoundSynthDescriptions - .Where(d => d.SoundSynthId == id && d.LanguageCode == lang) - .Select(d => new SoundSynthDescriptionDto - { - Id = d.Id, - SoundSynthId = d.SoundSynthId, - Html = d.Html, - Markdown = d.Text, - LanguageCode = d.LanguageCode, - Language = d.Language.ReferenceName - }) - .FirstOrDefaultAsync(); - - // Fallback to English if requested language not found - if(description is null && lang != "eng") - description = await context.SoundSynthDescriptions - .Where(d => d.SoundSynthId == id && d.LanguageCode == "eng") - .Select(d => new SoundSynthDescriptionDto - { - Id = d.Id, - SoundSynthId = d.SoundSynthId, - Html = d.Html, - Markdown = d.Text, - LanguageCode = d.LanguageCode, - Language = d.Language.ReferenceName - }) - .FirstOrDefaultAsync(); - - return description; - } + public Task GetDescriptionAsync(int id, [FromQuery] string lang = "eng") => + // Single ordered query: requested-language matches sort first (key 0), + // English fallback is key 1. Saves one ~RTT vs the original two-step + // lookup when the fallback fires. + context.SoundSynthDescriptions.AsNoTracking() + .Where(d => d.SoundSynthId == id && (d.LanguageCode == lang || d.LanguageCode == "eng")) + .OrderBy(d => d.LanguageCode == lang ? 0 : 1) + .Select(d => new SoundSynthDescriptionDto + { + Id = d.Id, + SoundSynthId = d.SoundSynthId, + Html = d.Html, + Markdown = d.Text, + LanguageCode = d.LanguageCode, + Language = d.Language.ReferenceName + }) + .FirstOrDefaultAsync(); [HttpPost("{id:int}/description")] [Authorize(Roles = "Admin,UberAdmin")] diff --git a/Marechai/Pages/SoundSynths/View.razor.cs b/Marechai/Pages/SoundSynths/View.razor.cs index 15f0a410..b8e0d215 100644 --- a/Marechai/Pages/SoundSynths/View.razor.cs +++ b/Marechai/Pages/SoundSynths/View.razor.cs @@ -104,29 +104,42 @@ public partial class View return; } - _synth = await Service.GetByIdAsync(Id); + // ── Phase 1+3 retrofit ──────────────────────────────────────────────── + // One consolidated HTTP round-trip via /sound-synths/{Id}/full (head + // projection + company logo via inline subquery + description with + // single-query language fallback + machines + photos + videos), all + // executed in parallel server-side on independent DbContext instances. + // Replaces the original 5 sequential GetByIdAsync / + // GetMachinesBySoundSynthAsync / GetDescriptionTextAsync / + // GetGuidsBySoundSynthAsync / GetVideosBySoundSynthAsync calls. + SoundSynthFullDto full = await Service.GetFullAsync(Id); - if(_synth is null) + if(full?.SoundSynth is null) { + _synth = null; _loaded = true; StateHasChanged(); return; } + _synth = full.SoundSynth; _displayName = _synth.Name == "DB_SOFTWARE" ? L["Software"] : _synth.Name; - List machines = await Service.GetMachinesBySoundSynthAsync(Id); - _computers = machines.Where(m => m.Type == (int)MachineType.Computer).ToList(); - _consoles = machines.Where(m => m.Type == (int)MachineType.Console).ToList(); + // Photos arrive as List? (Kiota emits nullable element type even + // for non-nullable server collections). Materialise into the existing + // List field shape that the .razor view expects. + _photos = full.Photos?.Where(g => g.HasValue).Select(g => g!.Value).ToList() ?? []; + + _videos = full.Videos ?? []; + + _description = full.DescriptionHtml ?? full.DescriptionText; + + List machines = full.Machines ?? []; + _computers = machines.Where(m => m.Type == (int)MachineType.Computer).ToList(); + _consoles = machines.Where(m => m.Type == (int)MachineType.Console).ToList(); _smartphones = machines.Where(m => m.Type == (int)MachineType.Smartphone).ToList(); - _description = await Service.GetDescriptionTextAsync(Id); - - _photos = await SoundSynthPhotosService.GetGuidsBySoundSynthAsync(Id); - - _videos = await Service.GetVideosBySoundSynthAsync(Id); - // Insert the Machines tab between Specifications and Media when the // synth has any attached computers/consoles/smartphones, so // _activeTabIndex resolves "machines" correctly on first paint after a diff --git a/Marechai/Services/SoundSynthsService.cs b/Marechai/Services/SoundSynthsService.cs index 06173fe9..36e05f4d 100644 --- a/Marechai/Services/SoundSynthsService.cs +++ b/Marechai/Services/SoundSynthsService.cs @@ -66,6 +66,29 @@ public class SoundSynthsService(Marechai.ApiClient.Client client) } } + /// + /// Fetches the consolidated /soundsynth/{Id} payload (head + company logo + description + /// + machines + photos + videos) in a single HTTP round-trip. Replaces the original + /// 5-call sequence (GetByIdAsync + GetMachinesBySoundSynthAsync + GetDescriptionTextAsync + /// + SoundSynthPhotosService.GetGuidsBySoundSynthAsync + GetVideosBySoundSynthAsync). + /// Returns null on any transport-level failure or 404; the caller should treat + /// null the same way it treated GetByIdAsync returning null. + /// + public async Task GetFullAsync(int id, string lang = "eng") + { + try + { + return await client.SoundSynths[id].Full.GetAsync(rc => + { + if(!string.IsNullOrEmpty(lang)) rc.QueryParameters.Lang = lang; + }); + } + catch + { + return null; + } + } + public async Task<(long? id, string error)> CreateAsync(SoundSynthDto dto) { try