diff --git a/Marechai.ApiClient/Models/AssignCoverGroupToReleaseRequestDto.cs b/Marechai.ApiClient/Models/AssignCoverGroupToReleaseRequestDto.cs new file mode 100644 index 00000000..ce474cbf --- /dev/null +++ b/Marechai.ApiClient/Models/AssignCoverGroupToReleaseRequestDto.cs @@ -0,0 +1,59 @@ +// +#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 AssignCoverGroupToReleaseRequestDto : 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 release_id property + public int? ReleaseId { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public AssignCoverGroupToReleaseRequestDto() + { + 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.AssignCoverGroupToReleaseRequestDto CreateFromDiscriminatorValue(IParseNode parseNode) + { + if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); + return new global::Marechai.ApiClient.Models.AssignCoverGroupToReleaseRequestDto(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "release_id", n => { ReleaseId = n.GetIntValue(); } }, + }; + } + /// + /// 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.WriteIntValue("release_id", ReleaseId); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/Models/SoftwareCoverDto.cs b/Marechai.ApiClient/Models/SoftwareCoverDto.cs index a61a8e27..9ac12c23 100644 --- a/Marechai.ApiClient/Models/SoftwareCoverDto.cs +++ b/Marechai.ApiClient/Models/SoftwareCoverDto.cs @@ -29,6 +29,14 @@ namespace Marechai.ApiClient.Models #nullable restore #else public string Caption { get; set; } +#endif + /// The group_id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? GroupId { get; set; } +#nullable restore +#else + public string GroupId { get; set; } #endif /// The id property public Guid? Id { get; set; } @@ -64,6 +72,8 @@ namespace Marechai.ApiClient.Models #else public string ReleaseTitle { get; set; } #endif + /// The software_id property + public int? SoftwareId { get; set; } /// The software_release_id property public int? SoftwareReleaseId { get; set; } /// The type property @@ -103,11 +113,13 @@ namespace Marechai.ApiClient.Models { { "canonical_caption", n => { CanonicalCaption = n.GetStringValue(); } }, { "caption", n => { Caption = n.GetStringValue(); } }, + { "group_id", n => { GroupId = n.GetStringValue(); } }, { "id", n => { Id = n.GetGuidValue(); } }, { "original_extension", n => { OriginalExtension = n.GetStringValue(); } }, { "platform_name", n => { PlatformName = n.GetStringValue(); } }, { "region_names", n => { RegionNames = n.GetStringValue(); } }, { "release_title", n => { ReleaseTitle = n.GetStringValue(); } }, + { "software_id", n => { SoftwareId = n.GetIntValue(); } }, { "software_release_id", n => { SoftwareReleaseId = n.GetIntValue(); } }, { "type", n => { Type = n.GetIntValue(); } }, { "type_name", n => { TypeName = n.GetStringValue(); } }, @@ -122,11 +134,13 @@ namespace Marechai.ApiClient.Models if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); writer.WriteStringValue("canonical_caption", CanonicalCaption); writer.WriteStringValue("caption", Caption); + writer.WriteStringValue("group_id", GroupId); writer.WriteGuidValue("id", Id); writer.WriteStringValue("original_extension", OriginalExtension); writer.WriteStringValue("platform_name", PlatformName); writer.WriteStringValue("region_names", RegionNames); writer.WriteStringValue("release_title", ReleaseTitle); + writer.WriteIntValue("software_id", SoftwareId); writer.WriteIntValue("software_release_id", SoftwareReleaseId); writer.WriteIntValue("type", Type); writer.WriteStringValue("type_name", TypeName); diff --git a/Marechai.ApiClient/Software/Covers/CoversRequestBuilder.cs b/Marechai.ApiClient/Software/Covers/CoversRequestBuilder.cs index 88017362..3d37a558 100644 --- a/Marechai.ApiClient/Software/Covers/CoversRequestBuilder.cs +++ b/Marechai.ApiClient/Software/Covers/CoversRequestBuilder.cs @@ -1,6 +1,7 @@ // #pragma warning disable CS0618 using Marechai.ApiClient.Software.Covers.Admin; +using Marechai.ApiClient.Software.Covers.Groups; using Marechai.ApiClient.Software.Covers.Item; using Marechai.ApiClient.Software.Covers.Pending; using Marechai.ApiClient.Software.Covers.Upload; @@ -23,6 +24,11 @@ namespace Marechai.ApiClient.Software.Covers { get => new global::Marechai.ApiClient.Software.Covers.Admin.AdminRequestBuilder(PathParameters, RequestAdapter); } + /// The groups property + public global::Marechai.ApiClient.Software.Covers.Groups.GroupsRequestBuilder Groups + { + get => new global::Marechai.ApiClient.Software.Covers.Groups.GroupsRequestBuilder(PathParameters, RequestAdapter); + } /// The pending property public global::Marechai.ApiClient.Software.Covers.Pending.PendingRequestBuilder Pending { diff --git a/Marechai.ApiClient/Software/Covers/Groups/GroupsRequestBuilder.cs b/Marechai.ApiClient/Software/Covers/Groups/GroupsRequestBuilder.cs new file mode 100644 index 00000000..af569a69 --- /dev/null +++ b/Marechai.ApiClient/Software/Covers/Groups/GroupsRequestBuilder.cs @@ -0,0 +1,48 @@ +// +#pragma warning disable CS0618 +using Marechai.ApiClient.Software.Covers.Groups.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace Marechai.ApiClient.Software.Covers.Groups +{ + /// + /// Builds and executes requests for operations under \software\covers\groups + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class GroupsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the Marechai.ApiClient.software.covers.groups.item collection + /// Unique identifier of the item + /// A + public global::Marechai.ApiClient.Software.Covers.Groups.Item.WithGroupItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("groupId", position); + return new global::Marechai.ApiClient.Software.Covers.Groups.Item.WithGroupItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public GroupsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/software/covers/groups", 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 GroupsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/software/covers/groups", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/Software/Covers/Groups/Item/AssignRelease/AssignReleaseRequestBuilder.cs b/Marechai.ApiClient/Software/Covers/Groups/Item/AssignRelease/AssignReleaseRequestBuilder.cs new file mode 100644 index 00000000..69fe5aad --- /dev/null +++ b/Marechai.ApiClient/Software/Covers/Groups/Item/AssignRelease/AssignReleaseRequestBuilder.cs @@ -0,0 +1,100 @@ +// +#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.Software.Covers.Groups.Item.AssignRelease +{ + /// + /// Builds and executes requests for operations under \software\covers\groups\{groupId}\assign-release + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class AssignReleaseRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public AssignReleaseRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/software/covers/groups/{groupId}/assign-release", 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 AssignReleaseRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/software/covers/groups/{groupId}/assign-release", rawUrl) + { + } + /// A + /// The request body + /// 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 401 status code + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::Marechai.ApiClient.Models.AssignCoverGroupToReleaseRequestDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::Marechai.ApiClient.Models.AssignCoverGroupToReleaseRequestDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + { "401", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + { "404", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// A + /// The request body + /// 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 ToPostRequestInformation(global::Marechai.ApiClient.Models.AssignCoverGroupToReleaseRequestDto body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::Marechai.ApiClient.Models.AssignCoverGroupToReleaseRequestDto body, Action> requestConfiguration = default) + { +#endif + if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, text/plain;q=0.9"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + 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.Software.Covers.Groups.Item.AssignRelease.AssignReleaseRequestBuilder WithUrl(string rawUrl) + { + return new global::Marechai.ApiClient.Software.Covers.Groups.Item.AssignRelease.AssignReleaseRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// 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 AssignReleaseRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/Software/Covers/Groups/Item/WithGroupItemRequestBuilder.cs b/Marechai.ApiClient/Software/Covers/Groups/Item/WithGroupItemRequestBuilder.cs new file mode 100644 index 00000000..d9273e7e --- /dev/null +++ b/Marechai.ApiClient/Software/Covers/Groups/Item/WithGroupItemRequestBuilder.cs @@ -0,0 +1,41 @@ +// +#pragma warning disable CS0618 +using Marechai.ApiClient.Software.Covers.Groups.Item.AssignRelease; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace Marechai.ApiClient.Software.Covers.Groups.Item +{ + /// + /// Builds and executes requests for operations under \software\covers\groups\{groupId} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithGroupItemRequestBuilder : BaseRequestBuilder + { + /// The assignRelease property + public global::Marechai.ApiClient.Software.Covers.Groups.Item.AssignRelease.AssignReleaseRequestBuilder AssignRelease + { + get => new global::Marechai.ApiClient.Software.Covers.Groups.Item.AssignRelease.AssignReleaseRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithGroupItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/software/covers/groups/{groupId}", 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 WithGroupItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/software/covers/groups/{groupId}", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/Software/Covers/Upload/UploadPostRequestBody.cs b/Marechai.ApiClient/Software/Covers/Upload/UploadPostRequestBody.cs index a962f617..bfb4acf5 100644 --- a/Marechai.ApiClient/Software/Covers/Upload/UploadPostRequestBody.cs +++ b/Marechai.ApiClient/Software/Covers/Upload/UploadPostRequestBody.cs @@ -29,9 +29,19 @@ namespace Marechai.ApiClient.Software.Covers.Upload #nullable restore #else public byte[] File { get; set; } +#endif + /// The groupId property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? GroupId { get; set; } +#nullable restore +#else + public string GroupId { get; set; } #endif /// The releaseId property public int? ReleaseId { get; set; } + /// The softwareId property + public int? SoftwareId { get; set; } /// The type property public int? Type { get; set; } /// @@ -61,7 +71,9 @@ namespace Marechai.ApiClient.Software.Covers.Upload { { "caption", n => { Caption = n.GetStringValue(); } }, { "file", n => { File = n.GetByteArrayValue(); } }, + { "groupId", n => { GroupId = n.GetStringValue(); } }, { "releaseId", n => { ReleaseId = n.GetIntValue(); } }, + { "softwareId", n => { SoftwareId = n.GetIntValue(); } }, { "type", n => { Type = n.GetIntValue(); } }, }; } @@ -74,7 +86,9 @@ namespace Marechai.ApiClient.Software.Covers.Upload if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); writer.WriteStringValue("caption", Caption); writer.WriteByteArrayValue("file", File); + writer.WriteStringValue("groupId", GroupId); writer.WriteIntValue("releaseId", ReleaseId); + writer.WriteIntValue("softwareId", SoftwareId); writer.WriteIntValue("type", Type); writer.WriteAdditionalData(AdditionalData); } diff --git a/Marechai.ApiClient/kiota-lock.json b/Marechai.ApiClient/kiota-lock.json index ed76c69f..08be822e 100644 --- a/Marechai.ApiClient/kiota-lock.json +++ b/Marechai.ApiClient/kiota-lock.json @@ -1,6 +1,6 @@ { - "descriptionHash": "A88EB48B54E94488C4D344ADBB16029566E71C3B603604B7A2F91B8705E8B1E5E8218E2011C3875C7649E176D644CF079C91CFDA713572F6C0B897891334950C", - "descriptionLocation": "../../../../../tmp/marechai-openapi.json", + "descriptionHash": "92F5A73B292800E8C1CFC56D5768B35B2511C183969519E08D7A58F7C587813BE421876AA47EA1D18D8ACC90E55B4F183C440C97CA6045A043E89522030A4DE8", + "descriptionLocation": "../openapi.yaml", "lockFileVersion": "1.0.0", "kiotaVersion": "1.31.1", "clientClassName": "Client", diff --git a/Marechai.Data/Dtos/AssignCoverGroupToReleaseRequestDto.cs b/Marechai.Data/Dtos/AssignCoverGroupToReleaseRequestDto.cs new file mode 100644 index 00000000..0ded7061 --- /dev/null +++ b/Marechai.Data/Dtos/AssignCoverGroupToReleaseRequestDto.cs @@ -0,0 +1,42 @@ +/****************************************************************************** +// 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.ComponentModel.DataAnnotations; +using System.Text.Json.Serialization; + +namespace Marechai.Data.Dtos; + +/// +/// Request body for +/// POST /software/covers/groups/{groupId}/assign-release. Assigns every +/// SoftwareCover sharing the given GroupId to a single +/// in one action. +/// +public class AssignCoverGroupToReleaseRequestDto +{ + [JsonPropertyName("release_id")] + [Required] + public ulong ReleaseId { get; set; } +} diff --git a/Marechai.Data/Dtos/SoftwareCoverDto.cs b/Marechai.Data/Dtos/SoftwareCoverDto.cs index be785f21..76988045 100644 --- a/Marechai.Data/Dtos/SoftwareCoverDto.cs +++ b/Marechai.Data/Dtos/SoftwareCoverDto.cs @@ -31,9 +31,14 @@ namespace Marechai.Data.Dtos; public class SoftwareCoverDto : BaseDto { + [JsonPropertyName("software_id")] + public ulong? SoftwareId { get; set; } + [JsonPropertyName("software_release_id")] - [Required] - public ulong SoftwareReleaseId { get; set; } + public ulong? SoftwareReleaseId { get; set; } + + [JsonPropertyName("group_id")] + public string? GroupId { get; set; } [JsonPropertyName("release_title")] public string? ReleaseTitle { get; set; } diff --git a/Marechai.Database/Interceptors/SearchIndexInterceptor.cs b/Marechai.Database/Interceptors/SearchIndexInterceptor.cs index 6c0000cf..14488702 100644 --- a/Marechai.Database/Interceptors/SearchIndexInterceptor.cs +++ b/Marechai.Database/Interceptors/SearchIndexInterceptor.cs @@ -270,10 +270,7 @@ public sealed class SearchIndexInterceptor : SaveChangesInterceptor ulong swId = sw.Id; bool hasImg = ctx.SoftwareScreenshots.Any(s => s.SoftwareId == swId) || ctx.SoftwarePromoArt.Any(p => p.SoftwareId == swId) || - ctx.SoftwareCovers.Any(c => ctx.SoftwareReleases - .Where(r => r.SoftwareId == swId) - .Select(r => r.Id) - .Contains(c.SoftwareReleaseId)); + ctx.SoftwareCovers.Any(c => c.SoftwareId == swId); SearchIndexUpdater.Upsert(ctx, SearchEntityType.Software, (long)sw.Id, sw.Name, null, null, null, null, hasImg, (byte)sw.Kind); return true; diff --git a/Marechai.Database/Migrations/20260622185149_MakeCoverSoftwareLinkPrimary.Designer.cs b/Marechai.Database/Migrations/20260622185149_MakeCoverSoftwareLinkPrimary.Designer.cs new file mode 100644 index 00000000..71cae141 --- /dev/null +++ b/Marechai.Database/Migrations/20260622185149_MakeCoverSoftwareLinkPrimary.Designer.cs @@ -0,0 +1,12537 @@ +// +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("20260622185149_MakeCoverSoftwareLinkPrimary")] + partial class MakeCoverSoftwareLinkPrimary + { + /// + 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("DeletionRequestedAt") + .HasColumnType("datetime(6)"); + + 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("LastLanguageVisited") + .HasMaxLength(10) + .HasColumnType("varchar(10)"); + + 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("NotifyOnNewMessage") + .HasColumnType("bit(1)"); + + 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("InternetArchiveUrl") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + 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.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.CollectedMagazineIssue", b => + { + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.Property("MagazineIssueId") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.HasKey("UserId", "MagazineIssueId"); + + b.HasIndex("MagazineIssueId"); + + b.ToTable("CollectedMagazineIssues"); + }); + + 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("InternetArchiveUrl") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + 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.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") + .HasDatabaseName("idx_genres_by_software_genre"); + + 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("longtext"); + + 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("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.InvitationCode", b => + { + b.Property("Code") + .HasMaxLength(9) + .HasColumnType("varchar(9)"); + + b.Property("CreatedById") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("CreatedOn") + .HasColumnType("datetime(6)"); + + b.Property("RowVersion") + .IsConcurrencyToken() + .HasColumnType("char(36)"); + + b.Property("UsedById") + .HasColumnType("varchar(255)"); + + b.Property("UsedOn") + .HasColumnType("datetime(6)"); + + b.HasKey("Code"); + + b.HasIndex("CreatedById"); + + b.HasIndex("CreatedOn"); + + b.HasIndex("UsedById"); + + b.ToTable("InvitationCodes"); + }); + + 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.HasIndex("Type", "Introduced") + .HasDatabaseName("idx_machines_type_introduced"); + + 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("longtext"); + + 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("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.MachinePromoArt", 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("MachineId") + .HasColumnType("int(11)"); + + b.Property("OriginalExtension") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("GroupId"); + + b.HasIndex("MachineId"); + + b.ToTable("MachinePromoArt"); + }); + + 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("CoverGuid") + .HasColumnType("char(36)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("InternetArchiveUrl") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.Property("IssueNumber") + .HasColumnType("int unsigned"); + + b.Property("MagazineId") + .HasColumnType("bigint"); + + b.Property("NativeCaption") + .HasColumnType("varchar(255)"); + + b.Property("OriginalCoverExtension") + .HasColumnType("longtext"); + + 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.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.MagazinesBySoftware", 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("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("MagazineId"); + + b.HasIndex("SoftwareId"); + + b.ToTable("MagazinesBySoftware"); + }); + + 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(2048) + .HasColumnType("varchar(2048)"); + + b.Property("CoverPageUrl") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("CoverType") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + 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.MobyGamesDiscoveredGame", 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("Developer") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("ErrorCount") + .HasColumnType("int"); + + b.Property("FetchError") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("FirstDiscoveredAt") + .HasColumnType("datetime(6)"); + + b.Property("LastSeenAt") + .HasColumnType("datetime(6)"); + + b.Property("NumericId") + .HasColumnType("int"); + + b.Property("RawFetchedAt") + .HasColumnType("datetime(6)"); + + b.Property("ReleaseYear") + .HasColumnType("int"); + + b.Property("SkippedReason") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("Title") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("NumericId"); + + b.HasIndex("RawFetchedAt"); + + b.HasIndex("ReleaseYear"); + + b.HasIndex("Slug") + .IsUnique(); + + b.ToTable("MobyGamesDiscoveredGames"); + }); + + 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.OldDosCategory", 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("EnglishName") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("LastCrawledOn") + .HasColumnType("datetime(6)"); + + b.Property("ParentId") + .HasColumnType("int"); + + b.Property("Path") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.Property("RussianName") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("ParentId"); + + b.ToTable("OldDosCategories"); + }); + + modelBuilder.Entity("Marechai.Database.Models.OldDosOsPlatformMap", b => + { + b.Property("OsName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("IgnoreOnPromote") + .HasColumnType("bit(1)"); + + b.Property("SoftwarePlatformId") + .HasColumnType("bigint unsigned"); + + b.HasKey("OsName"); + + b.HasIndex("SoftwarePlatformId"); + + b.ToTable("OldDosOsPlatformMaps"); + }); + + modelBuilder.Entity("Marechai.Database.Models.OldDosSoftware", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CrawledOn") + .HasColumnType("datetime(6)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("DeveloperName") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("EnglishDescriptionLiteral") + .HasMaxLength(262144) + .HasColumnType("longtext"); + + b.Property("EnglishDescriptionMuseum") + .HasMaxLength(262144) + .HasColumnType("longtext"); + + b.Property("LastError") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.Property("MuseumDescriptionPromptVersion") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("OldDosCategoryId") + .HasColumnType("int"); + + b.Property("OsName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("PromotedSoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("ReviewedBy") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ReviewedOn") + .HasColumnType("datetime(6)"); + + b.Property("RussianCategoryPath") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.Property("RussianDescription") + .HasMaxLength(262144) + .HasColumnType("longtext"); + + b.Property("SourceId") + .HasColumnType("int"); + + b.Property("SourceUrl") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("Status") + .HasColumnType("tinyint unsigned"); + + b.Property("SuggestedGenreIdsJson") + .HasMaxLength(4096) + .HasColumnType("varchar(4096)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("OldDosCategoryId"); + + b.HasIndex("SourceId") + .IsUnique(); + + b.HasIndex("SourceUrl") + .IsUnique(); + + b.HasIndex("Status"); + + b.ToTable("OldDosSoftwares"); + }); + + modelBuilder.Entity("Marechai.Database.Models.OldDosVersion", 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("DownloadUrl") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.Property("FileName") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("IsEnabledByDefault") + .HasColumnType("bit(1)"); + + b.Property("Notes") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.Property("OldDosSoftwareId") + .HasColumnType("bigint"); + + b.Property("OsHint") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("PromotedSoftwareVersionId") + .HasColumnType("bigint unsigned"); + + b.Property("ReleaseDate") + .HasColumnType("datetime(6)"); + + b.Property("ReleaseDatePrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("VersionString") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("OldDosSoftwareId"); + + b.ToTable("OldDosVersions"); + }); + + 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") + .HasDatabaseName("idx_people_by_software_person"); + + b.HasIndex("RoleId") + .HasDatabaseName("idx_people_by_software_role"); + + b.HasIndex("SoftwareId", "PersonId", "Role") + .IsUnique(); + + b.ToTable("PeopleBySoftware"); + }); + + modelBuilder.Entity("Marechai.Database.Models.PeopleBySoftwareRoleTranslation", 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("LanguageCode") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("char(3)"); + + b.Property("RoleText") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Translation") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("LanguageCode"); + + b.HasIndex("RoleText") + .HasDatabaseName("idx_people_by_software_role_translations_text"); + + b.HasIndex("RoleText", "LanguageCode") + .IsUnique() + .HasDatabaseName("idx_people_by_software_role_translations_text_language"); + + b.ToTable("PeopleBySoftwareRoleTranslations"); + }); + + 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("OriginalPhotoExtension") + .HasColumnType("longtext"); + + 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.PersonDescription", 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("PersonId") + .HasColumnType("int"); + + 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("PersonId", "LanguageCode") + .IsUnique() + .HasDatabaseName("idx_person_descriptions_person_language"); + + b.ToTable("PersonDescriptions"); + }); + + 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("longtext"); + + 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("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.RankingDefinition", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("ComputedAt") + .HasColumnType("datetime(6)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Dimension") + .HasColumnType("tinyint unsigned"); + + b.Property("DimensionId") + .HasColumnType("bigint"); + + b.Property("EntryCount") + .HasColumnType("int"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("Dimension", "DimensionId") + .IsUnique(); + + b.ToTable("RankingDefinitions"); + }); + + modelBuilder.Entity("Marechai.Database.Models.RankingEntry", b => + { + b.Property("RankingDefinitionId") + .HasColumnType("int unsigned"); + + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("Rank") + .HasColumnType("int"); + + b.Property("Score") + .HasColumnType("double"); + + b.HasKey("RankingDefinitionId", "SoftwareId"); + + b.HasIndex("SoftwareId") + .HasDatabaseName("idx_ranking_entries_software"); + + b.HasIndex("RankingDefinitionId", "Rank") + .HasDatabaseName("idx_ranking_entries_definition_rank"); + + b.ToTable("RankingEntries"); + }); + + 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.SearchEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AltName") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("CompanyId") + .HasColumnType("int"); + + b.Property("CountryId") + .HasColumnType("smallint"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("EntityId") + .HasColumnType("bigint"); + + b.Property("EntityType") + .HasColumnType("tinyint unsigned"); + + b.Property("HasImage") + .HasColumnType("bit(1)"); + + b.Property("Kind") + .HasColumnType("tinyint unsigned"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("Soundex") + .HasMaxLength(10) + .HasColumnType("varchar(10)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("Year") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("Soundex"); + + b.HasIndex("EntityType", "CompanyId"); + + b.HasIndex("EntityType", "CountryId"); + + b.HasIndex("EntityType", "EntityId") + .IsUnique(); + + b.HasIndex("EntityType", "Kind"); + + b.HasIndex("EntityType", "Year"); + + b.ToTable("SearchEntries", (string)null); + }); + + 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(2048) + .HasColumnType("varchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("SoftwareReleaseId", "Category", "Key"); + + b.ToTable("SoftwareAttributes"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareAttributeString", 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("Text") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("Text") + .IsUnique() + .HasDatabaseName("idx_software_attribute_strings_text"); + + b.ToTable("SoftwareAttributeStrings"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareAttributeStringTranslation", 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("LanguageCode") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("char(3)"); + + b.Property("StringId") + .HasColumnType("int"); + + b.Property("Translation") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("LanguageCode"); + + b.HasIndex("StringId", "LanguageCode") + .IsUnique() + .HasDatabaseName("idx_software_attribute_string_translations_string_language"); + + b.ToTable("SoftwareAttributeStringTranslations"); + }); + + 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("GroupId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("OriginalExtension") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + 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("GroupId"); + + b.HasIndex("SoftwareId"); + + b.HasIndex("SoftwareReleaseId"); + + b.HasIndex("Type", "SoftwareReleaseId") + .HasDatabaseName("idx_software_covers_type_release"); + + b.ToTable("SoftwareCovers"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareCoverCaptionTranslation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CaptionText") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("varchar(500)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("LanguageCode") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("char(3)"); + + b.Property("Translation") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("varchar(500)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("CaptionText") + .HasDatabaseName("idx_software_cover_caption_translations_text"); + + b.HasIndex("LanguageCode"); + + b.HasIndex("CaptionText", "LanguageCode") + .IsUnique() + .HasDatabaseName("idx_software_cover_caption_translations_text_language"); + + b.ToTable("SoftwareCoverCaptionTranslations"); + }); + + 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.SoftwareGenreTranslation", 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("GenreId") + .HasColumnType("int"); + + b.Property("LanguageCode") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("char(3)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("LanguageCode"); + + b.HasIndex("GenreId", "LanguageCode") + .IsUnique() + .HasDatabaseName("idx_software_genre_translations_genre_language"); + + b.ToTable("SoftwareGenreTranslations"); + }); + + 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.SoftwarePromoArtGroupTranslation", 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("GroupId") + .HasColumnType("int"); + + b.Property("LanguageCode") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("char(3)"); + + 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("LanguageCode"); + + b.HasIndex("GroupId", "LanguageCode") + .IsUnique() + .HasDatabaseName("idx_software_promo_art_group_translations_group_language"); + + b.ToTable("SoftwarePromoArtGroupTranslations"); + }); + + 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.SoftwareScore", b => + { + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("ComputedAt") + .HasColumnType("datetime(6)"); + + b.Property("CriticAverage") + .HasColumnType("double"); + + b.Property("CriticReviewCount") + .HasColumnType("int"); + + b.Property("GlobalRank") + .HasColumnType("int"); + + b.Property("Score") + .HasColumnType("double"); + + b.Property("UserRatingCount") + .HasColumnType("int"); + + b.Property("UserStarAverage") + .HasColumnType("double"); + + b.HasKey("SoftwareId"); + + b.HasIndex("GlobalRank") + .HasDatabaseName("idx_software_scores_global_rank"); + + b.ToTable("SoftwareScores"); + }); + + 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("GroupId") + .HasColumnType("int"); + + 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("GroupId"); + + b.HasIndex("SoftwareId"); + + b.HasIndex("SoftwarePlatformId"); + + b.HasIndex("SoftwareVersionId"); + + b.ToTable("SoftwareScreenshots"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareScreenshotCaptionTranslation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Caption") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("LanguageCode") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("char(3)"); + + b.Property("ScreenshotId") + .HasColumnType("char(36)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("LanguageCode"); + + b.HasIndex("ScreenshotId", "LanguageCode") + .IsUnique() + .HasDatabaseName("idx_software_screenshot_caption_translations_screenshot_language"); + + b.ToTable("SoftwareScreenshotCaptionTranslations"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareScreenshotGroup", 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("SoftwareScreenshotGroups"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareScreenshotGroupTranslation", 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("GroupId") + .HasColumnType("int"); + + b.Property("LanguageCode") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("char(3)"); + + 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("LanguageCode"); + + b.HasIndex("GroupId", "LanguageCode") + .IsUnique() + .HasDatabaseName("idx_software_screenshot_group_translations_group_language"); + + b.ToTable("SoftwareScreenshotGroupTranslations"); + }); + + 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("longtext"); + + 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("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.Suggestion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AdminReviewComment") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("AppliedFields") + .HasColumnType("json"); + + b.Property("CreatedById") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("EntityId") + .HasColumnType("bigint"); + + b.Property("EntityType") + .HasColumnType("tinyint unsigned"); + + b.Property("ReviewedById") + .HasColumnType("varchar(255)"); + + b.Property("ReviewedOn") + .HasColumnType("datetime(6)"); + + b.Property("Status") + .HasColumnType("tinyint unsigned"); + + b.Property("Subkey") + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("SuggestedValues") + .HasColumnType("json"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("UserComment") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("ReviewedById"); + + b.HasIndex("Status", "CreatedOn"); + + b.HasIndex("EntityType", "EntityId", "Subkey", "Status"); + + b.ToTable("Suggestions", (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("Marechai.Database.Models.WwpcCategory", 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("LastCrawledOn") + .HasColumnType("datetime(6)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ProductType") + .HasColumnType("tinyint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("ProductType", "Name") + .IsUnique(); + + b.ToTable("WwpcCategories"); + }); + + modelBuilder.Entity("Marechai.Database.Models.WwpcScreenshot", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Caption") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("CrawledOn") + .HasColumnType("datetime(6)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("ImageUrl") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("IsEnabledByDefault") + .HasColumnType("bit(1)"); + + b.Property("MajorRelease") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("PromotedSoftwareScreenshotId") + .HasColumnType("char(36)"); + + b.Property("SourceUrl") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("SuggestedSoftwarePlatformId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("WwpcSoftwareId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("SourceUrl") + .IsUnique(); + + b.HasIndex("WwpcSoftwareId"); + + b.ToTable("WwpcScreenshots"); + }); + + modelBuilder.Entity("Marechai.Database.Models.WwpcSoftware", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CrawledOn") + .HasColumnType("datetime(6)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("EnglishDescriptionMuseum") + .HasMaxLength(262144) + .HasColumnType("longtext"); + + b.Property("LastError") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.Property("MuseumDescriptionPromptVersion") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("PlatformsCsv") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ProductType") + .HasColumnType("tinyint unsigned"); + + b.Property("PromotedSoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("RawCategoriesCsv") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("RawDescription") + .HasMaxLength(262144) + .HasColumnType("longtext"); + + b.Property("ReleaseDateText") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ReviewedBy") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ReviewedOn") + .HasColumnType("datetime(6)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("SourceUrl") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("Status") + .HasColumnType("tinyint unsigned"); + + b.Property("SuggestedGenreIdsJson") + .HasMaxLength(4096) + .HasColumnType("varchar(4096)"); + + b.Property("SuggestedVendorCompanyId") + .HasColumnType("int"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("UserInterface") + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("VendorName") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("VendorUrl") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("WwpcCategoryId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ProductType"); + + b.HasIndex("Slug"); + + b.HasIndex("SourceUrl") + .IsUnique(); + + b.HasIndex("Status"); + + b.HasIndex("SuggestedVendorCompanyId"); + + b.HasIndex("WwpcCategoryId"); + + b.ToTable("WwpcSoftwares"); + }); + + modelBuilder.Entity("Marechai.Database.Models.WwpcVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Architecture") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("DownloadUrl") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.Property("IsEnabledByDefault") + .HasColumnType("bit(1)"); + + b.Property("Language") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("MajorRelease") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("MajorReleaseUrl") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("MediaKind") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("PromotedSoftwareVersionId") + .HasColumnType("bigint unsigned"); + + b.Property("SizeText") + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("VersionString") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("WwpcSoftwareId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("WwpcSoftwareId"); + + b.HasIndex("WwpcSoftwareId", "MajorRelease", "VersionString"); + + b.ToTable("WwpcVersions"); + }); + + 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.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.CollectedMagazineIssue", b => + { + b.HasOne("Marechai.Database.Models.MagazineIssue", "MagazineIssue") + .WithMany("CollectedBy") + .HasForeignKey("MagazineIssueId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "User") + .WithMany("CollectedMagazineIssues") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MagazineIssue"); + + 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.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.InvitationCode", b => + { + b.HasOne("Marechai.Database.Models.ApplicationUser", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "UsedBy") + .WithMany() + .HasForeignKey("UsedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("UsedBy"); + }); + + 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.MachinePromoArt", b => + { + b.HasOne("Marechai.Database.Models.SoftwarePromoArtGroup", "Group") + .WithMany() + .HasForeignKey("GroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Machine", "Machine") + .WithMany("PromoArt") + .HasForeignKey("MachineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Group"); + + b.Navigation("Machine"); + }); + + 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.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.MagazinesBySoftware", b => + { + b.HasOne("Marechai.Database.Models.MagazineIssue", "Magazine") + .WithMany("Software") + .HasForeignKey("MagazineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Software", "Software") + .WithMany("Magazines") + .HasForeignKey("SoftwareId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Magazine"); + + b.Navigation("Software"); + }); + + 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.OldDosCategory", b => + { + b.HasOne("Marechai.Database.Models.OldDosCategory", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Parent"); + }); + + modelBuilder.Entity("Marechai.Database.Models.OldDosOsPlatformMap", b => + { + b.HasOne("Marechai.Database.Models.SoftwarePlatform", "SoftwarePlatform") + .WithMany() + .HasForeignKey("SoftwarePlatformId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("SoftwarePlatform"); + }); + + modelBuilder.Entity("Marechai.Database.Models.OldDosSoftware", b => + { + b.HasOne("Marechai.Database.Models.OldDosCategory", "OldDosCategory") + .WithMany("Softwares") + .HasForeignKey("OldDosCategoryId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("OldDosCategory"); + }); + + modelBuilder.Entity("Marechai.Database.Models.OldDosVersion", b => + { + b.HasOne("Marechai.Database.Models.OldDosSoftware", "OldDosSoftware") + .WithMany("Versions") + .HasForeignKey("OldDosSoftwareId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("OldDosSoftware"); + }); + + 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.PeopleBySoftwareRoleTranslation", b => + { + b.HasOne("Marechai.Database.Models.Iso639", "Language") + .WithMany() + .HasForeignKey("LanguageCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_people_by_software_role_translations_language"); + + b.Navigation("Language"); + }); + + 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.PersonDescription", b => + { + b.HasOne("Marechai.Database.Models.Iso639", "Language") + .WithMany() + .HasForeignKey("LanguageCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_person_descriptions_language"); + + b.HasOne("Marechai.Database.Models.Person", "Person") + .WithMany("Descriptions") + .HasForeignKey("PersonId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Language"); + + b.Navigation("Person"); + }); + + 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.RankingEntry", b => + { + b.HasOne("Marechai.Database.Models.RankingDefinition", "RankingDefinition") + .WithMany("Entries") + .HasForeignKey("RankingDefinitionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Software", "Software") + .WithMany() + .HasForeignKey("SoftwareId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("RankingDefinition"); + + b.Navigation("Software"); + }); + + 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.SoftwareAttributeStringTranslation", b => + { + b.HasOne("Marechai.Database.Models.Iso639", "Language") + .WithMany() + .HasForeignKey("LanguageCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_software_attribute_string_translations_language"); + + b.HasOne("Marechai.Database.Models.SoftwareAttributeString", "String") + .WithMany() + .HasForeignKey("StringId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_software_attribute_string_translations_string"); + + b.Navigation("Language"); + + b.Navigation("String"); + }); + + 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.Software", "Software") + .WithMany("Covers") + .HasForeignKey("SoftwareId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("Marechai.Database.Models.SoftwareRelease", "Release") + .WithMany("Covers") + .HasForeignKey("SoftwareReleaseId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("Release"); + + b.Navigation("Software"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareCoverCaptionTranslation", b => + { + b.HasOne("Marechai.Database.Models.Iso639", "Language") + .WithMany() + .HasForeignKey("LanguageCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_software_cover_caption_translations_language"); + + b.Navigation("Language"); + }); + + 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.SoftwareGenreTranslation", b => + { + b.HasOne("Marechai.Database.Models.SoftwareGenre", "Genre") + .WithMany() + .HasForeignKey("GenreId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_software_genre_translations_genre"); + + b.HasOne("Marechai.Database.Models.Iso639", "Language") + .WithMany() + .HasForeignKey("LanguageCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_software_genre_translations_language"); + + b.Navigation("Genre"); + + b.Navigation("Language"); + }); + + 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.SoftwarePromoArtGroupTranslation", b => + { + b.HasOne("Marechai.Database.Models.SoftwarePromoArtGroup", "Group") + .WithMany() + .HasForeignKey("GroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_software_promo_art_group_translations_group"); + + b.HasOne("Marechai.Database.Models.Iso639", "Language") + .WithMany() + .HasForeignKey("LanguageCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_software_promo_art_group_translations_language"); + + b.Navigation("Group"); + + b.Navigation("Language"); + }); + + 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.SoftwareScore", b => + { + b.HasOne("Marechai.Database.Models.Software", "Software") + .WithMany() + .HasForeignKey("SoftwareId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Software"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareScreenshot", b => + { + b.HasOne("Marechai.Database.Models.SoftwareScreenshotGroup", "Group") + .WithMany("Screenshots") + .HasForeignKey("GroupId") + .OnDelete(DeleteBehavior.SetNull); + + 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("Group"); + + b.Navigation("Platform"); + + b.Navigation("Software"); + + b.Navigation("Version"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareScreenshotCaptionTranslation", b => + { + b.HasOne("Marechai.Database.Models.Iso639", "Language") + .WithMany() + .HasForeignKey("LanguageCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_software_screenshot_caption_translations_language"); + + b.HasOne("Marechai.Database.Models.SoftwareScreenshot", "Screenshot") + .WithMany() + .HasForeignKey("ScreenshotId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_software_screenshot_caption_translations_screenshot"); + + b.Navigation("Language"); + + b.Navigation("Screenshot"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareScreenshotGroupTranslation", b => + { + b.HasOne("Marechai.Database.Models.SoftwareScreenshotGroup", "Group") + .WithMany() + .HasForeignKey("GroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_software_screenshot_group_translations_group"); + + b.HasOne("Marechai.Database.Models.Iso639", "Language") + .WithMany() + .HasForeignKey("LanguageCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_software_screenshot_group_translations_language"); + + b.Navigation("Group"); + + b.Navigation("Language"); + }); + + 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.Suggestion", b => + { + b.HasOne("Marechai.Database.Models.ApplicationUser", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "ReviewedBy") + .WithMany() + .HasForeignKey("ReviewedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("ReviewedBy"); + }); + + 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("Marechai.Database.Models.WwpcScreenshot", b => + { + b.HasOne("Marechai.Database.Models.WwpcSoftware", "WwpcSoftware") + .WithMany("Screenshots") + .HasForeignKey("WwpcSoftwareId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("WwpcSoftware"); + }); + + modelBuilder.Entity("Marechai.Database.Models.WwpcSoftware", b => + { + b.HasOne("Marechai.Database.Models.WwpcCategory", "WwpcCategory") + .WithMany("Softwares") + .HasForeignKey("WwpcCategoryId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("WwpcCategory"); + }); + + modelBuilder.Entity("Marechai.Database.Models.WwpcVersion", b => + { + b.HasOne("Marechai.Database.Models.WwpcSoftware", "WwpcSoftware") + .WithMany("Versions") + .HasForeignKey("WwpcSoftwareId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("WwpcSoftware"); + }); + + 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("CollectedBooks"); + + b.Navigation("CollectedDocuments"); + + b.Navigation("CollectedMagazineIssues"); + + b.Navigation("CollectedSoftwareReleases"); + + b.Navigation("Dumps"); + + 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("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("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("PromoArt"); + + 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("CollectedBy"); + + b.Navigation("Coverdiscs"); + + b.Navigation("MachineFamilies"); + + b.Navigation("Machines"); + + b.Navigation("People"); + + b.Navigation("Software"); + }); + + 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.OldDosCategory", b => + { + b.Navigation("Children"); + + b.Navigation("Softwares"); + }); + + modelBuilder.Entity("Marechai.Database.Models.OldDosSoftware", b => + { + b.Navigation("Versions"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Person", b => + { + b.Navigation("Books"); + + b.Navigation("Companies"); + + b.Navigation("Descriptions"); + + 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.RankingDefinition", b => + { + b.Navigation("Entries"); + }); + + 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("Covers"); + + b.Navigation("Credits"); + + b.Navigation("CriticReviews"); + + b.Navigation("Descriptions"); + + b.Navigation("DirectReleases"); + + b.Navigation("Genres"); + + b.Navigation("Magazines"); + + 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.SoftwareScreenshotGroup", b => + { + b.Navigation("Screenshots"); + }); + + 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"); + }); + + modelBuilder.Entity("Marechai.Database.Models.WwpcCategory", b => + { + b.Navigation("Softwares"); + }); + + modelBuilder.Entity("Marechai.Database.Models.WwpcSoftware", b => + { + b.Navigation("Screenshots"); + + b.Navigation("Versions"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Marechai.Database/Migrations/20260622185149_MakeCoverSoftwareLinkPrimary.cs b/Marechai.Database/Migrations/20260622185149_MakeCoverSoftwareLinkPrimary.cs new file mode 100644 index 00000000..1caee0c3 --- /dev/null +++ b/Marechai.Database/Migrations/20260622185149_MakeCoverSoftwareLinkPrimary.cs @@ -0,0 +1,234 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Marechai.Database.Migrations +{ + /// + public partial class MakeCoverSoftwareLinkPrimary : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + // Every step below is existence-checked: MySQL/MariaDB DDL is not transactional, so a + // statement failing partway through this migration can leave earlier ALTERs already + // committed. Re-running it after a partial failure must complete the remaining work + // instead of erroring on steps that already applied. + + migrationBuilder.Sql(@" + SET @fk_exists = (SELECT COUNT(*) FROM information_schema.TABLE_CONSTRAINTS + WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'SoftwareCovers' + AND CONSTRAINT_NAME = 'FK_SoftwareCovers_SoftwareReleases_SoftwareReleaseId'); + SET @sql = IF(@fk_exists > 0, + 'ALTER TABLE `SoftwareCovers` DROP FOREIGN KEY `FK_SoftwareCovers_SoftwareReleases_SoftwareReleaseId`', + 'SELECT 1'); + PREPARE stmt FROM @sql; + EXECUTE stmt; + DEALLOCATE PREPARE stmt; + "); + + migrationBuilder.Sql(@" + SET @col_nullable = (SELECT IS_NULLABLE FROM information_schema.COLUMNS + WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'SoftwareCovers' AND COLUMN_NAME = 'SoftwareReleaseId'); + SET @sql = IF(@col_nullable = 'NO', + 'ALTER TABLE `SoftwareCovers` MODIFY COLUMN `SoftwareReleaseId` bigint unsigned NULL', + 'SELECT 1'); + PREPARE stmt FROM @sql; + EXECUTE stmt; + DEALLOCATE PREPARE stmt; + "); + + migrationBuilder.Sql(@" + SET @col_exists = (SELECT COUNT(*) FROM information_schema.COLUMNS + WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'SoftwareCovers' AND COLUMN_NAME = 'GroupId'); + SET @sql = IF(@col_exists = 0, + 'ALTER TABLE `SoftwareCovers` ADD COLUMN `GroupId` varchar(64) CHARACTER SET utf8mb4 NULL', + 'SELECT 1'); + PREPARE stmt FROM @sql; + EXECUTE stmt; + DEALLOCATE PREPARE stmt; + "); + + migrationBuilder.Sql(@" + SET @col_exists = (SELECT COUNT(*) FROM information_schema.COLUMNS + WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'SoftwareCovers' AND COLUMN_NAME = 'SoftwareId'); + SET @sql = IF(@col_exists = 0, + 'ALTER TABLE `SoftwareCovers` ADD COLUMN `SoftwareId` bigint unsigned NULL', + 'SELECT 1'); + PREPARE stmt FROM @sql; + EXECUTE stmt; + DEALLOCATE PREPARE stmt; + "); + + // A previous partial application of this migration (MySQL/MariaDB DDL isn't + // transactional) may have already added SoftwareId as NOT NULL DEFAULT 0 before + // failing on a later step. Make sure it ends up nullable regardless of which path + // added it, otherwise the backfill below fails for compilation-release covers. + migrationBuilder.Sql(@" + SET @col_nullable = (SELECT IS_NULLABLE FROM information_schema.COLUMNS + WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'SoftwareCovers' AND COLUMN_NAME = 'SoftwareId'); + SET @sql = IF(@col_nullable = 'NO', + 'ALTER TABLE `SoftwareCovers` MODIFY COLUMN `SoftwareId` bigint unsigned NULL', + 'SELECT 1'); + PREPARE stmt FROM @sql; + EXECUTE stmt; + DEALLOCATE PREPARE stmt; + "); + + // Backfill: every row existing before this migration has a SoftwareReleaseId. Most + // resolve to a single owning Software (direct, or via the release's SoftwareVersion); + // covers attached to a compilation release (which bundles several Software entries + // with no single owner) are left NULL here and stay anchored by SoftwareReleaseId + // alone, same as before this migration. Naturally idempotent — only touches rows that + // still have a SoftwareReleaseId and re-derives the same value on a re-run. + migrationBuilder.Sql(@" + UPDATE SoftwareCovers sc + JOIN SoftwareReleases sr ON sr.Id = sc.SoftwareReleaseId + LEFT JOIN SoftwareVersions sv ON sv.Id = sr.SoftwareVersionId + SET sc.SoftwareId = COALESCE(sr.SoftwareId, sv.SoftwareId) + WHERE sc.SoftwareReleaseId IS NOT NULL; + "); + + migrationBuilder.Sql(@" + SET @idx_exists = (SELECT COUNT(*) FROM information_schema.STATISTICS + WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'SoftwareCovers' AND INDEX_NAME = 'IX_SoftwareCovers_GroupId'); + SET @sql = IF(@idx_exists = 0, + 'CREATE INDEX `IX_SoftwareCovers_GroupId` ON `SoftwareCovers` (`GroupId`)', + 'SELECT 1'); + PREPARE stmt FROM @sql; + EXECUTE stmt; + DEALLOCATE PREPARE stmt; + "); + + migrationBuilder.Sql(@" + SET @idx_exists = (SELECT COUNT(*) FROM information_schema.STATISTICS + WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'SoftwareCovers' AND INDEX_NAME = 'IX_SoftwareCovers_SoftwareId'); + SET @sql = IF(@idx_exists = 0, + 'CREATE INDEX `IX_SoftwareCovers_SoftwareId` ON `SoftwareCovers` (`SoftwareId`)', + 'SELECT 1'); + PREPARE stmt FROM @sql; + EXECUTE stmt; + DEALLOCATE PREPARE stmt; + "); + + migrationBuilder.Sql(@" + SET @fk_exists = (SELECT COUNT(*) FROM information_schema.TABLE_CONSTRAINTS + WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'SoftwareCovers' + AND CONSTRAINT_NAME = 'FK_SoftwareCovers_SoftwareReleases_SoftwareReleaseId'); + SET @sql = IF(@fk_exists = 0, + 'ALTER TABLE `SoftwareCovers` ADD CONSTRAINT `FK_SoftwareCovers_SoftwareReleases_SoftwareReleaseId` FOREIGN KEY (`SoftwareReleaseId`) REFERENCES `SoftwareReleases` (`Id`) ON DELETE SET NULL', + 'SELECT 1'); + PREPARE stmt FROM @sql; + EXECUTE stmt; + DEALLOCATE PREPARE stmt; + "); + + migrationBuilder.Sql(@" + SET @fk_exists = (SELECT COUNT(*) FROM information_schema.TABLE_CONSTRAINTS + WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'SoftwareCovers' + AND CONSTRAINT_NAME = 'FK_SoftwareCovers_Softwares_SoftwareId'); + SET @sql = IF(@fk_exists = 0, + 'ALTER TABLE `SoftwareCovers` ADD CONSTRAINT `FK_SoftwareCovers_Softwares_SoftwareId` FOREIGN KEY (`SoftwareId`) REFERENCES `Softwares` (`Id`) ON DELETE CASCADE', + 'SELECT 1'); + PREPARE stmt FROM @sql; + EXECUTE stmt; + DEALLOCATE PREPARE stmt; + "); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.Sql(@" + SET @fk_exists = (SELECT COUNT(*) FROM information_schema.TABLE_CONSTRAINTS + WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'SoftwareCovers' + AND CONSTRAINT_NAME = 'FK_SoftwareCovers_SoftwareReleases_SoftwareReleaseId'); + SET @sql = IF(@fk_exists > 0, + 'ALTER TABLE `SoftwareCovers` DROP FOREIGN KEY `FK_SoftwareCovers_SoftwareReleases_SoftwareReleaseId`', + 'SELECT 1'); + PREPARE stmt FROM @sql; + EXECUTE stmt; + DEALLOCATE PREPARE stmt; + "); + + migrationBuilder.Sql(@" + SET @fk_exists = (SELECT COUNT(*) FROM information_schema.TABLE_CONSTRAINTS + WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'SoftwareCovers' + AND CONSTRAINT_NAME = 'FK_SoftwareCovers_Softwares_SoftwareId'); + SET @sql = IF(@fk_exists > 0, + 'ALTER TABLE `SoftwareCovers` DROP FOREIGN KEY `FK_SoftwareCovers_Softwares_SoftwareId`', + 'SELECT 1'); + PREPARE stmt FROM @sql; + EXECUTE stmt; + DEALLOCATE PREPARE stmt; + "); + + migrationBuilder.Sql(@" + SET @idx_exists = (SELECT COUNT(*) FROM information_schema.STATISTICS + WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'SoftwareCovers' AND INDEX_NAME = 'IX_SoftwareCovers_GroupId'); + SET @sql = IF(@idx_exists > 0, + 'DROP INDEX `IX_SoftwareCovers_GroupId` ON `SoftwareCovers`', + 'SELECT 1'); + PREPARE stmt FROM @sql; + EXECUTE stmt; + DEALLOCATE PREPARE stmt; + "); + + migrationBuilder.Sql(@" + SET @idx_exists = (SELECT COUNT(*) FROM information_schema.STATISTICS + WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'SoftwareCovers' AND INDEX_NAME = 'IX_SoftwareCovers_SoftwareId'); + SET @sql = IF(@idx_exists > 0, + 'DROP INDEX `IX_SoftwareCovers_SoftwareId` ON `SoftwareCovers`', + 'SELECT 1'); + PREPARE stmt FROM @sql; + EXECUTE stmt; + DEALLOCATE PREPARE stmt; + "); + + migrationBuilder.Sql(@" + SET @col_exists = (SELECT COUNT(*) FROM information_schema.COLUMNS + WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'SoftwareCovers' AND COLUMN_NAME = 'GroupId'); + SET @sql = IF(@col_exists > 0, + 'ALTER TABLE `SoftwareCovers` DROP COLUMN `GroupId`', + 'SELECT 1'); + PREPARE stmt FROM @sql; + EXECUTE stmt; + DEALLOCATE PREPARE stmt; + "); + + migrationBuilder.Sql(@" + SET @col_exists = (SELECT COUNT(*) FROM information_schema.COLUMNS + WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'SoftwareCovers' AND COLUMN_NAME = 'SoftwareId'); + SET @sql = IF(@col_exists > 0, + 'ALTER TABLE `SoftwareCovers` DROP COLUMN `SoftwareId`', + 'SELECT 1'); + PREPARE stmt FROM @sql; + EXECUTE stmt; + DEALLOCATE PREPARE stmt; + "); + + migrationBuilder.Sql(@" + SET @col_nullable = (SELECT IS_NULLABLE FROM information_schema.COLUMNS + WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'SoftwareCovers' AND COLUMN_NAME = 'SoftwareReleaseId'); + SET @sql = IF(@col_nullable = 'YES', + 'ALTER TABLE `SoftwareCovers` MODIFY COLUMN `SoftwareReleaseId` bigint unsigned NOT NULL DEFAULT 0', + 'SELECT 1'); + PREPARE stmt FROM @sql; + EXECUTE stmt; + DEALLOCATE PREPARE stmt; + "); + + migrationBuilder.Sql(@" + SET @fk_exists = (SELECT COUNT(*) FROM information_schema.TABLE_CONSTRAINTS + WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'SoftwareCovers' + AND CONSTRAINT_NAME = 'FK_SoftwareCovers_SoftwareReleases_SoftwareReleaseId'); + SET @sql = IF(@fk_exists = 0, + 'ALTER TABLE `SoftwareCovers` ADD CONSTRAINT `FK_SoftwareCovers_SoftwareReleases_SoftwareReleaseId` FOREIGN KEY (`SoftwareReleaseId`) REFERENCES `SoftwareReleases` (`Id`) ON DELETE CASCADE', + 'SELECT 1'); + PREPARE stmt FROM @sql; + EXECUTE stmt; + DEALLOCATE PREPARE stmt; + "); + } + } +} diff --git a/Marechai.Database/Migrations/MarechaiContextModelSnapshot.cs b/Marechai.Database/Migrations/MarechaiContextModelSnapshot.cs index c89289d9..e81dea71 100644 --- a/Marechai.Database/Migrations/MarechaiContextModelSnapshot.cs +++ b/Marechai.Database/Migrations/MarechaiContextModelSnapshot.cs @@ -7321,11 +7321,18 @@ namespace Marechai.Database.Migrations MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + b.Property("GroupId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + b.Property("OriginalExtension") .IsRequired() .HasColumnType("longtext"); - b.Property("SoftwareReleaseId") + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("SoftwareReleaseId") .HasColumnType("bigint unsigned"); b.Property("Type") @@ -7339,6 +7346,10 @@ namespace Marechai.Database.Migrations b.HasKey("Id"); + b.HasIndex("GroupId"); + + b.HasIndex("SoftwareId"); + b.HasIndex("SoftwareReleaseId"); b.HasIndex("Type", "SoftwareReleaseId") @@ -11323,13 +11334,19 @@ namespace Marechai.Database.Migrations modelBuilder.Entity("Marechai.Database.Models.SoftwareCover", b => { + b.HasOne("Marechai.Database.Models.Software", "Software") + .WithMany("Covers") + .HasForeignKey("SoftwareId") + .OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.SoftwareRelease", "Release") .WithMany("Covers") .HasForeignKey("SoftwareReleaseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + .OnDelete(DeleteBehavior.SetNull); b.Navigation("Release"); + + b.Navigation("Software"); }); modelBuilder.Entity("Marechai.Database.Models.SoftwareCoverCaptionTranslation", b => @@ -12362,6 +12379,8 @@ namespace Marechai.Database.Migrations b.Navigation("CompilationReleases"); + b.Navigation("Covers"); + b.Navigation("Credits"); b.Navigation("CriticReviews"); diff --git a/Marechai.Database/Models/MarechaiContext.cs b/Marechai.Database/Models/MarechaiContext.cs index dbd4c2a3..176f891d 100644 --- a/Marechai.Database/Models/MarechaiContext.cs +++ b/Marechai.Database/Models/MarechaiContext.cs @@ -2580,6 +2580,8 @@ public class MarechaiContext : IdentityDbContext(entity => { entity.HasIndex(x => x.SoftwareReleaseId); + entity.HasIndex(x => x.SoftwareId); + entity.HasIndex(x => x.GroupId); // Type-leading composite for the FrontCoverId backfill query // (`PopulateFrontCoverIdsAsync` in SoftwareController), which filters @@ -2589,10 +2591,17 @@ public class MarechaiContext : IdentityDbContext new { x.Type, x.SoftwareReleaseId }) .HasDatabaseName("idx_software_covers_type_release"); + entity.HasOne(x => x.Software) + .WithMany(x => x.Covers) + .HasForeignKey(x => x.SoftwareId) + .IsRequired(false) + .OnDelete(DeleteBehavior.Cascade); + entity.HasOne(x => x.Release) .WithMany(x => x.Covers) .HasForeignKey(x => x.SoftwareReleaseId) - .OnDelete(DeleteBehavior.Cascade); + .IsRequired(false) + .OnDelete(DeleteBehavior.SetNull); }); modelBuilder.Entity(entity => diff --git a/Marechai.Database/Models/Software.cs b/Marechai.Database/Models/Software.cs index 8857bf8a..9c68b948 100644 --- a/Marechai.Database/Models/Software.cs +++ b/Marechai.Database/Models/Software.cs @@ -20,6 +20,7 @@ public class Software : BaseModel public virtual ICollection Versions { get; set; } public virtual ICollection CompanyRoles { get; set; } public virtual ICollection Screenshots { get; set; } + public virtual ICollection Covers { get; set; } public virtual ICollection DirectReleases { get; set; } public virtual ICollection CompilationReleases { get; set; } public virtual ICollection Descriptions { get; set; } diff --git a/Marechai.Database/Models/SoftwareCover.cs b/Marechai.Database/Models/SoftwareCover.cs index 74cca30d..ba3e62ba 100644 --- a/Marechai.Database/Models/SoftwareCover.cs +++ b/Marechai.Database/Models/SoftwareCover.cs @@ -31,10 +31,17 @@ namespace Marechai.Database.Models; public class SoftwareCover : BaseModel { - [Required] - public ulong SoftwareReleaseId { get; set; } + // Nullable: a cover attached to a compilation release (which bundles several Software + // entries with no single owner) is anchored by SoftwareReleaseId alone instead. + public ulong? SoftwareId { get; set; } + public virtual Software Software { get; set; } + + public ulong? SoftwareReleaseId { get; set; } public virtual SoftwareRelease Release { get; set; } + [StringLength(64)] + public string GroupId { get; set; } + [Required] public SoftwareCoverType Type { get; set; } diff --git a/Marechai.MobyGames/Program.cs b/Marechai.MobyGames/Program.cs index b579b9f8..9800ee2a 100644 --- a/Marechai.MobyGames/Program.cs +++ b/Marechai.MobyGames/Program.cs @@ -148,8 +148,7 @@ class Program var coverStateService = new CoverStateService(factory); var coverDownloadService = new CoverDownloadService( - factory, sourceDb, platformMatcher, countryMatcher, - coverStateService, httpClient, assetRoot ?? ""); + factory, sourceDb, coverStateService, httpClient, assetRoot ?? ""); try { @@ -171,6 +170,30 @@ class Program break; } + case "repair-covers": + { + int repairBatchSize = 1000; + bool repairDryRun = false; + + for(int i = 0; i < args.Length; i++) + { + if(args[i] == "--batch-size" && i + 1 < args.Length && int.TryParse(args[i + 1], out int rbs)) + repairBatchSize = rbs; + + if(args[i] == "--dry-run") + repairDryRun = true; + } + + var repairStateService = new CoverStateService(factory); + + var repairService = new CoverDownloadService( + factory, sourceDb, repairStateService, httpClient: null, assetRootPath: ""); + + await repairService.RepairMisassignedCoversAsync(repairDryRun, repairBatchSize); + + break; + } + case "import-reviews": { int reviewBatchSize = config.GetValue("Import:BatchSize", 500); diff --git a/Marechai.MobyGames/Services/CoverDownloadService.cs b/Marechai.MobyGames/Services/CoverDownloadService.cs index 91c454a3..62ed7fd8 100644 --- a/Marechai.MobyGames/Services/CoverDownloadService.cs +++ b/Marechai.MobyGames/Services/CoverDownloadService.cs @@ -16,8 +16,6 @@ public class CoverDownloadService { readonly IDbContextFactory _contextFactory; readonly SourceDatabaseService _sourceDb; - readonly PlatformMatcher _platformMatcher; - readonly CountryMatcher _countryMatcher; readonly CoverStateService _coverStateService; readonly MobyGamesHttpClient _httpClient; readonly string _assetRootPath; @@ -25,16 +23,12 @@ public class CoverDownloadService public CoverDownloadService( IDbContextFactory contextFactory, SourceDatabaseService sourceDb, - PlatformMatcher platformMatcher, - CountryMatcher countryMatcher, CoverStateService coverStateService, MobyGamesHttpClient httpClient, string assetRootPath) { _contextFactory = contextFactory; _sourceDb = sourceDb; - _platformMatcher = platformMatcher; - _countryMatcher = countryMatcher; _coverStateService = coverStateService; _httpClient = httpClient; _assetRootPath = assetRootPath; @@ -55,11 +49,6 @@ public class CoverDownloadService ? $"\n Starting cover download \e[33;1m(--download-only: conversion skipped, writing to {photosRoot}/)\e[0m...\n" : "\n Starting cover download...\n"); - // Load reference data - Console.WriteLine(" Loading reference data..."); - await _platformMatcher.LoadAsync(); - await _countryMatcher.LoadAsync(); - // Get all imported games with SoftwareId await using var context = await _contextFactory.CreateDbContextAsync(); @@ -78,7 +67,6 @@ public class CoverDownloadService int totalCovers = 0; int matchedCovers = 0; - int unmatchedCovers = 0; int downloadedCount = 0; int skippedCount = 0; int failedCount = 0; @@ -181,33 +169,11 @@ public class CoverDownloadService if(!string.IsNullOrWhiteSpace(group.Packaging)) Console.WriteLine($" Packaging: {group.Packaging}"); - // Match platform - var platform = await _platformMatcher.MatchOrCreateAsync(group.Platform); - - // Match countries to UnM49 - var matchedCountries = new List(); - - foreach(string country in group.Countries) - { - var unm49 = _countryMatcher.Match(country); - - if(unm49 is not null) - matchedCountries.Add(unm49); - } - - // Find best matching SoftwareRelease - var release = await FindBestReleaseAsync( - game.SoftwareId!.Value, platform?.Id, matchedCountries); - - if(release is not null) - { - Console.WriteLine($" \e[32mMatched release #{release.Id}\e[0m"); - } - else - { - Console.WriteLine($" \e[33m[NO RELEASE]\e[0m"); - } - + // Covers are no longer attached to a specific SoftwareRelease at import time — + // a region-specific cover is evidence a matching release MAY exist, not proof of + // which one. Every cover is downloaded and clustered by Software + GroupId + // instead; correct release attribution (if any) is left to manual curation via + // the admin cover UI's "assign group to release" action. foreach(var cover in group.Covers) { string coverTypeStr = cover.Type; @@ -215,16 +181,8 @@ public class CoverDownloadService if(dryRun) { - string releaseStr = release is not null - ? $"→ Release #{release.Id}" - : "\e[33m[NO RELEASE]\e[0m"; - - Console.WriteLine($" {coverTypeStr,-25} cover-{cover.CoverId} {releaseStr}"); - - if(release is not null) - matchedCovers++; - else - unmatchedCovers++; + Console.WriteLine($" {coverTypeStr,-25} cover-{cover.CoverId} group {group.GroupId}"); + matchedCovers++; continue; } @@ -247,44 +205,19 @@ public class CoverDownloadService continue; } - if(release is null) - { - // No matching release — track as NoRelease - if(existingState is null) - { - await _coverStateService.CreateStateAsync(new MobyGamesCoverDownloadState - { - MobyGameId = game.MobyGameId, - SoftwareId = game.SoftwareId!.Value, - CoverPageUrl = cover.DetailPageUrl, - CoverType = coverTypeStr, - Platform = Truncate(group.Platform, 256), - Countries = string.Join(", ", group.Countries), - GroupId = group.GroupId, - Status = MobyGamesCoverDownloadStatus.NoRelease, - ProcessedOn = DateTime.UtcNow - }); - } - - unmatchedCovers++; - - continue; - } - // Create or get state record if(existingState is null) { existingState = new MobyGamesCoverDownloadState { - MobyGameId = game.MobyGameId, - SoftwareId = game.SoftwareId!.Value, - CoverPageUrl = cover.DetailPageUrl, - CoverType = coverTypeStr, - Platform = Truncate(group.Platform, 256), - Countries = string.Join(", ", group.Countries), - GroupId = group.GroupId, - Status = MobyGamesCoverDownloadStatus.Pending, - SoftwareReleaseId = release.Id + MobyGameId = game.MobyGameId, + SoftwareId = game.SoftwareId!.Value, + CoverPageUrl = cover.DetailPageUrl, + CoverType = coverTypeStr, + Platform = Truncate(group.Platform, 256), + Countries = string.Join(", ", group.Countries), + GroupId = group.GroupId, + Status = MobyGamesCoverDownloadStatus.Pending }; await _coverStateService.CreateStateAsync(existingState); @@ -362,7 +295,8 @@ public class CoverDownloadService var softwareCover = new SoftwareCover { Id = coverId, - SoftwareReleaseId = release.Id, + SoftwareId = game.SoftwareId!.Value, + GroupId = group.GroupId, Type = coverType, Caption = coverTypeStr, OriginalExtension = extension @@ -414,8 +348,7 @@ public class CoverDownloadService Console.WriteLine(" \e[33;1m[DRY RUN]\e[0m No changes made"); Console.WriteLine($" Games scanned: {gamesProcessed}"); Console.WriteLine($" Total covers found: {totalCovers}"); - Console.WriteLine($" Matched to release: {matchedCovers}"); - Console.WriteLine($" No matching release: {unmatchedCovers}"); + Console.WriteLine($" Would download: {matchedCovers}"); } else { @@ -424,56 +357,98 @@ public class CoverDownloadService Console.WriteLine($" Downloaded: {downloadedCount}"); Console.WriteLine($" Skipped (existing): {skippedCount}"); Console.WriteLine($" Failed: {failedCount}"); - Console.WriteLine($" No matching release: {unmatchedCovers}"); } Console.WriteLine(" ────────────────────────────────────\n"); } - async Task FindBestReleaseAsync(ulong softwareId, ulong? platformId, - List matchedCountries) + /// + /// One-time/idempotent remediation for covers downloaded before the importer stopped + /// forcing every cover onto a (possibly wrong) . Every + /// row in that reached + /// and has a linked + /// already carries everything needed to fix it — no + /// network access required. The cover's SoftwareReleaseId is cleared and its + /// SoftwareId/GroupId are (re)populated from the state row, so it stops + /// sitting on a release it was never actually evidence for and becomes correctly + /// clustered with the rest of its original MobyGames cover group instead. Re-running + /// this after a real pass is a no-op for already-fixed rows. + /// + public async Task RepairMisassignedCoversAsync(bool dryRun, int batchSize = 1000) { + Console.WriteLine(dryRun + ? "\n \e[33;1m[DRY RUN]\e[0m Scanning for misassigned covers...\n" + : "\n Repairing misassigned covers...\n"); + await using var context = await _contextFactory.CreateDbContextAsync(); - // Get all releases for this software - var releases = await context.SoftwareReleases - .Where(r => r.SoftwareId == softwareId) - .Include(r => r.Regions) - .ToListAsync(); + int scanned = 0; + int detached = 0; + int skipped = 0; + long lastId = 0; - if(releases.Count == 0) return null; - - // Filter by platform if we have one - var candidates = platformId is not null - ? releases.Where(r => r.PlatformId == platformId).ToList() - : releases; - - // If platform filter emptied our candidates, fall back to all releases - if(candidates.Count == 0) - candidates = releases; - - if(candidates.Count == 1) return candidates[0]; - - // Score by country overlap - if(matchedCountries.Count > 0) + while(true) { - var countryIds = matchedCountries.Select(c => c.Id).ToHashSet(); + List batch = await context.MobyGamesCoverDownloadStates + .Where(s => s.Id > lastId && + s.Status == + MobyGamesCoverDownloadStatus + .Downloaded && + s.SoftwareCoverId != null) + .OrderBy(s => s.Id) + .Take(batchSize) + .ToListAsync(); - var scored = candidates - .Select(r => new - { - Release = r, - Score = r.Regions?.Count(reg => countryIds.Contains(reg.UnM49Id)) ?? 0 - }) - .OrderByDescending(x => x.Score) - .ToList(); + if(batch.Count == 0) break; - // Return the best match if it has any overlap - if(scored[0].Score > 0) return scored[0].Release; + lastId = batch[^1].Id; + + foreach(MobyGamesCoverDownloadState state in batch) + { + scanned++; + + SoftwareCover cover = await context.SoftwareCovers.FirstOrDefaultAsync(c => c.Id == state.SoftwareCoverId); + + if(cover is null) + { + skipped++; + + continue; + } + + bool alreadyCorrect = cover.SoftwareReleaseId is null && + cover.SoftwareId == state.SoftwareId && + cover.GroupId == state.GroupId; + + if(alreadyCorrect) + { + skipped++; + + continue; + } + + Console.WriteLine($" [DETACH] cover {cover.Id}: release {cover.SoftwareReleaseId} -> " + + $"software {state.SoftwareId}, group {state.GroupId ?? "(none)"}"); + + if(!dryRun) + { + cover.SoftwareReleaseId = null; + cover.SoftwareId = state.SoftwareId; + cover.GroupId = state.GroupId; + } + + detached++; + } + + if(!dryRun) await context.SaveChangesAsync(); } - // Fallback: return the first candidate - return candidates.FirstOrDefault(); + Console.WriteLine("\n ────────────────────────────────────"); + Console.WriteLine(dryRun ? " \e[33;1m[DRY RUN]\e[0m No changes made" : " Repair complete"); + Console.WriteLine($" Scanned: {scanned}"); + Console.WriteLine($" Detached/fixed: {detached}"); + Console.WriteLine($" Already correct/skipped: {skipped}"); + Console.WriteLine(" ────────────────────────────────────\n"); } static SoftwareCoverType MapCoverType(string mobyType) diff --git a/Marechai.Server/Controllers/SoftwareController.cs b/Marechai.Server/Controllers/SoftwareController.cs index 5c986385..03dd751d 100644 --- a/Marechai.Server/Controllers/SoftwareController.cs +++ b/Marechai.Server/Controllers/SoftwareController.cs @@ -116,49 +116,22 @@ public class SoftwareController(MarechaiContext context, IMemoryCache cache, Use if(softwareIds.Count > 0) { - // Path 1: cover.Release.SoftwareId — release attached to software directly. - // Index used: SoftwareReleases.SoftwareId + SoftwareCovers.SoftwareReleaseId. - var direct = await context.SoftwareCovers - .Where(sc => sc.Type == SoftwareCoverType.Front && - sc.Release.SoftwareId.HasValue && - softwareIds.Contains(sc.Release.SoftwareId.Value)) - .Select(sc => new - { - SoftwareId = sc.Release.SoftwareId.Value, - CoverId = sc.Id - }) - .ToListAsync(ct); + // SoftwareCovers.SoftwareId is the direct, always-populated link to the owning + // Software, regardless of whether (or which) release the cover has been attached + // to — no need to traverse Release/SoftwareVersion to find it. + var rows = await context.SoftwareCovers + .Where(sc => sc.Type == SoftwareCoverType.Front && + sc.SoftwareId.HasValue && + softwareIds.Contains(sc.SoftwareId.Value)) + .Select(sc => new + { + SoftwareId = sc.SoftwareId.Value, + CoverId = sc.Id + }) + .ToListAsync(ct); - foreach(IGrouping g in direct.GroupBy(x => x.SoftwareId, x => x.CoverId)) + foreach(IGrouping g in rows.GroupBy(x => x.SoftwareId, x => x.CoverId)) softwareCovers[g.Key] = g.Min(); - - // Path 2: cover.Release.SoftwareVersion.SoftwareId — release attached to a - // version of the software. SoftwareVersion.SoftwareId is non-nullable ulong. - var indirect = await context.SoftwareCovers - .Where(sc => sc.Type == SoftwareCoverType.Front && - sc.Release.SoftwareVersionId.HasValue && - softwareIds.Contains(sc.Release.SoftwareVersion.SoftwareId)) - .Select(sc => new - { - SoftwareId = sc.Release.SoftwareVersion.SoftwareId, - CoverId = sc.Id - }) - .ToListAsync(ct); - - foreach(IGrouping g in indirect.GroupBy(x => x.SoftwareId, x => x.CoverId)) - { - Guid candidate = g.Min(); - - if(softwareCovers.TryGetValue(g.Key, out Guid existing)) - { - // Both paths matched: pick the lower Guid to mirror the original - // FirstOrDefault(OrderBy(Id)) semantics across the union of covers. - if(candidate.CompareTo(existing) < 0) - softwareCovers[g.Key] = candidate; - } - else - softwareCovers[g.Key] = candidate; - } } var compilationCovers = new Dictionary(); @@ -169,10 +142,11 @@ public class SoftwareController(MarechaiContext context, IMemoryCache cache, Use // covers directly via SoftwareCovers.SoftwareReleaseId (single indexed column). var rows = await context.SoftwareCovers .Where(sc => sc.Type == SoftwareCoverType.Front && - compilationReleaseIds.Contains(sc.SoftwareReleaseId)) + sc.SoftwareReleaseId.HasValue && + compilationReleaseIds.Contains(sc.SoftwareReleaseId.Value)) .Select(sc => new { - ReleaseId = sc.SoftwareReleaseId, + ReleaseId = sc.SoftwareReleaseId.Value, CoverId = sc.Id }) .ToListAsync(ct); diff --git a/Marechai.Server/Controllers/SoftwareCoversController.cs b/Marechai.Server/Controllers/SoftwareCoversController.cs index 7ec5bb87..7dc2f792 100644 --- a/Marechai.Server/Controllers/SoftwareCoversController.cs +++ b/Marechai.Server/Controllers/SoftwareCoversController.cs @@ -77,7 +77,7 @@ public class SoftwareCoversController(MarechaiContext context, IConfiguration co bool isEnglish = string.Equals(langCode, "eng", StringComparison.Ordinal); IQueryable source = context.SoftwareCovers - .Where(c => c.Release.SoftwareId == softwareId) + .Where(c => c.SoftwareId == softwareId) .OrderBy(c => c.Type) .ThenBy(c => c.Release.PlatformId); @@ -87,15 +87,19 @@ public class SoftwareCoversController(MarechaiContext context, IConfiguration co return source.Select(c => new SoftwareCoverDto { Id = c.Id, + SoftwareId = c.SoftwareId, SoftwareReleaseId = c.SoftwareReleaseId, - ReleaseTitle = c.Release.Title, + GroupId = c.GroupId, + ReleaseTitle = c.Release != null ? c.Release.Title : null, Type = (int)c.Type, TypeName = c.Type.ToString(), Caption = c.Caption, CanonicalCaption = c.Caption, OriginalExtension = c.OriginalExtension, - PlatformName = c.Release.Platform != null ? c.Release.Platform.Name : null, - RegionNames = c.Release.Regions != null + PlatformName = c.Release != null && c.Release.Platform != null + ? c.Release.Platform.Name + : null, + RegionNames = c.Release != null && c.Release.Regions != null ? string.Join(", ", c.Release.Regions.Select(r => r.UnM49.Name)) : null }) @@ -104,8 +108,10 @@ public class SoftwareCoversController(MarechaiContext context, IConfiguration co return source.Select(c => new SoftwareCoverDto { Id = c.Id, + SoftwareId = c.SoftwareId, SoftwareReleaseId = c.SoftwareReleaseId, - ReleaseTitle = c.Release.Title, + GroupId = c.GroupId, + ReleaseTitle = c.Release != null ? c.Release.Title : null, Type = (int)c.Type, TypeName = c.Type.ToString(), Caption = c.Caption == null @@ -117,8 +123,10 @@ public class SoftwareCoversController(MarechaiContext context, IConfiguration co .FirstOrDefault() ?? c.Caption), CanonicalCaption = c.Caption, OriginalExtension = c.OriginalExtension, - PlatformName = c.Release.Platform != null ? c.Release.Platform.Name : null, - RegionNames = c.Release.Regions != null + PlatformName = c.Release != null && c.Release.Platform != null + ? c.Release.Platform.Name + : null, + RegionNames = c.Release != null && c.Release.Regions != null ? string.Join(", ", c.Release.Regions.Select(r => r.UnM49.Name)) : null }) @@ -139,8 +147,10 @@ public class SoftwareCoversController(MarechaiContext context, IConfiguration co .Select(c => new SoftwareCoverDto { Id = c.Id, + SoftwareId = c.SoftwareId, SoftwareReleaseId = c.SoftwareReleaseId, - ReleaseTitle = c.Release.Title, + GroupId = c.GroupId, + ReleaseTitle = c.Release != null ? c.Release.Title : null, Type = (int)c.Type, TypeName = c.Type.ToString(), Caption = isEnglish || c.Caption == null @@ -152,10 +162,10 @@ public class SoftwareCoversController(MarechaiContext context, IConfiguration co .FirstOrDefault() ?? c.Caption), CanonicalCaption = c.Caption, OriginalExtension = c.OriginalExtension, - PlatformName = c.Release.Platform != null + PlatformName = c.Release != null && c.Release.Platform != null ? c.Release.Platform.Name : null, - RegionNames = c.Release.Regions != null + RegionNames = c.Release != null && c.Release.Regions != null ? string.Join(", ", c.Release.Regions.Select(r => r.UnM49.Name)) : null @@ -174,7 +184,9 @@ public class SoftwareCoversController(MarechaiContext context, IConfiguration co [ProducesResponseType(StatusCodes.Status400BadRequest)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] public async Task> UploadAsync(IFormFile file, - [FromForm] ulong releaseId, + [FromForm] ulong softwareId, + [FromForm] ulong? releaseId, + [FromForm] string groupId, [FromForm] SoftwareCoverType type, [FromForm] string caption) { @@ -197,10 +209,18 @@ public class SoftwareCoversController(MarechaiContext context, IConfiguration co !_allowedContentTypes.Contains(file.ContentType.ToLowerInvariant())) return Problem(detail: "Unsupported content type.", statusCode: StatusCodes.Status400BadRequest); - bool releaseExists = await context.SoftwareReleases.AnyAsync(r => r.Id == (ulong)releaseId); + bool softwareExists = await context.Softwares.AnyAsync(s => s.Id == softwareId); - if(!releaseExists) - return Problem(detail: "Referenced software release does not exist.", statusCode: StatusCodes.Status400BadRequest); + if(!softwareExists) + return Problem(detail: "Referenced software does not exist.", statusCode: StatusCodes.Status400BadRequest); + + if(releaseId is not null) + { + bool releaseExists = await context.SoftwareReleases.AnyAsync(r => r.Id == releaseId.Value); + + if(!releaseExists) + return Problem(detail: "Referenced software release does not exist.", statusCode: StatusCodes.Status400BadRequest); + } using var ms = new MemoryStream(); await file.CopyToAsync(ms); @@ -209,7 +229,9 @@ public class SoftwareCoversController(MarechaiContext context, IConfiguration co var model = new SoftwareCover { Id = Guid.NewGuid(), + SoftwareId = softwareId, SoftwareReleaseId = releaseId, + GroupId = groupId, Type = type, Caption = caption, OriginalExtension = extension.TrimStart('.') @@ -242,7 +264,9 @@ public class SoftwareCoversController(MarechaiContext context, IConfiguration co return Ok(new SoftwareCoverDto { Id = model.Id, + SoftwareId = model.SoftwareId, SoftwareReleaseId = model.SoftwareReleaseId, + GroupId = model.GroupId, Type = (int)model.Type, TypeName = model.Type.ToString(), Caption = model.Caption, @@ -263,30 +287,33 @@ public class SoftwareCoversController(MarechaiContext context, IConfiguration co if(userId is null) return Unauthorized(); - SoftwareCover model = await context.SoftwareCovers - .Include(c => c.Release) - .ThenInclude(r => r.SoftwareVersion) - .FirstOrDefaultAsync(c => c.Id == id); + SoftwareCover model = await context.SoftwareCovers.FirstOrDefaultAsync(c => c.Id == id); if(model is null) return NotFound(); - // Allow release reassignment only within the same software - if(dto.SoftwareReleaseId != 0 && (ulong)dto.SoftwareReleaseId != model.SoftwareReleaseId) + // Allow release reassignment only within the same software, or clearing it (null). + if(dto.SoftwareReleaseId != model.SoftwareReleaseId) { - SoftwareRelease newRelease = await context.SoftwareReleases - .Include(r => r.SoftwareVersion) - .FirstOrDefaultAsync(r => r.Id == (ulong)dto.SoftwareReleaseId); + if(dto.SoftwareReleaseId is null) + { + model.SoftwareReleaseId = null; + } + else + { + SoftwareRelease newRelease = await context.SoftwareReleases + .Include(r => r.SoftwareVersion) + .FirstOrDefaultAsync(r => r.Id == dto.SoftwareReleaseId.Value); - if(newRelease is null) - return Problem(detail: "Referenced software release does not exist.", statusCode: StatusCodes.Status400BadRequest); + if(newRelease is null) + return Problem(detail: "Referenced software release does not exist.", statusCode: StatusCodes.Status400BadRequest); - ulong? currentSoftwareId = model.Release.SoftwareId ?? model.Release.SoftwareVersion?.SoftwareId; - ulong? newSoftwareId = newRelease.SoftwareId ?? newRelease.SoftwareVersion?.SoftwareId; + ulong? newSoftwareId = newRelease.SoftwareId ?? newRelease.SoftwareVersion?.SoftwareId; - if(currentSoftwareId != newSoftwareId) - return Problem(detail: "Release does not belong to the same software.", statusCode: StatusCodes.Status400BadRequest); + if(newSoftwareId != model.SoftwareId) + return Problem(detail: "Release does not belong to the same software.", statusCode: StatusCodes.Status400BadRequest); - model.SoftwareReleaseId = (ulong)dto.SoftwareReleaseId; + model.SoftwareReleaseId = dto.SoftwareReleaseId; + } } // Admin / suggestion edit submits the canonical English caption (DTO.CanonicalCaption @@ -300,6 +327,59 @@ public class SoftwareCoversController(MarechaiContext context, IConfiguration co return Ok(); } + /// + /// Bulk-assign every SoftwareCover sharing the given MobyGames + /// to a single . Used by the + /// admin cover UI once a human has identified which release a whole regional cover + /// group (front/back/spine/etc. for the same edition) actually belongs to, instead of + /// requiring one reassignment per cover. + /// + [HttpPost("groups/{groupId}/assign-release")] + [Authorize(Roles = "Admin,UberAdmin")] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + public async Task AssignGroupToReleaseAsync(string groupId, + [FromBody] AssignCoverGroupToReleaseRequestDto dto) + { + string userId = User.FindFirstValue(ClaimTypes.Sid); + + if(userId is null) return Unauthorized(); + + List covers = await context.SoftwareCovers + .Where(c => c.GroupId == groupId) + .ToListAsync(); + + if(covers.Count == 0) return NotFound(); + + SoftwareRelease release = await context.SoftwareReleases.FirstOrDefaultAsync(r => r.Id == dto.ReleaseId); + + if(release is null) + return Problem(detail: "Referenced software release does not exist.", statusCode: StatusCodes.Status400BadRequest); + + ulong? groupSoftwareId = covers[0].SoftwareId; + + if(groupSoftwareId is null) + return Problem(detail: "Cover group has no associated software; cannot bulk-assign.", + statusCode: StatusCodes.Status400BadRequest); + + if(covers.Any(c => c.SoftwareId != groupSoftwareId)) + return Problem(detail: "Cover group spans more than one software; refusing to bulk-assign.", + statusCode: StatusCodes.Status400BadRequest); + + if(release.SoftwareId != groupSoftwareId) + return Problem(detail: "Release does not belong to the same software as the cover group.", + statusCode: StatusCodes.Status400BadRequest); + + foreach(SoftwareCover cover in covers) + cover.SoftwareReleaseId = dto.ReleaseId; + + await context.SaveChangesWithUserAsync(userId); + + return Ok(); + } + [HttpDelete("{id:Guid}")] [Authorize(Roles = "Admin,UberAdmin")] [ProducesResponseType(StatusCodes.Status200OK)] diff --git a/Marechai/Pages/Admin/SoftwareCovers.razor b/Marechai/Pages/Admin/SoftwareCovers.razor index 105993c4..3f0c722f 100644 --- a/Marechai/Pages/Admin/SoftwareCovers.razor +++ b/Marechai/Pages/Admin/SoftwareCovers.razor @@ -103,94 +103,139 @@ } else { - - @foreach(SoftwareCoverDto cover in _covers) - { - - - - - - - @(cover.Caption ?? cover.TypeName) - - - - @if(!string.IsNullOrWhiteSpace(cover.PlatformName)) + @foreach(IGrouping group in GetCoverGroups()) + { + + + + @L["Cover group"]: @group.Key + @group.Count() + + + @if(_releases is not null) + { + @foreach(SoftwareReleaseDto release in _releases) { - - - @cover.PlatformName - - } - @if(!string.IsNullOrWhiteSpace(cover.RegionNames)) - { - @cover.RegionNames - } - @if(!string.IsNullOrWhiteSpace(cover.ReleaseTitle)) - { - @cover.ReleaseTitle + @FormatReleaseLabel(release) } + } + + + @L["Assign"] + + + + @foreach(SoftwareCoverDto cover in group) + { + @RenderCover(cover) + } + + + } - @if(_selectedRelease is not null) - { - - @FormatReleaseLabel(_releases?.FirstOrDefault(r => r.Id == cover.SoftwareReleaseId)) - - } - else - { - - @if(_releases is not null) - { - @foreach(SoftwareReleaseDto release in _releases) - { - @FormatReleaseLabel(release) - } - } - - } - - - @L["Front Cover"] - @L["Back Cover"] - @L["Inside Cover (Front)"] - @L["Inside Cover (Back)"] - @L["Media"] - @L["Spine"] - @L["Manual"] - @L["Other"] - - - @* Admins always edit the canonical English caption regardless of UI locale; localized - captions surface on public pages via SoftwareCoverCaptionTranslations. *@ - - - - @L["Delete"] - - - - } - + if(GetUngroupedCovers() is { Count: > 0 } ungrouped) + { + + @foreach(SoftwareCoverDto cover in ungrouped) + { + @RenderCover(cover) + } + + } } + +@code +{ + RenderFragment RenderCover(SoftwareCoverDto cover) => @ + + + + + + @(cover.Caption ?? cover.TypeName) + + + + @if(!string.IsNullOrWhiteSpace(cover.PlatformName)) + { + + + @cover.PlatformName + + } + @if(!string.IsNullOrWhiteSpace(cover.RegionNames)) + { + @cover.RegionNames + } + @if(!string.IsNullOrWhiteSpace(cover.ReleaseTitle)) + { + @cover.ReleaseTitle + } + + @if(_selectedRelease is not null) + { + + @FormatReleaseLabel(_releases?.FirstOrDefault(r => r.Id == cover.SoftwareReleaseId)) + + } + else + { + + @if(_releases is not null) + { + @foreach(SoftwareReleaseDto release in _releases) + { + @FormatReleaseLabel(release) + } + } + + } + + + @L["Front Cover"] + @L["Back Cover"] + @L["Inside Cover (Front)"] + @L["Inside Cover (Back)"] + @L["Media"] + @L["Spine"] + @L["Manual"] + @L["Other"] + + + @* Admins always edit the canonical English caption regardless of UI locale; localized + captions surface on public pages via SoftwareCoverCaptionTranslations. *@ + + + + @L["Delete"] + + + ; +} diff --git a/Marechai/Pages/Admin/SoftwareCovers.razor.cs b/Marechai/Pages/Admin/SoftwareCovers.razor.cs index d3d2e78f..3ab6a0f3 100644 --- a/Marechai/Pages/Admin/SoftwareCovers.razor.cs +++ b/Marechai/Pages/Admin/SoftwareCovers.razor.cs @@ -35,13 +35,14 @@ namespace Marechai.Pages.Admin; public partial class SoftwareCovers { - List _covers; - string _errorMessage; - bool _isLoading = true; - List _releases; - SoftwareReleaseDto _selectedRelease; - string _softwareName; - string _successMessage; + List _covers; + string _errorMessage; + bool _isLoading = true; + List _releases; + SoftwareReleaseDto _selectedRelease; + string _softwareName; + string _successMessage; + Dictionary _groupReleaseSelections = new(); [Parameter] public int SoftwareId { get; set; } [Parameter] public int? ReleaseId { get; set; } @@ -77,9 +78,44 @@ public partial class SoftwareCovers if(_selectedRelease?.Id is not null) _covers = _covers.Where(c => c.SoftwareReleaseId == _selectedRelease.Id).ToList(); + _groupReleaseSelections.Clear(); _isLoading = false; } + /// + /// Covers sharing a MobyGames-import GroupId, clustered together so an admin can + /// identify the whole regional cover set (front/back/spine/etc. for one edition) and + /// assign it to a release in one action instead of one cover at a time. Only relevant + /// when browsing all of a software's covers (not a single pre-selected release). + /// + IEnumerable> GetCoverGroups() => + _selectedRelease is not null || _covers is null + ? [] + : _covers.Where(c => !string.IsNullOrEmpty(c.GroupId)).GroupBy(c => c.GroupId); + + List GetUngroupedCovers() => + _selectedRelease is not null || _covers is null + ? _covers ?? [] + : _covers.Where(c => string.IsNullOrEmpty(c.GroupId)).ToList(); + + async Task AssignGroupToReleaseAsync(string groupId) + { + if(!_groupReleaseSelections.TryGetValue(groupId, out SoftwareReleaseDto release) || release?.Id is null) + return; + + (bool succeeded, string error) = await SoftwareService.AssignCoverGroupToReleaseAsync(groupId, release.Id.Value); + + if(succeeded) + { + _successMessage = string.Format(L["Assigned cover group to {0}."].Value, FormatReleaseLabel(release)); + await LoadDataAsync(); + } + else + { + _errorMessage = error; + } + } + async Task OpenBatchUploadDialog() { if(_selectedRelease?.Id is null) return; diff --git a/Marechai/Resources/Services/SoftwareService.de.resx b/Marechai/Resources/Services/SoftwareService.de.resx index 67c3c0d6..877a5b78 100644 --- a/Marechai/Resources/Services/SoftwareService.de.resx +++ b/Marechai/Resources/Services/SoftwareService.de.resx @@ -1389,4 +1389,16 @@ Nach Kategorie + + Cover-Gruppe + + + Gruppe einer Veröffentlichung zuweisen + + + Zuweisen + + + Cover-Gruppe {0} zugewiesen. + diff --git a/Marechai/Resources/Services/SoftwareService.en.resx b/Marechai/Resources/Services/SoftwareService.en.resx index 887a1ad1..59defacd 100644 --- a/Marechai/Resources/Services/SoftwareService.en.resx +++ b/Marechai/Resources/Services/SoftwareService.en.resx @@ -1257,4 +1257,16 @@ By category + + Cover group + + + Assign group to release + + + Assign + + + Assigned cover group to {0}. + diff --git a/Marechai/Resources/Services/SoftwareService.es.resx b/Marechai/Resources/Services/SoftwareService.es.resx index ac011c5d..a723ca85 100644 --- a/Marechai/Resources/Services/SoftwareService.es.resx +++ b/Marechai/Resources/Services/SoftwareService.es.resx @@ -515,6 +515,10 @@ Lomo Manual Otro + Grupo de portadas + Asignar grupo a edición + Asignar + Grupo de portadas asignado a {0}. Créditos Credits diff --git a/Marechai/Resources/Services/SoftwareService.fr.resx b/Marechai/Resources/Services/SoftwareService.fr.resx index ebe93057..e3680845 100644 --- a/Marechai/Resources/Services/SoftwareService.fr.resx +++ b/Marechai/Resources/Services/SoftwareService.fr.resx @@ -1389,4 +1389,16 @@ Par catégorie + + Groupe de jaquettes + + + Affecter le groupe à l'édition + + + Affecter + + + Groupe de jaquettes affecté à {0}. + diff --git a/Marechai/Resources/Services/SoftwareService.it.resx b/Marechai/Resources/Services/SoftwareService.it.resx index 72eaae30..7d62e45b 100644 --- a/Marechai/Resources/Services/SoftwareService.it.resx +++ b/Marechai/Resources/Services/SoftwareService.it.resx @@ -1308,4 +1308,16 @@ Per categoria + + Gruppo di copertine + + + Assegna gruppo a edizione + + + Assegna + + + Gruppo di copertine assegnato a {0}. + diff --git a/Marechai/Resources/Services/SoftwareService.nl.resx b/Marechai/Resources/Services/SoftwareService.nl.resx index 697c911d..c908c8ac 100644 --- a/Marechai/Resources/Services/SoftwareService.nl.resx +++ b/Marechai/Resources/Services/SoftwareService.nl.resx @@ -1758,4 +1758,16 @@ Per categorie + + Omslaggroep + + + Groep toewijzen aan release + + + Toewijzen + + + Omslaggroep toegewezen aan {0}. + diff --git a/Marechai/Services/SoftwareService.cs b/Marechai/Services/SoftwareService.cs index 561c3fdb..ae67ea64 100644 --- a/Marechai/Services/SoftwareService.cs +++ b/Marechai/Services/SoftwareService.cs @@ -1930,6 +1930,25 @@ public class SoftwareService(Marechai.ApiClient.Client client, IRequestAdapter r } } + public async Task<(bool succeeded, string error)> AssignCoverGroupToReleaseAsync(string groupId, int releaseId) + { + try + { + await client.Software.Covers.Groups[groupId].AssignRelease.PostAsync( + new AssignCoverGroupToReleaseRequestDto { ReleaseId = releaseId }); + + return (true, null); + } + catch(ApiException ex) + { + return (false, ExtractErrorMessage(ex)); + } + catch(Exception ex) + { + return (false, ex.Message); + } + } + public async Task GetMergePreviewAsync(int targetId, int sourceId) { try