From 459880161d37970e793e324065d74f0965361719 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Fri, 8 May 2026 09:00:58 +0100 Subject: [PATCH] Add video management functionality for processors - Created ProcessorVideos.razor and ProcessorVideos.razor.cs for managing videos associated with processors. - Implemented video linking, title updating, and deletion features. - Added UI components for video management, including input fields for YouTube URLs and video IDs. - Integrated video display in the processor view with support for YouTube embeds. - Updated localization files for new video management strings in multiple languages. - Enhanced ProcessorsService to handle video-related API calls. --- .../Models/CreateProcessorVideoRequest.cs | 85 + .../Models/ProcessorVideoDto.cs | 103 + .../Models/UpdateProcessorVideoRequest.cs | 65 + .../Processors/Item/ItemRequestBuilder.cs | 6 + .../Item/Videos/VideosRequestBuilder.cs | 149 + .../Processors/ProcessorsRequestBuilder.cs | 6 + .../Videos/Item/VideosItemRequestBuilder.cs | 192 + .../Processors/Videos/VideosRequestBuilder.cs | 61 + Marechai.ApiClient/kiota-lock.json | 2 +- .../Dtos/CreateProcessorVideoRequest.cs | 46 + Marechai.Data/Dtos/ProcessorVideoDto.cs | 50 + .../Dtos/UpdateProcessorVideoRequest.cs | 36 + ...60507233219_AddProcessorVideos.Designer.cs | 10981 ++++++++++++++++ .../20260507233219_AddProcessorVideos.cs | 64 + .../MarechaiContextModelSnapshot.cs | 60 + Marechai.Database/Models/MarechaiContext.cs | 12 + Marechai.Database/Models/Processor.cs | 1 + Marechai.Database/Models/ProcessorVideo.cs | 46 + .../Controllers/ProcessorVideosController.cs | 190 + Marechai/Pages/Admin/ProcessorVideos.razor | 164 + Marechai/Pages/Admin/ProcessorVideos.razor.cs | 168 + Marechai/Pages/Admin/Processors.razor | 1 + Marechai/Pages/Processors/View.razor | 41 + Marechai/Pages/Processors/View.razor.cs | 3 + .../Services/ProcessorsService.de.resx | 100 + .../Services/ProcessorsService.en.resx | 75 + .../Services/ProcessorsService.es.resx | 100 + .../Services/ProcessorsService.fr.resx | 100 + .../Services/ProcessorsService.it.resx | 100 + Marechai/Services/ProcessorsService.cs | 88 + 30 files changed, 13094 insertions(+), 1 deletion(-) create mode 100644 Marechai.ApiClient/Models/CreateProcessorVideoRequest.cs create mode 100644 Marechai.ApiClient/Models/ProcessorVideoDto.cs create mode 100644 Marechai.ApiClient/Models/UpdateProcessorVideoRequest.cs create mode 100644 Marechai.ApiClient/Processors/Item/Videos/VideosRequestBuilder.cs create mode 100644 Marechai.ApiClient/Processors/Videos/Item/VideosItemRequestBuilder.cs create mode 100644 Marechai.ApiClient/Processors/Videos/VideosRequestBuilder.cs create mode 100644 Marechai.Data/Dtos/CreateProcessorVideoRequest.cs create mode 100644 Marechai.Data/Dtos/ProcessorVideoDto.cs create mode 100644 Marechai.Data/Dtos/UpdateProcessorVideoRequest.cs create mode 100644 Marechai.Database/Migrations/20260507233219_AddProcessorVideos.Designer.cs create mode 100644 Marechai.Database/Migrations/20260507233219_AddProcessorVideos.cs create mode 100644 Marechai.Database/Models/ProcessorVideo.cs create mode 100644 Marechai.Server/Controllers/ProcessorVideosController.cs create mode 100644 Marechai/Pages/Admin/ProcessorVideos.razor create mode 100644 Marechai/Pages/Admin/ProcessorVideos.razor.cs diff --git a/Marechai.ApiClient/Models/CreateProcessorVideoRequest.cs b/Marechai.ApiClient/Models/CreateProcessorVideoRequest.cs new file mode 100644 index 00000000..ec4e4e33 --- /dev/null +++ b/Marechai.ApiClient/Models/CreateProcessorVideoRequest.cs @@ -0,0 +1,85 @@ +// +#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 CreateProcessorVideoRequest : 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 provider property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Provider { get; set; } +#nullable restore +#else + public string Provider { get; set; } +#endif + /// The title property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Title { get; set; } +#nullable restore +#else + public string Title { get; set; } +#endif + /// The video_id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? VideoId { get; set; } +#nullable restore +#else + public string VideoId { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CreateProcessorVideoRequest() + { + 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.CreateProcessorVideoRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); + return new global::Marechai.ApiClient.Models.CreateProcessorVideoRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "provider", n => { Provider = n.GetStringValue(); } }, + { "title", n => { Title = n.GetStringValue(); } }, + { "video_id", n => { VideoId = n.GetStringValue(); } }, + }; + } + /// + /// 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.WriteStringValue("provider", Provider); + writer.WriteStringValue("title", Title); + writer.WriteStringValue("video_id", VideoId); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/Models/ProcessorVideoDto.cs b/Marechai.ApiClient/Models/ProcessorVideoDto.cs new file mode 100644 index 00000000..79c1e749 --- /dev/null +++ b/Marechai.ApiClient/Models/ProcessorVideoDto.cs @@ -0,0 +1,103 @@ +// +#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 ProcessorVideoDto : 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 id property + public long? Id { get; set; } + /// The processor_id property + public int? ProcessorId { get; set; } + /// The processor_name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ProcessorName { get; set; } +#nullable restore +#else + public string ProcessorName { get; set; } +#endif + /// The provider property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Provider { get; set; } +#nullable restore +#else + public string Provider { get; set; } +#endif + /// The title property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Title { get; set; } +#nullable restore +#else + public string Title { get; set; } +#endif + /// The video_id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? VideoId { get; set; } +#nullable restore +#else + public string VideoId { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ProcessorVideoDto() + { + 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.ProcessorVideoDto CreateFromDiscriminatorValue(IParseNode parseNode) + { + if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); + return new global::Marechai.ApiClient.Models.ProcessorVideoDto(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetLongValue(); } }, + { "processor_id", n => { ProcessorId = n.GetIntValue(); } }, + { "processor_name", n => { ProcessorName = n.GetStringValue(); } }, + { "provider", n => { Provider = n.GetStringValue(); } }, + { "title", n => { Title = n.GetStringValue(); } }, + { "video_id", n => { VideoId = n.GetStringValue(); } }, + }; + } + /// + /// 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.WriteLongValue("id", Id); + writer.WriteIntValue("processor_id", ProcessorId); + writer.WriteStringValue("processor_name", ProcessorName); + writer.WriteStringValue("provider", Provider); + writer.WriteStringValue("title", Title); + writer.WriteStringValue("video_id", VideoId); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/Models/UpdateProcessorVideoRequest.cs b/Marechai.ApiClient/Models/UpdateProcessorVideoRequest.cs new file mode 100644 index 00000000..ece56aa7 --- /dev/null +++ b/Marechai.ApiClient/Models/UpdateProcessorVideoRequest.cs @@ -0,0 +1,65 @@ +// +#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 UpdateProcessorVideoRequest : 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 title property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Title { get; set; } +#nullable restore +#else + public string Title { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public UpdateProcessorVideoRequest() + { + 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.UpdateProcessorVideoRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); + return new global::Marechai.ApiClient.Models.UpdateProcessorVideoRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "title", n => { Title = n.GetStringValue(); } }, + }; + } + /// + /// 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.WriteStringValue("title", Title); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/Processors/Item/ItemRequestBuilder.cs b/Marechai.ApiClient/Processors/Item/ItemRequestBuilder.cs index 49a9987a..ec5e44e4 100644 --- a/Marechai.ApiClient/Processors/Item/ItemRequestBuilder.cs +++ b/Marechai.ApiClient/Processors/Item/ItemRequestBuilder.cs @@ -5,6 +5,7 @@ using Marechai.ApiClient.Processors.Item.Description; using Marechai.ApiClient.Processors.Item.Descriptions; using Marechai.ApiClient.Processors.Item.Machines; using Marechai.ApiClient.Processors.Item.Photos; +using Marechai.ApiClient.Processors.Item.Videos; using Microsoft.Kiota.Abstractions.Extensions; using Microsoft.Kiota.Abstractions.Serialization; using Microsoft.Kiota.Abstractions; @@ -41,6 +42,11 @@ namespace Marechai.ApiClient.Processors.Item { get => new global::Marechai.ApiClient.Processors.Item.Photos.PhotosRequestBuilder(PathParameters, RequestAdapter); } + /// The videos property + public global::Marechai.ApiClient.Processors.Item.Videos.VideosRequestBuilder Videos + { + get => new global::Marechai.ApiClient.Processors.Item.Videos.VideosRequestBuilder(PathParameters, RequestAdapter); + } /// /// Instantiates a new and sets the default values. /// diff --git a/Marechai.ApiClient/Processors/Item/Videos/VideosRequestBuilder.cs b/Marechai.ApiClient/Processors/Item/Videos/VideosRequestBuilder.cs new file mode 100644 index 00000000..59fa4f2f --- /dev/null +++ b/Marechai.ApiClient/Processors/Item/Videos/VideosRequestBuilder.cs @@ -0,0 +1,149 @@ +// +#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.Processors.Item.Videos +{ + /// + /// Builds and executes requests for operations under \processors\{-id}\videos + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class VideosRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public VideosRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/processors/{%2Did}/videos", 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 VideosRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/processors/{%2Did}/videos", rawUrl) + { + } + /// A List<global::Marechai.ApiClient.Models.ProcessorVideoDto> + /// 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 +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + }; + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, global::Marechai.ApiClient.Models.ProcessorVideoDto.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return collectionResult?.AsList(); + } + /// 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 403 status code + /// When receiving a 404 status code + /// When receiving a 409 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::Marechai.ApiClient.Models.CreateProcessorVideoRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::Marechai.ApiClient.Models.CreateProcessorVideoRequest 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 }, + { "403", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + { "404", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + { "409", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::Marechai.ApiClient.Models.ProcessorVideoDto.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// 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.CreateProcessorVideoRequest body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::Marechai.ApiClient.Models.CreateProcessorVideoRequest 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.Processors.Item.Videos.VideosRequestBuilder WithUrl(string rawUrl) + { + return new global::Marechai.ApiClient.Processors.Item.Videos.VideosRequestBuilder(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 VideosRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// 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 VideosRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/Processors/ProcessorsRequestBuilder.cs b/Marechai.ApiClient/Processors/ProcessorsRequestBuilder.cs index 9483294a..3e3b9360 100644 --- a/Marechai.ApiClient/Processors/ProcessorsRequestBuilder.cs +++ b/Marechai.ApiClient/Processors/ProcessorsRequestBuilder.cs @@ -3,6 +3,7 @@ using Marechai.ApiClient.Models; using Marechai.ApiClient.Processors.Item; using Marechai.ApiClient.Processors.Photos; +using Marechai.ApiClient.Processors.Videos; using Microsoft.Kiota.Abstractions.Extensions; using Microsoft.Kiota.Abstractions.Serialization; using Microsoft.Kiota.Abstractions; @@ -24,6 +25,11 @@ namespace Marechai.ApiClient.Processors { get => new global::Marechai.ApiClient.Processors.Photos.PhotosRequestBuilder(PathParameters, RequestAdapter); } + /// The videos property + public global::Marechai.ApiClient.Processors.Videos.VideosRequestBuilder Videos + { + get => new global::Marechai.ApiClient.Processors.Videos.VideosRequestBuilder(PathParameters, RequestAdapter); + } /// Gets an item from the Marechai.ApiClient.processors.item collection /// Unique identifier of the item /// A diff --git a/Marechai.ApiClient/Processors/Videos/Item/VideosItemRequestBuilder.cs b/Marechai.ApiClient/Processors/Videos/Item/VideosItemRequestBuilder.cs new file mode 100644 index 00000000..5e676b95 --- /dev/null +++ b/Marechai.ApiClient/Processors/Videos/Item/VideosItemRequestBuilder.cs @@ -0,0 +1,192 @@ +// +#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.Processors.Videos.Item +{ + /// + /// Builds and executes requests for operations under \processors\videos\{id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class VideosItemRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public VideosItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/processors/videos/{id}", 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 VideosItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/processors/videos/{id}", rawUrl) + { + } + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 403 status code + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + { "403", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + { "404", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "404", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::Marechai.ApiClient.Models.ProcessorVideoDto.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// 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 403 status code + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(global::Marechai.ApiClient.Models.UpdateProcessorVideoRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(global::Marechai.ApiClient.Models.UpdateProcessorVideoRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + { "401", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + { "403", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + { "404", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, text/plain;q=0.9"); + return requestInfo; + } + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, text/plain;q=0.9"); + return requestInfo; + } + /// 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 ToPutRequestInformation(global::Marechai.ApiClient.Models.UpdateProcessorVideoRequest body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(global::Marechai.ApiClient.Models.UpdateProcessorVideoRequest body, Action> requestConfiguration = default) + { +#endif + if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, 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.Processors.Videos.Item.VideosItemRequestBuilder WithUrl(string rawUrl) + { + return new global::Marechai.ApiClient.Processors.Videos.Item.VideosItemRequestBuilder(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 VideosItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// 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 VideosItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// 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 VideosItemRequestBuilderPutRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/Processors/Videos/VideosRequestBuilder.cs b/Marechai.ApiClient/Processors/Videos/VideosRequestBuilder.cs new file mode 100644 index 00000000..18b2f6ac --- /dev/null +++ b/Marechai.ApiClient/Processors/Videos/VideosRequestBuilder.cs @@ -0,0 +1,61 @@ +// +#pragma warning disable CS0618 +using Marechai.ApiClient.Processors.Videos.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.Processors.Videos +{ + /// + /// Builds and executes requests for operations under \processors\videos + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class VideosRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the Marechai.ApiClient.processors.videos.item collection + /// Unique identifier of the item + /// A + public global::Marechai.ApiClient.Processors.Videos.Item.VideosItemRequestBuilder this[long position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("id", position); + return new global::Marechai.ApiClient.Processors.Videos.Item.VideosItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// Gets an item from the Marechai.ApiClient.processors.videos.item collection + /// Unique identifier of the item + /// A + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public global::Marechai.ApiClient.Processors.Videos.Item.VideosItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("id", position); + return new global::Marechai.ApiClient.Processors.Videos.Item.VideosItemRequestBuilder(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 VideosRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/processors/videos", 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 VideosRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/processors/videos", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/kiota-lock.json b/Marechai.ApiClient/kiota-lock.json index e33fd87d..b2668123 100644 --- a/Marechai.ApiClient/kiota-lock.json +++ b/Marechai.ApiClient/kiota-lock.json @@ -1,5 +1,5 @@ { - "descriptionHash": "0A0B24472424F5725FAC0B461835F2846FCFBE4D6266D5CA9C8A47BFE69245671601318F589BAFDE4990008ECD148038CCBFAF956E676DC1144EA697B31E6284", + "descriptionHash": "D841F4013F51B97831F05CE9468D15A4446F4DE601CD9D5CBAE3EA4DF8DDB85FB9B0B3C951BCC27AF2EE2066DC8ACE94EA0A3A5CB2C9B4D5063BD33CB03C8221", "descriptionLocation": "../../../../../tmp/openapi.json", "lockFileVersion": "1.0.0", "kiotaVersion": "1.31.1", diff --git a/Marechai.Data/Dtos/CreateProcessorVideoRequest.cs b/Marechai.Data/Dtos/CreateProcessorVideoRequest.cs new file mode 100644 index 00000000..918c2853 --- /dev/null +++ b/Marechai.Data/Dtos/CreateProcessorVideoRequest.cs @@ -0,0 +1,46 @@ +/****************************************************************************** +// 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; + +public class CreateProcessorVideoRequest +{ + [Required] + [StringLength(32)] + [JsonPropertyName("provider")] + public string Provider { get; set; } = null!; + + [Required] + [StringLength(64)] + [JsonPropertyName("video_id")] + public string VideoId { get; set; } = null!; + + [StringLength(512)] + [JsonPropertyName("title")] + public string? Title { get; set; } +} diff --git a/Marechai.Data/Dtos/ProcessorVideoDto.cs b/Marechai.Data/Dtos/ProcessorVideoDto.cs new file mode 100644 index 00000000..070d08bf --- /dev/null +++ b/Marechai.Data/Dtos/ProcessorVideoDto.cs @@ -0,0 +1,50 @@ +/****************************************************************************** +// 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; + +public class ProcessorVideoDto : BaseDto +{ + [JsonPropertyName("processor_id")] + [Required] + public int ProcessorId { get; set; } + + [JsonPropertyName("processor_name")] + public string? ProcessorName { get; set; } + + [JsonPropertyName("provider")] + [Required] + public string Provider { get; set; } + + [JsonPropertyName("video_id")] + [Required] + public string VideoId { get; set; } + + [JsonPropertyName("title")] + public string? Title { get; set; } +} diff --git a/Marechai.Data/Dtos/UpdateProcessorVideoRequest.cs b/Marechai.Data/Dtos/UpdateProcessorVideoRequest.cs new file mode 100644 index 00000000..7db42338 --- /dev/null +++ b/Marechai.Data/Dtos/UpdateProcessorVideoRequest.cs @@ -0,0 +1,36 @@ +/****************************************************************************** +// 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; + +public class UpdateProcessorVideoRequest +{ + [StringLength(512)] + [JsonPropertyName("title")] + public string? Title { get; set; } +} diff --git a/Marechai.Database/Migrations/20260507233219_AddProcessorVideos.Designer.cs b/Marechai.Database/Migrations/20260507233219_AddProcessorVideos.Designer.cs new file mode 100644 index 00000000..e069bf54 --- /dev/null +++ b/Marechai.Database/Migrations/20260507233219_AddProcessorVideos.Designer.cs @@ -0,0 +1,10981 @@ +// +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("20260507233219_AddProcessorVideos")] + partial class AddProcessorVideos + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "9.0.11") + .HasAnnotation("Proxies:ChangeTracking", false) + .HasAnnotation("Proxies:CheckEquality", false) + .HasAnnotation("Proxies:LazyLoading", true) + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + + modelBuilder.Entity("Marechai.Database.Models.ApplicationRole", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("longtext"); + + b.Property("Created") + .HasColumnType("datetime(6)"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex"); + + b.ToTable("AspNetRoles", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.ApplicationUser", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AccessFailedCount") + .HasColumnType("int"); + + b.Property("AvatarGuid") + .HasColumnType("char(36)"); + + b.Property("Bio") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("longtext"); + + b.Property("DisplayName") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("EmailConfirmed") + .HasColumnType("bit(1)"); + + b.Property("Facebook") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("GitHub") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("IsSystemAccount") + .HasColumnType("bit(1)"); + + b.Property("LinkedIn") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Location") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("LockoutEnabled") + .HasColumnType("bit(1)"); + + b.Property("LockoutEnd") + .HasColumnType("datetime(6)"); + + b.Property("Mastodon") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("OriginalAvatarExtension") + .HasMaxLength(10) + .HasColumnType("varchar(10)"); + + b.Property("PasswordHash") + .HasColumnType("longtext"); + + b.Property("PhoneNumber") + .HasColumnType("longtext"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("bit(1)"); + + b.Property("PreferredThemeId") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("SecurityStamp") + .HasColumnType("longtext"); + + b.Property("Twitter") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("TwoFactorEnabled") + .HasColumnType("bit(1)"); + + b.Property("UseGravatar") + .HasColumnType("bit(1)"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Website") + .HasMaxLength(500) + .HasColumnType("varchar(500)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex"); + + b.ToTable("AspNetUsers", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.Audit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AffectedColumns") + .HasColumnType("json"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Keys") + .HasColumnType("json"); + + b.Property("NewValues") + .HasColumnType("json"); + + b.Property("OldValues") + .HasColumnType("json"); + + b.Property("Table") + .HasColumnType("varchar(255)"); + + b.Property("Type") + .HasColumnType("tinyint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("UserId") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("Table"); + + b.HasIndex("Type"); + + b.HasIndex("UserId"); + + b.ToTable("Audit"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Book", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CountryId") + .HasColumnType("smallint(3)"); + + b.Property("CoverGuid") + .HasColumnType("char(36)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Edition") + .HasColumnType("int"); + + b.Property("Isbn") + .HasMaxLength(13) + .HasColumnType("varchar(13)"); + + b.Property("NativeTitle") + .HasColumnType("varchar(255)"); + + b.Property("OriginalCoverExtension") + .HasColumnType("longtext"); + + b.Property("Pages") + .HasColumnType("smallint"); + + b.Property("PreviousId") + .HasColumnType("bigint"); + + b.Property("Published") + .HasColumnType("datetime(6)"); + + b.Property("PublishedPrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("SortTitle") + .HasColumnType("longtext"); + + b.Property("SourceId") + .HasColumnType("bigint"); + + b.Property("Title") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("CountryId"); + + b.HasIndex("Edition"); + + b.HasIndex("Isbn"); + + b.HasIndex("NativeTitle"); + + b.HasIndex("Pages"); + + b.HasIndex("PreviousId") + .IsUnique(); + + b.HasIndex("Published"); + + b.HasIndex("SourceId"); + + b.HasIndex("Title"); + + b.ToTable("Books"); + }); + + modelBuilder.Entity("Marechai.Database.Models.BookScan", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Author") + .HasColumnType("varchar(255)"); + + b.Property("BookId") + .HasColumnType("bigint"); + + b.Property("ColorSpace") + .HasColumnType("smallint unsigned"); + + b.Property("Comments") + .HasColumnType("varchar(255)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("ExifVersion") + .HasColumnType("varchar(255)"); + + b.Property("HorizontalResolution") + .HasColumnType("double"); + + b.Property("OriginalExtension") + .HasColumnType("longtext"); + + b.Property("Page") + .HasColumnType("int unsigned"); + + b.Property("ResolutionUnit") + .HasColumnType("smallint unsigned"); + + b.Property("ScannerManufacturer") + .HasColumnType("varchar(255)"); + + b.Property("ScannerModel") + .HasColumnType("varchar(255)"); + + b.Property("SoftwareUsed") + .HasColumnType("varchar(255)"); + + b.Property("Type") + .HasColumnType("int unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("UploadDate") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.Property("VerticalResolution") + .HasColumnType("double"); + + b.HasKey("Id"); + + b.HasIndex("Author"); + + b.HasIndex("BookId"); + + b.HasIndex("ColorSpace"); + + b.HasIndex("Comments"); + + b.HasIndex("CreationDate"); + + b.HasIndex("ExifVersion"); + + b.HasIndex("HorizontalResolution"); + + b.HasIndex("Page"); + + b.HasIndex("ResolutionUnit"); + + b.HasIndex("ScannerManufacturer"); + + b.HasIndex("ScannerModel"); + + b.HasIndex("SoftwareUsed"); + + b.HasIndex("Type"); + + b.HasIndex("UploadDate"); + + b.HasIndex("UserId"); + + b.HasIndex("VerticalResolution"); + + b.ToTable("BookScans"); + }); + + modelBuilder.Entity("Marechai.Database.Models.BookSynopsis", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("BookId") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("LanguageCode") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("char(3)"); + + b.Property("Text") + .IsRequired() + .HasMaxLength(262144) + .HasColumnType("longtext"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("LanguageCode"); + + b.HasIndex("Text") + .HasAnnotation("MySql:FullTextIndex", true); + + b.HasIndex("BookId", "LanguageCode") + .IsUnique() + .HasDatabaseName("idx_book_synopses_book_language"); + + b.ToTable("BookSynopses"); + }); + + modelBuilder.Entity("Marechai.Database.Models.BooksByMachine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("BookId") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("MachineId") + .HasColumnType("int(11)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("BookId"); + + b.HasIndex("MachineId"); + + b.ToTable("BooksByMachines"); + }); + + modelBuilder.Entity("Marechai.Database.Models.BooksByMachineFamily", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("BookId") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("MachineFamilyId") + .HasColumnType("int(11)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("BookId"); + + b.HasIndex("MachineFamilyId"); + + b.ToTable("BooksByMachineFamilies"); + }); + + modelBuilder.Entity("Marechai.Database.Models.BrowserTest", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Agif") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue((sbyte)0) + .HasColumnName("agif"); + + b.Property("Browser") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("browser") + .HasDefaultValueSql("''"); + + b.Property("Colors") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue((sbyte)0) + .HasColumnName("colors"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Flash") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue((sbyte)0) + .HasColumnName("flash"); + + b.Property("Frames") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue((sbyte)0) + .HasColumnName("frames"); + + b.Property("Gif87") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue((sbyte)0) + .HasColumnName("gif87"); + + b.Property("Gif89") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue((sbyte)0) + .HasColumnName("gif89"); + + b.Property("Jpeg") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue((sbyte)0) + .HasColumnName("jpeg"); + + b.Property("Js") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue((sbyte)0) + .HasColumnName("js"); + + b.Property("Os") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(32) + .HasColumnType("varchar(32)") + .HasColumnName("os") + .HasDefaultValueSql("''"); + + b.Property("Platform") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(8) + .HasColumnType("varchar(8)") + .HasColumnName("platform") + .HasDefaultValueSql("''"); + + b.Property("Png") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue((sbyte)0) + .HasColumnName("png"); + + b.Property("Pngt") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue((sbyte)0) + .HasColumnName("pngt"); + + b.Property("Table") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue((sbyte)0) + .HasColumnName("table"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("UserAgent") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("user_agent") + .HasDefaultValueSql("''"); + + b.Property("Version") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("version") + .HasDefaultValueSql("''"); + + b.HasKey("Id"); + + b.HasIndex("Browser") + .HasDatabaseName("idx_browser_tests_browser"); + + b.HasIndex("Os") + .HasDatabaseName("idx_browser_tests_os"); + + b.HasIndex("Platform") + .HasDatabaseName("idx_browser_tests_platform"); + + b.HasIndex("UserAgent") + .HasDatabaseName("idx_browser_tests_user_agent"); + + b.HasIndex("Version") + .HasDatabaseName("idx_browser_tests_version"); + + b.ToTable("browser_tests", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.CollectedBook", b => + { + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.Property("BookId") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.HasKey("UserId", "BookId"); + + b.HasIndex("BookId"); + + b.ToTable("CollectedBooks"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CollectedDocument", b => + { + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.Property("DocumentId") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.HasKey("UserId", "DocumentId"); + + b.HasIndex("DocumentId"); + + b.ToTable("CollectedDocuments"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CollectedSoftwareRelease", b => + { + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.Property("SoftwareReleaseId") + .HasColumnType("bigint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.HasKey("UserId", "SoftwareReleaseId"); + + b.HasIndex("SoftwareReleaseId"); + + b.ToTable("CollectedSoftwareReleases"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CompaniesByBook", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("BookId") + .HasColumnType("bigint"); + + b.Property("CompanyId") + .HasColumnType("int(11)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("char(3)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("BookId"); + + b.HasIndex("CompanyId"); + + b.HasIndex("RoleId"); + + b.ToTable("CompaniesByBooks"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CompaniesByDocument", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CompanyId") + .HasColumnType("int(11)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("DocumentId") + .HasColumnType("bigint"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("char(3)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("CompanyId"); + + b.HasIndex("DocumentId"); + + b.HasIndex("RoleId"); + + b.ToTable("CompaniesByDocuments"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CompaniesByMagazine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CompanyId") + .HasColumnType("int(11)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("MagazineId") + .HasColumnType("bigint"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("char(3)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("CompanyId"); + + b.HasIndex("MagazineId"); + + b.HasIndex("RoleId"); + + b.ToTable("CompaniesByMagazines"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Company", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Address") + .HasMaxLength(80) + .HasColumnType("varchar(80)") + .HasColumnName("address"); + + b.Property("City") + .HasMaxLength(80) + .HasColumnType("varchar(80)") + .HasColumnName("city"); + + b.Property("CountryId") + .HasColumnType("smallint(3)") + .HasColumnName("country"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Facebook") + .HasMaxLength(45) + .HasColumnType("varchar(45)") + .HasColumnName("facebook"); + + b.Property("Founded") + .HasColumnType("datetime") + .HasColumnName("founded"); + + b.Property("FoundedPrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("LegalName") + .HasColumnType("longtext"); + + b.Property("Name") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("varchar(128)") + .HasColumnName("name") + .HasDefaultValueSql("''"); + + b.Property("PostalCode") + .HasMaxLength(25) + .HasColumnType("varchar(25)") + .HasColumnName("postal_code"); + + b.Property("Province") + .HasMaxLength(80) + .HasColumnType("varchar(80)") + .HasColumnName("province"); + + b.Property("Sold") + .HasColumnType("datetime") + .HasColumnName("sold"); + + b.Property("SoldPrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("SoldToId") + .HasColumnType("int(11)") + .HasColumnName("sold_to"); + + b.Property("Status") + .HasColumnType("int(11)") + .HasColumnName("status"); + + b.Property("Twitter") + .HasMaxLength(45) + .HasColumnType("varchar(45)") + .HasColumnName("twitter"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("Website") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("website"); + + b.HasKey("Id"); + + b.HasIndex("Address") + .HasDatabaseName("idx_companies_address"); + + b.HasIndex("City") + .HasDatabaseName("idx_companies_city"); + + b.HasIndex("CountryId") + .HasDatabaseName("idx_companies_country"); + + b.HasIndex("Facebook") + .HasDatabaseName("idx_companies_facebook"); + + b.HasIndex("Founded") + .HasDatabaseName("idx_companies_founded"); + + b.HasIndex("Name") + .HasDatabaseName("idx_companies_name"); + + b.HasIndex("PostalCode") + .HasDatabaseName("idx_companies_postal_code"); + + b.HasIndex("Province") + .HasDatabaseName("idx_companies_province"); + + b.HasIndex("Sold") + .HasDatabaseName("idx_companies_sold"); + + b.HasIndex("SoldToId") + .HasDatabaseName("idx_companies_sold_to"); + + b.HasIndex("Status") + .HasDatabaseName("idx_companies_status"); + + b.HasIndex("Twitter") + .HasDatabaseName("idx_companies_twitter"); + + b.HasIndex("Website") + .HasDatabaseName("idx_companies_website"); + + b.ToTable("companies", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.CompanyBySoftwareFamily", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CompanyId") + .HasColumnType("int(11)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("char(3)"); + + b.Property("SoftwareFamilyId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("CompanyId"); + + b.HasIndex("RoleId"); + + b.HasIndex("SoftwareFamilyId"); + + b.ToTable("CompaniesBySoftwareFamilies"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CompanyBySoftwareVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CompanyId") + .HasColumnType("int(11)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("char(3)"); + + b.Property("SoftwareVersionId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("CompanyId"); + + b.HasIndex("RoleId"); + + b.HasIndex("SoftwareVersionId"); + + b.ToTable("CompaniesBySoftwareVersions"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CompanyDescription", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CompanyId") + .HasColumnType("int(11)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Html") + .HasMaxLength(262144) + .HasColumnType("longtext"); + + b.Property("LanguageCode") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("char(3)"); + + b.Property("Text") + .IsRequired() + .HasMaxLength(262144) + .HasColumnType("longtext"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("LanguageCode"); + + b.HasIndex("Text") + .HasAnnotation("MySql:FullTextIndex", true); + + b.HasIndex("CompanyId", "LanguageCode") + .IsUnique() + .HasDatabaseName("idx_company_descriptions_company_language"); + + b.ToTable("CompanyDescriptions"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CompanyLogo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CompanyId") + .HasColumnType("int(11)") + .HasColumnName("company_id"); + + b.Property("Guid") + .HasColumnType("char(36)") + .HasColumnName("logo_guid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("Year") + .HasColumnType("int(4)") + .HasColumnName("year"); + + b.HasKey("Id", "CompanyId", "Guid"); + + b.HasIndex("CompanyId") + .HasDatabaseName("idx_company_id"); + + b.HasIndex("Guid") + .HasDatabaseName("idx_guid"); + + b.HasIndex("Id") + .IsUnique() + .HasDatabaseName("idx_id"); + + b.ToTable("company_logos", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.Conversation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("IsSystemThread") + .HasColumnType("bit(1)"); + + b.Property("Subject") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("IsSystemThread"); + + b.ToTable("Conversations"); + }); + + modelBuilder.Entity("Marechai.Database.Models.ConversationParticipant", b => + { + b.Property("ConversationId") + .HasColumnType("bigint"); + + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.Property("JoinedOn") + .HasColumnType("datetime(6)"); + + b.Property("LeftOn") + .HasColumnType("datetime(6)"); + + b.HasKey("ConversationId", "UserId"); + + b.HasIndex("UserId"); + + b.ToTable("ConversationParticipants"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CurrencyInflation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("CurrencyCode") + .IsRequired() + .HasColumnType("varchar(3)"); + + b.Property("Inflation") + .HasColumnType("float"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("Year") + .HasColumnType("int unsigned"); + + b.HasKey("Id"); + + b.HasIndex("CurrencyCode"); + + b.HasIndex("Year"); + + b.ToTable("CurrenciesInflation"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CurrencyPegging", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("DestinationCode") + .IsRequired() + .HasColumnType("varchar(3)"); + + b.Property("End") + .HasColumnType("datetime(6)"); + + b.Property("Ratio") + .HasColumnType("float"); + + b.Property("SourceCode") + .IsRequired() + .HasColumnType("varchar(3)"); + + b.Property("Start") + .HasColumnType("datetime(6)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("DestinationCode"); + + b.HasIndex("End"); + + b.HasIndex("SourceCode"); + + b.HasIndex("Start"); + + b.ToTable("CurrenciesPegging"); + }); + + modelBuilder.Entity("Marechai.Database.Models.DbFile", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AccoustId") + .HasColumnType("varchar(255)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Hack") + .HasColumnType("bit(1)"); + + b.Property("HackGroup") + .HasColumnType("varchar(255)"); + + b.Property("Infected") + .HasColumnType("bit(1)"); + + b.Property("Magic") + .HasColumnType("varchar(255)"); + + b.Property("Malware") + .HasColumnType("varchar(255)"); + + b.Property("Md5") + .HasColumnType("binary(16)"); + + b.Property("Mime") + .HasColumnType("varchar(255)"); + + b.Property("Sha1") + .HasColumnType("binary(20)"); + + b.Property("Sha256") + .HasColumnType("binary(32)"); + + b.Property("Sha3") + .HasColumnType("binary(64)"); + + b.Property("Size") + .HasColumnType("bigint unsigned"); + + b.Property("Spamsum") + .HasColumnType("varchar(255)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("AccoustId"); + + b.HasIndex("Hack"); + + b.HasIndex("HackGroup"); + + b.HasIndex("Infected"); + + b.HasIndex("Magic"); + + b.HasIndex("Malware"); + + b.HasIndex("Md5"); + + b.HasIndex("Mime"); + + b.HasIndex("Sha1"); + + b.HasIndex("Sha256"); + + b.HasIndex("Sha3"); + + b.HasIndex("Size"); + + b.HasIndex("Spamsum"); + + b.ToTable("Files"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Document", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CountryId") + .HasColumnType("smallint(3)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("NativeTitle") + .HasColumnType("varchar(255)"); + + b.Property("Published") + .HasColumnType("datetime(6)"); + + b.Property("PublishedPrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("SortTitle") + .HasColumnType("longtext"); + + b.Property("Title") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("CountryId"); + + b.HasIndex("NativeTitle"); + + b.HasIndex("Published"); + + b.HasIndex("Title"); + + b.ToTable("Documents"); + }); + + modelBuilder.Entity("Marechai.Database.Models.DocumentRole", b => + { + b.Property("Id") + .HasColumnType("char(3)"); + + b.Property("Enabled") + .ValueGeneratedOnAdd() + .HasColumnType("bit(1)") + .HasDefaultValue(true); + + b.Property("Name") + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("Enabled"); + + b.HasIndex("Name"); + + b.ToTable("DocumentRoles"); + }); + + modelBuilder.Entity("Marechai.Database.Models.DocumentScan", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Author") + .HasColumnType("varchar(255)"); + + b.Property("ColorSpace") + .HasColumnType("smallint unsigned"); + + b.Property("Comments") + .HasColumnType("varchar(255)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("DocumentId") + .HasColumnType("bigint"); + + b.Property("ExifVersion") + .HasColumnType("varchar(255)"); + + b.Property("HorizontalResolution") + .HasColumnType("double"); + + b.Property("OriginalExtension") + .HasColumnType("longtext"); + + b.Property("Page") + .HasColumnType("int unsigned"); + + b.Property("ResolutionUnit") + .HasColumnType("smallint unsigned"); + + b.Property("ScannerManufacturer") + .HasColumnType("varchar(255)"); + + b.Property("ScannerModel") + .HasColumnType("varchar(255)"); + + b.Property("SoftwareUsed") + .HasColumnType("varchar(255)"); + + b.Property("Type") + .HasColumnType("int unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("UploadDate") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.Property("VerticalResolution") + .HasColumnType("double"); + + b.HasKey("Id"); + + b.HasIndex("Author"); + + b.HasIndex("ColorSpace"); + + b.HasIndex("Comments"); + + b.HasIndex("CreationDate"); + + b.HasIndex("DocumentId"); + + b.HasIndex("ExifVersion"); + + b.HasIndex("HorizontalResolution"); + + b.HasIndex("Page"); + + b.HasIndex("ResolutionUnit"); + + b.HasIndex("ScannerManufacturer"); + + b.HasIndex("ScannerModel"); + + b.HasIndex("SoftwareUsed"); + + b.HasIndex("Type"); + + b.HasIndex("UploadDate"); + + b.HasIndex("UserId"); + + b.HasIndex("VerticalResolution"); + + b.ToTable("DocumentScans"); + }); + + modelBuilder.Entity("Marechai.Database.Models.DocumentSynopsis", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("DocumentId") + .HasColumnType("bigint"); + + b.Property("LanguageCode") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("char(3)"); + + b.Property("Text") + .IsRequired() + .HasMaxLength(262144) + .HasColumnType("longtext"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("LanguageCode"); + + b.HasIndex("Text") + .HasAnnotation("MySql:FullTextIndex", true); + + b.HasIndex("DocumentId", "LanguageCode") + .IsUnique() + .HasDatabaseName("idx_document_synopses_document_language"); + + b.ToTable("DocumentSynopses"); + }); + + modelBuilder.Entity("Marechai.Database.Models.DocumentsByMachine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("DocumentId") + .HasColumnType("bigint"); + + b.Property("MachineId") + .HasColumnType("int(11)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("MachineId"); + + b.ToTable("DocumentsByMachines"); + }); + + modelBuilder.Entity("Marechai.Database.Models.DocumentsByMachineFamily", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("DocumentId") + .HasColumnType("bigint"); + + b.Property("MachineFamilyId") + .HasColumnType("int(11)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("MachineFamilyId"); + + b.ToTable("DocumentsByMachineFamily", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.Dump", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("DumpDate") + .HasColumnType("datetime(6)"); + + b.Property("Dumper") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("DumpingGroup") + .HasColumnType("varchar(255)"); + + b.Property("MediaDumpId") + .HasColumnType("bigint unsigned"); + + b.Property("MediaId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("DumpDate"); + + b.HasIndex("Dumper"); + + b.HasIndex("DumpingGroup"); + + b.HasIndex("MediaDumpId"); + + b.HasIndex("MediaId"); + + b.HasIndex("UserId"); + + b.ToTable("Dumps"); + }); + + modelBuilder.Entity("Marechai.Database.Models.DumpHardware", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("DumpId") + .HasColumnType("bigint unsigned"); + + b.Property("Extents") + .IsRequired() + .HasColumnType("json"); + + b.Property("Firmware") + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("Manufacturer") + .HasMaxLength(48) + .HasColumnType("varchar(48)"); + + b.Property("Model") + .IsRequired() + .HasMaxLength(48) + .HasColumnType("varchar(48)"); + + b.Property("Revision") + .HasMaxLength(48) + .HasColumnType("varchar(48)"); + + b.Property("Serial") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("SoftwareName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("SoftwareOperatingSystem") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("SoftwareVersion") + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("DumpId"); + + b.HasIndex("Firmware"); + + b.HasIndex("Manufacturer"); + + b.HasIndex("Model"); + + b.HasIndex("Revision"); + + b.HasIndex("Serial"); + + b.HasIndex("SoftwareName"); + + b.HasIndex("SoftwareOperatingSystem"); + + b.HasIndex("SoftwareVersion"); + + b.ToTable("DumpHardwares"); + }); + + modelBuilder.Entity("Marechai.Database.Models.FileDataStream", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("FileId") + .HasColumnType("bigint unsigned"); + + b.Property("Name") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("Size") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("FileId"); + + b.HasIndex("Name"); + + b.HasIndex("Size"); + + b.ToTable("FileDataStreams"); + }); + + modelBuilder.Entity("Marechai.Database.Models.FileDataStreamsByMediaFile", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("FileDataStreamId") + .HasColumnType("bigint unsigned"); + + b.Property("MediaFileId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("FileDataStreamId"); + + b.HasIndex("MediaFileId"); + + b.ToTable("FileDataStreamsByMediaFile"); + }); + + modelBuilder.Entity("Marechai.Database.Models.FileDataStreamsByStandaloneFile", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("FileDataStreamId") + .HasColumnType("bigint unsigned"); + + b.Property("StandaloneFileId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("FileDataStreamId"); + + b.HasIndex("StandaloneFileId"); + + b.ToTable("FileDataStreamsByStandaloneFile"); + }); + + modelBuilder.Entity("Marechai.Database.Models.FilesByFilesystem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("FileId") + .HasColumnType("bigint unsigned"); + + b.Property("FilesystemId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("FileId"); + + b.HasIndex("FilesystemId"); + + b.ToTable("FilesByFilesystem"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Filesystem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("ApplicationIdentifier") + .HasColumnType("varchar(255)"); + + b.Property("BackupDate") + .HasColumnType("datetime(6)"); + + b.Property("Bootable") + .HasColumnType("bit(1)"); + + b.Property("ClusterSize") + .HasColumnType("int"); + + b.Property("Clusters") + .HasColumnType("bigint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("DataPreparerIdentifier") + .HasColumnType("varchar(255)"); + + b.Property("EffectiveDate") + .HasColumnType("datetime(6)"); + + b.Property("ExpirationDate") + .HasColumnType("datetime(6)"); + + b.Property("FilesCount") + .HasColumnType("bigint unsigned"); + + b.Property("FreeClusters") + .HasColumnType("bigint unsigned"); + + b.Property("Label") + .HasColumnType("varchar(255)"); + + b.Property("ModificationDate") + .HasColumnType("datetime(6)"); + + b.Property("PublisherIdentifier") + .HasColumnType("varchar(255)"); + + b.Property("Serial") + .HasColumnType("varchar(255)"); + + b.Property("SystemIdentifier") + .HasColumnType("varchar(255)"); + + b.Property("Type") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("VolumeSetIdentifier") + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationIdentifier"); + + b.HasIndex("BackupDate"); + + b.HasIndex("CreationDate"); + + b.HasIndex("DataPreparerIdentifier"); + + b.HasIndex("Label"); + + b.HasIndex("ModificationDate"); + + b.HasIndex("PublisherIdentifier"); + + b.HasIndex("Serial"); + + b.HasIndex("SystemIdentifier"); + + b.HasIndex("Type"); + + b.HasIndex("VolumeSetIdentifier"); + + b.ToTable("Filesystems"); + }); + + modelBuilder.Entity("Marechai.Database.Models.FilesystemsByLogicalPartition", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("FilesystemId") + .HasColumnType("bigint unsigned"); + + b.Property("PartitionId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("FilesystemId"); + + b.HasIndex("PartitionId"); + + b.ToTable("FilesystemsByLogicalPartition"); + }); + + modelBuilder.Entity("Marechai.Database.Models.FilesystemsByMediaDumpFile", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("FilesystemId") + .HasColumnType("bigint unsigned"); + + b.Property("MediaDumpFileImageId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("FilesystemId"); + + b.HasIndex("MediaDumpFileImageId"); + + b.ToTable("FilesystemsByMediaDumpFile"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Forbidden", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Browser") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("char(128)") + .HasColumnName("browser") + .HasDefaultValueSql("''"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Date") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("char(20)") + .HasColumnName("date") + .HasDefaultValueSql("''"); + + b.Property("Ip") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("char(16)") + .HasColumnName("ip") + .HasDefaultValueSql("''"); + + b.Property("Referer") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("char(255)") + .HasColumnName("referer") + .HasDefaultValueSql("''"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("Browser") + .HasDatabaseName("idx_forbidden_browser"); + + b.HasIndex("Date") + .HasDatabaseName("idx_forbidden_date"); + + b.HasIndex("Ip") + .HasDatabaseName("idx_forbidden_ip"); + + b.HasIndex("Referer") + .HasDatabaseName("idx_forbidden_referer"); + + b.ToTable("forbidden", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.GenreBySoftware", b => + { + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("GenreId") + .HasColumnType("int"); + + b.HasKey("SoftwareId", "GenreId"); + + b.HasIndex("GenreId"); + + b.ToTable("GenresBySoftware"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Gpu", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CompanyId") + .HasColumnType("int(11)") + .HasColumnName("company"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("DieSize") + .HasColumnType("float") + .HasColumnName("die_size"); + + b.Property("Introduced") + .HasColumnType("datetime") + .HasColumnName("introduced"); + + b.Property("IntroducedPrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("ModelCode") + .HasMaxLength(45) + .HasColumnType("varchar(45)") + .HasColumnName("model_code"); + + b.Property("Name") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(128) + .HasColumnType("char(128)") + .HasColumnName("name") + .HasDefaultValueSql("''"); + + b.Property("Package") + .HasMaxLength(45) + .HasColumnType("varchar(45)") + .HasColumnName("package"); + + b.Property("Process") + .HasMaxLength(45) + .HasColumnType("varchar(45)") + .HasColumnName("process"); + + b.Property("ProcessNm") + .HasColumnType("float") + .HasColumnName("process_nm"); + + b.Property("Transistors") + .HasColumnType("bigint(20)") + .HasColumnName("transistors"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("CompanyId") + .HasDatabaseName("idx_gpus_company"); + + b.HasIndex("DieSize") + .HasDatabaseName("idx_gpus_die_size"); + + b.HasIndex("Introduced") + .HasDatabaseName("idx_gpus_introduced"); + + b.HasIndex("ModelCode") + .HasDatabaseName("idx_gpus_model_code"); + + b.HasIndex("Name") + .HasDatabaseName("idx_gpus_name"); + + b.HasIndex("Package") + .HasDatabaseName("idx_gpus_package"); + + b.HasIndex("Process") + .HasDatabaseName("idx_gpus_process"); + + b.HasIndex("ProcessNm") + .HasDatabaseName("idx_gpus_process_nm"); + + b.HasIndex("Transistors") + .HasDatabaseName("idx_gpus_transistors"); + + b.ToTable("gpus", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.GpuDescription", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("GpuId") + .HasColumnType("int(11)"); + + b.Property("Html") + .HasMaxLength(262144) + .HasColumnType("longtext"); + + b.Property("LanguageCode") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("char(3)") + .UseCollation("utf8mb4_general_ci"); + + b.Property("Text") + .IsRequired() + .HasMaxLength(262144) + .HasColumnType("longtext"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("LanguageCode"); + + b.HasIndex("Text") + .HasAnnotation("MySql:FullTextIndex", true); + + b.HasIndex("GpuId", "LanguageCode") + .IsUnique() + .HasDatabaseName("idx_gpu_descriptions_gpu_language"); + + b.ToTable("GpuDescriptions"); + }); + + modelBuilder.Entity("Marechai.Database.Models.GpuPhoto", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Aperture") + .HasColumnType("double"); + + b.Property("Author") + .HasColumnType("varchar(255)"); + + b.Property("CameraManufacturer") + .HasColumnType("varchar(255)"); + + b.Property("CameraModel") + .HasColumnType("varchar(255)"); + + b.Property("ColorSpace") + .HasColumnType("smallint unsigned"); + + b.Property("Comments") + .HasColumnType("varchar(255)"); + + b.Property("Contrast") + .HasColumnType("smallint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("DigitalZoomRatio") + .HasColumnType("double"); + + b.Property("ExifVersion") + .HasColumnType("varchar(255)"); + + b.Property("ExposureMethod") + .HasColumnType("smallint unsigned"); + + b.Property("ExposureProgram") + .HasColumnType("smallint unsigned"); + + b.Property("ExposureTime") + .HasColumnType("double"); + + b.Property("Flash") + .HasColumnType("smallint unsigned"); + + b.Property("Focal") + .HasColumnType("double"); + + b.Property("FocalLength") + .HasColumnType("double"); + + b.Property("FocalLengthEquivalent") + .HasColumnType("double"); + + b.Property("GpuId") + .HasColumnType("int(11)"); + + b.Property("HorizontalResolution") + .HasColumnType("double"); + + b.Property("IsoRating") + .HasColumnType("smallint unsigned"); + + b.Property("Lens") + .HasColumnType("varchar(255)"); + + b.Property("LicenseId") + .HasColumnType("int"); + + b.Property("LightSource") + .HasColumnType("smallint unsigned"); + + b.Property("MeteringMode") + .HasColumnType("smallint unsigned"); + + b.Property("Orientation") + .HasColumnType("smallint unsigned"); + + b.Property("OriginalExtension") + .HasColumnType("longtext"); + + b.Property("ResolutionUnit") + .HasColumnType("smallint unsigned"); + + b.Property("Saturation") + .HasColumnType("smallint unsigned"); + + b.Property("SceneCaptureType") + .HasColumnType("smallint unsigned"); + + b.Property("SensingMethod") + .HasColumnType("smallint unsigned"); + + b.Property("Sharpness") + .HasColumnType("smallint unsigned"); + + b.Property("SoftwareUsed") + .HasColumnType("varchar(255)"); + + b.Property("Source") + .HasColumnType("longtext"); + + b.Property("SubjectDistanceRange") + .HasColumnType("smallint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("UploadDate") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.Property("VerticalResolution") + .HasColumnType("double"); + + b.Property("WhiteBalance") + .HasColumnType("smallint unsigned"); + + b.HasKey("Id"); + + b.HasIndex("Aperture"); + + b.HasIndex("Author"); + + b.HasIndex("CameraManufacturer"); + + b.HasIndex("CameraModel"); + + b.HasIndex("ColorSpace"); + + b.HasIndex("Comments"); + + b.HasIndex("Contrast"); + + b.HasIndex("CreationDate"); + + b.HasIndex("DigitalZoomRatio"); + + b.HasIndex("ExifVersion"); + + b.HasIndex("ExposureMethod"); + + b.HasIndex("ExposureProgram"); + + b.HasIndex("ExposureTime"); + + b.HasIndex("Flash"); + + b.HasIndex("Focal"); + + b.HasIndex("FocalLength"); + + b.HasIndex("FocalLengthEquivalent"); + + b.HasIndex("GpuId"); + + 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.ToTable("GpuPhotos"); + }); + + modelBuilder.Entity("Marechai.Database.Models.GpuVideo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("GpuId") + .HasColumnType("int(11)"); + + b.Property("Provider") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("Title") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("VideoId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("GpuId"); + + b.HasIndex("GpuId", "Provider", "VideoId") + .IsUnique(); + + b.ToTable("GpuVideos"); + }); + + modelBuilder.Entity("Marechai.Database.Models.GpusByMachine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint(20)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("GpuId") + .HasColumnType("int(11)") + .HasColumnName("gpu"); + + b.Property("MachineId") + .HasColumnType("int(11)") + .HasColumnName("machine"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("GpuId") + .HasDatabaseName("idx_gpus_by_machine_gpus"); + + b.HasIndex("MachineId") + .HasDatabaseName("idx_gpus_by_machine_machine"); + + b.ToTable("gpus_by_machine", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.InstructionSet", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(45) + .HasColumnType("varchar(45)") + .HasColumnName("instruction_set"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.ToTable("instruction_sets", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.InstructionSetExtension", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Extension") + .IsRequired() + .HasMaxLength(45) + .HasColumnType("varchar(45)") + .HasColumnName("extension"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.ToTable("instruction_set_extensions", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.InstructionSetExtensionsByProcessor", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("ProcessorId") + .HasColumnType("int(11)") + .HasColumnName("processor_id"); + + b.Property("ExtensionId") + .HasColumnType("int(11)") + .HasColumnName("extension_id"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id", "ProcessorId", "ExtensionId"); + + b.HasIndex("ExtensionId") + .HasDatabaseName("idx_setextension_extension"); + + b.HasIndex("ProcessorId") + .HasDatabaseName("idx_setextension_processor"); + + b.ToTable("instruction_set_extensions_by_processor", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.Iso31661Numeric", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("smallint(3)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("name"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("Name") + .HasDatabaseName("idx_name"); + + b.ToTable("iso3166_1_numeric", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.Iso4217", b => + { + b.Property("Code") + .HasMaxLength(3) + .HasColumnType("varchar(3)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("MinorUnits") + .HasColumnType("tinyint unsigned"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("varchar(150)"); + + b.Property("Numeric") + .HasColumnType("smallint(3)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("Withdrawn") + .HasColumnType("datetime(6)"); + + b.HasKey("Code"); + + b.HasIndex("Numeric"); + + b.HasIndex("Withdrawn"); + + b.ToTable("Iso4217"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Iso639", b => + { + b.Property("Id") + .HasColumnType("char(3)"); + + b.Property("Comment") + .HasColumnType("varchar(150)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Part1") + .HasColumnType("char(2)"); + + b.Property("Part2B") + .HasColumnType("char(3)"); + + b.Property("Part2T") + .HasColumnType("char(3)"); + + b.Property("ReferenceName") + .IsRequired() + .HasColumnType("varchar(150)") + .HasColumnName("Ref_Name"); + + b.Property("Scope") + .IsRequired() + .HasColumnType("char(1)"); + + b.Property("Type") + .IsRequired() + .HasColumnType("char(1)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("Comment"); + + b.HasIndex("Part1"); + + b.HasIndex("Part2B"); + + b.HasIndex("Part2T"); + + b.HasIndex("ReferenceName"); + + b.HasIndex("Scope"); + + b.HasIndex("Type"); + + b.ToTable("ISO_639-3", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.LanguageBySoftwareRelease", b => + { + b.Property("SoftwareReleaseId") + .HasColumnType("bigint unsigned"); + + b.Property("LanguageCode") + .HasMaxLength(3) + .HasColumnType("char(3)") + .UseCollation("utf8mb4_general_ci"); + + b.HasKey("SoftwareReleaseId", "LanguageCode"); + + b.HasIndex("LanguageCode"); + + b.ToTable("LanguageBySoftwareRelease"); + }); + + modelBuilder.Entity("Marechai.Database.Models.License", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("FsfApproved") + .HasColumnType("bit(1)"); + + b.Property("Link") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("OsiApproved") + .HasColumnType("bit(1)"); + + b.Property("SPDX") + .HasColumnType("varchar(255)"); + + b.Property("Text") + .HasMaxLength(131072) + .HasColumnType("longtext"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("FsfApproved"); + + b.HasIndex("Name"); + + b.HasIndex("OsiApproved"); + + b.HasIndex("SPDX"); + + b.ToTable("Licenses"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Log", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Browser") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("char(128)") + .HasColumnName("browser") + .HasDefaultValueSql("''"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Date") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("char(20)") + .HasColumnName("date") + .HasDefaultValueSql("''"); + + b.Property("Ip") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("char(16)") + .HasColumnName("ip") + .HasDefaultValueSql("''"); + + b.Property("Referer") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("char(255)") + .HasColumnName("referer") + .HasDefaultValueSql("''"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("Browser") + .HasDatabaseName("idx_log_browser"); + + b.HasIndex("Date") + .HasDatabaseName("idx_log_date"); + + b.HasIndex("Ip") + .HasDatabaseName("idx_log_ip"); + + b.HasIndex("Referer") + .HasDatabaseName("idx_log_referer"); + + b.ToTable("log", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.LogicalPartition", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Description") + .HasColumnType("varchar(255)"); + + b.Property("FirstSector") + .HasColumnType("bigint unsigned"); + + b.Property("LastSector") + .HasColumnType("bigint unsigned"); + + b.Property("Name") + .HasColumnType("varchar(255)"); + + b.Property("Scheme") + .HasColumnType("varchar(255)"); + + b.Property("Sequence") + .HasColumnType("int unsigned"); + + b.Property("Size") + .HasColumnType("bigint unsigned"); + + b.Property("Type") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("Description"); + + b.HasIndex("FirstSector"); + + b.HasIndex("LastSector"); + + b.HasIndex("Name"); + + b.HasIndex("Scheme"); + + b.HasIndex("Type"); + + b.ToTable("LogicalPartitions"); + }); + + modelBuilder.Entity("Marechai.Database.Models.LogicalPartitionsByMedia", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("MediaId") + .HasColumnType("bigint unsigned"); + + b.Property("PartitionId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("MediaId"); + + b.HasIndex("PartitionId"); + + b.ToTable("LogicalPartitionsByMedia"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Machine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CompanyId") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("company") + .HasDefaultValueSql("'0'"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("FamilyId") + .HasColumnType("int(11)") + .HasColumnName("family"); + + b.Property("Introduced") + .HasColumnType("datetime") + .HasColumnName("introduced"); + + b.Property("IntroducedPrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("Model") + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasColumnName("model"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("name"); + + b.Property("Prototype") + .HasColumnType("bit(1)"); + + b.Property("Type") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasDefaultValue(0) + .HasColumnName("type"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("CompanyId") + .HasDatabaseName("idx_machines_company"); + + b.HasIndex("FamilyId") + .HasDatabaseName("idx_machines_family"); + + b.HasIndex("Introduced") + .HasDatabaseName("idx_machines_introduced"); + + b.HasIndex("Model") + .HasDatabaseName("idx_machines_model"); + + b.HasIndex("Name") + .HasDatabaseName("idx_machines_name"); + + b.HasIndex("Type") + .HasDatabaseName("idx_machines_type"); + + b.ToTable("machines", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.MachineDescription", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Html") + .HasMaxLength(262144) + .HasColumnType("longtext"); + + b.Property("LanguageCode") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("char(3)") + .UseCollation("utf8mb4_general_ci"); + + b.Property("MachineId") + .HasColumnType("int(11)"); + + b.Property("Text") + .IsRequired() + .HasMaxLength(262144) + .HasColumnType("longtext"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("LanguageCode"); + + b.HasIndex("Text") + .HasAnnotation("MySql:FullTextIndex", true); + + b.HasIndex("MachineId", "LanguageCode") + .IsUnique() + .HasDatabaseName("idx_machine_descriptions_machine_language"); + + b.ToTable("MachineDescriptions"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MachineFamily", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CompanyId") + .HasColumnType("int(11)") + .HasColumnName("company"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("name"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("CompanyId") + .HasDatabaseName("idx_machine_families_company"); + + b.HasIndex("Name") + .HasDatabaseName("idx_machine_families_name"); + + b.ToTable("machine_families", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.MachinePhoto", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Aperture") + .HasColumnType("double"); + + b.Property("Author") + .HasColumnType("varchar(255)"); + + b.Property("CameraManufacturer") + .HasColumnType("varchar(255)"); + + b.Property("CameraModel") + .HasColumnType("varchar(255)"); + + b.Property("ColorSpace") + .HasColumnType("smallint unsigned"); + + b.Property("Comments") + .HasColumnType("varchar(255)"); + + b.Property("Contrast") + .HasColumnType("smallint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("DigitalZoomRatio") + .HasColumnType("double"); + + b.Property("ExifVersion") + .HasColumnType("varchar(255)"); + + b.Property("ExposureMethod") + .HasColumnType("smallint unsigned"); + + b.Property("ExposureProgram") + .HasColumnType("smallint unsigned"); + + b.Property("ExposureTime") + .HasColumnType("double"); + + b.Property("Flash") + .HasColumnType("smallint unsigned"); + + b.Property("Focal") + .HasColumnType("double"); + + b.Property("FocalLength") + .HasColumnType("double"); + + b.Property("FocalLengthEquivalent") + .HasColumnType("double"); + + b.Property("HorizontalResolution") + .HasColumnType("double"); + + b.Property("IsoRating") + .HasColumnType("smallint unsigned"); + + b.Property("Lens") + .HasColumnType("varchar(255)"); + + b.Property("LicenseId") + .HasColumnType("int"); + + b.Property("LightSource") + .HasColumnType("smallint unsigned"); + + b.Property("MachineId") + .HasColumnType("int(11)"); + + b.Property("MeteringMode") + .HasColumnType("smallint unsigned"); + + b.Property("Orientation") + .HasColumnType("smallint unsigned"); + + b.Property("OriginalExtension") + .HasColumnType("longtext"); + + b.Property("ResolutionUnit") + .HasColumnType("smallint unsigned"); + + b.Property("Saturation") + .HasColumnType("smallint unsigned"); + + b.Property("SceneCaptureType") + .HasColumnType("smallint unsigned"); + + b.Property("SensingMethod") + .HasColumnType("smallint unsigned"); + + b.Property("Sharpness") + .HasColumnType("smallint unsigned"); + + b.Property("SoftwareUsed") + .HasColumnType("varchar(255)"); + + b.Property("Source") + .HasColumnType("longtext"); + + b.Property("SubjectDistanceRange") + .HasColumnType("smallint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("UploadDate") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.Property("VerticalResolution") + .HasColumnType("double"); + + b.Property("WhiteBalance") + .HasColumnType("smallint unsigned"); + + b.HasKey("Id"); + + b.HasIndex("Aperture"); + + b.HasIndex("Author"); + + b.HasIndex("CameraManufacturer"); + + b.HasIndex("CameraModel"); + + b.HasIndex("ColorSpace"); + + b.HasIndex("Comments"); + + b.HasIndex("Contrast"); + + b.HasIndex("CreationDate"); + + b.HasIndex("DigitalZoomRatio"); + + b.HasIndex("ExifVersion"); + + b.HasIndex("ExposureMethod"); + + b.HasIndex("ExposureProgram"); + + b.HasIndex("ExposureTime"); + + b.HasIndex("Flash"); + + b.HasIndex("Focal"); + + b.HasIndex("FocalLength"); + + b.HasIndex("FocalLengthEquivalent"); + + b.HasIndex("HorizontalResolution"); + + b.HasIndex("IsoRating"); + + b.HasIndex("Lens"); + + b.HasIndex("LicenseId"); + + b.HasIndex("LightSource"); + + b.HasIndex("MachineId"); + + b.HasIndex("MeteringMode"); + + b.HasIndex("Orientation"); + + b.HasIndex("ResolutionUnit"); + + b.HasIndex("Saturation"); + + b.HasIndex("SceneCaptureType"); + + b.HasIndex("SensingMethod"); + + b.HasIndex("Sharpness"); + + b.HasIndex("SoftwareUsed"); + + b.HasIndex("SubjectDistanceRange"); + + b.HasIndex("UploadDate"); + + b.HasIndex("UserId"); + + b.HasIndex("VerticalResolution"); + + b.HasIndex("WhiteBalance"); + + b.ToTable("MachinePhotos"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MachineVideo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("MachineId") + .HasColumnType("int(11)"); + + b.Property("Provider") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("Title") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("VideoId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("MachineId"); + + b.HasIndex("MachineId", "Provider", "VideoId") + .IsUnique(); + + b.ToTable("MachineVideos"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Magazine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CountryId") + .HasColumnType("smallint(3)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("FirstPublication") + .HasColumnType("datetime(6)"); + + b.Property("FirstPublicationPrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("Issn") + .HasMaxLength(8) + .HasColumnType("varchar(8)"); + + b.Property("NativeTitle") + .HasColumnType("varchar(255)"); + + b.Property("Published") + .HasColumnType("datetime(6)"); + + b.Property("PublishedPrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("SortTitle") + .HasColumnType("longtext"); + + b.Property("Title") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("CountryId"); + + b.HasIndex("FirstPublication"); + + b.HasIndex("Issn"); + + b.HasIndex("NativeTitle"); + + b.HasIndex("Published"); + + b.HasIndex("Title"); + + b.ToTable("Magazines"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MagazineIssue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Caption") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("IssueNumber") + .HasColumnType("int unsigned"); + + b.Property("MagazineId") + .HasColumnType("bigint"); + + b.Property("NativeCaption") + .HasColumnType("varchar(255)"); + + b.Property("Pages") + .HasColumnType("smallint"); + + b.Property("ProductCode") + .HasMaxLength(18) + .HasColumnType("varchar(18)"); + + b.Property("Published") + .HasColumnType("datetime(6)"); + + b.Property("PublishedPrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("Caption"); + + b.HasIndex("MagazineId"); + + b.HasIndex("NativeCaption"); + + b.HasIndex("Pages"); + + b.HasIndex("ProductCode"); + + b.HasIndex("Published"); + + b.ToTable("MagazineIssues"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MagazineScan", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Author") + .HasColumnType("varchar(255)"); + + b.Property("ColorSpace") + .HasColumnType("smallint unsigned"); + + b.Property("Comments") + .HasColumnType("varchar(255)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("ExifVersion") + .HasColumnType("varchar(255)"); + + b.Property("HorizontalResolution") + .HasColumnType("double"); + + b.Property("MagazineId") + .HasColumnType("bigint"); + + b.Property("OriginalExtension") + .HasColumnType("longtext"); + + b.Property("Page") + .HasColumnType("int unsigned"); + + b.Property("ResolutionUnit") + .HasColumnType("smallint unsigned"); + + b.Property("ScannerManufacturer") + .HasColumnType("varchar(255)"); + + b.Property("ScannerModel") + .HasColumnType("varchar(255)"); + + b.Property("SoftwareUsed") + .HasColumnType("varchar(255)"); + + b.Property("Type") + .HasColumnType("int unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("UploadDate") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.Property("VerticalResolution") + .HasColumnType("double"); + + b.HasKey("Id"); + + b.HasIndex("Author"); + + b.HasIndex("ColorSpace"); + + b.HasIndex("Comments"); + + b.HasIndex("CreationDate"); + + b.HasIndex("ExifVersion"); + + b.HasIndex("HorizontalResolution"); + + b.HasIndex("MagazineId"); + + b.HasIndex("Page"); + + b.HasIndex("ResolutionUnit"); + + b.HasIndex("ScannerManufacturer"); + + b.HasIndex("ScannerModel"); + + b.HasIndex("SoftwareUsed"); + + b.HasIndex("Type"); + + b.HasIndex("UploadDate"); + + b.HasIndex("UserId"); + + b.HasIndex("VerticalResolution"); + + b.ToTable("MagazineScans"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MagazineSynopsis", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("LanguageCode") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("char(3)"); + + b.Property("MagazineId") + .HasColumnType("bigint"); + + b.Property("Text") + .IsRequired() + .HasMaxLength(262144) + .HasColumnType("longtext"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("LanguageCode"); + + b.HasIndex("Text") + .HasAnnotation("MySql:FullTextIndex", true); + + b.HasIndex("MagazineId", "LanguageCode") + .IsUnique() + .HasDatabaseName("idx_magazine_synopses_magazine_language"); + + b.ToTable("MagazineSynopses"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MagazinesByMachine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("MachineId") + .HasColumnType("int(11)"); + + b.Property("MagazineId") + .HasColumnType("bigint"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("MachineId"); + + b.HasIndex("MagazineId"); + + b.ToTable("MagazinesByMachines"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MagazinesByMachineFamily", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("MachineFamilyId") + .HasColumnType("int(11)"); + + b.Property("MagazineId") + .HasColumnType("bigint"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("MachineFamilyId"); + + b.HasIndex("MagazineId"); + + b.ToTable("MagazinesByMachinesFamilies"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MarechaiDb", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Updated") + .ValueGeneratedOnAdd() + .HasColumnType("datetime") + .HasColumnName("updated") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .HasColumnType("int(11)") + .HasColumnName("version"); + + b.HasKey("Id"); + + b.ToTable("marechai_db", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.MasteringText", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Layer") + .HasColumnType("smallint"); + + b.Property("MediaId") + .HasColumnType("bigint unsigned"); + + b.Property("Side") + .HasColumnType("smallint"); + + b.Property("Text") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("Type") + .HasColumnType("tinyint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("MediaId"); + + b.HasIndex("Text"); + + b.HasIndex("Type"); + + b.ToTable("MasteringTexts"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Media", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Barcode") + .HasColumnType("varchar(255)"); + + b.Property("BlockSizes") + .HasColumnType("json"); + + b.Property("CatalogueNumber") + .HasColumnType("varchar(255)"); + + b.Property("CopyProtection") + .HasColumnType("varchar(255)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Firmware") + .HasColumnType("varchar(255)"); + + b.Property("LastSequence") + .HasColumnType("smallint unsigned"); + + b.Property("Layers") + .HasColumnType("smallint unsigned"); + + b.Property("LogicalBlockSize") + .HasColumnType("int"); + + b.Property("MagazineIssueId") + .HasColumnType("bigint"); + + b.Property("Manufacturer") + .HasColumnType("varchar(255)"); + + b.Property("Model") + .HasColumnType("varchar(255)"); + + b.Property("PartNumber") + .HasColumnType("varchar(255)"); + + b.Property("PhysicalBlockSize") + .HasColumnType("int"); + + b.Property("Revision") + .HasColumnType("varchar(255)"); + + b.Property("Sectors") + .HasColumnType("bigint unsigned"); + + b.Property("Sequence") + .HasColumnType("smallint unsigned"); + + b.Property("SerialNumber") + .HasColumnType("varchar(255)"); + + b.Property("Sessions") + .HasColumnType("smallint unsigned"); + + b.Property("Sides") + .HasColumnType("smallint unsigned"); + + b.Property("Size") + .HasColumnType("bigint unsigned"); + + b.Property("StorageInterface") + .HasColumnType("int"); + + b.Property("TableOfContents") + .HasColumnType("json"); + + b.Property("Title") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("Tracks") + .HasColumnType("smallint unsigned"); + + b.Property("Type") + .HasColumnType("int unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("WriteOffset") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("Barcode"); + + b.HasIndex("CatalogueNumber"); + + b.HasIndex("CopyProtection"); + + b.HasIndex("Firmware"); + + b.HasIndex("MagazineIssueId"); + + b.HasIndex("Manufacturer"); + + b.HasIndex("Model"); + + b.HasIndex("PartNumber"); + + b.HasIndex("Revision"); + + b.HasIndex("SerialNumber"); + + b.HasIndex("Title"); + + b.HasIndex("Type"); + + b.ToTable("Media"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaDump", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Format") + .HasColumnType("varchar(255)"); + + b.Property("MediaId") + .HasColumnType("bigint unsigned"); + + b.Property("Status") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("Format"); + + b.HasIndex("MediaId"); + + b.HasIndex("Status"); + + b.ToTable("MediaDumps"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaDumpFileImage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("FileSequence") + .HasColumnType("bigint"); + + b.Property("Md5") + .HasColumnType("binary(16)"); + + b.Property("MediaDumpId") + .HasColumnType("bigint unsigned"); + + b.Property("PartitionSequence") + .HasColumnType("smallint"); + + b.Property("Sha1") + .HasColumnType("binary(20)"); + + b.Property("Sha256") + .HasColumnType("binary(32)"); + + b.Property("Sha3") + .HasColumnType("binary(64)"); + + b.Property("Size") + .HasColumnType("bigint unsigned"); + + b.Property("Spamsum") + .HasColumnType("varchar(255)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("Md5"); + + b.HasIndex("MediaDumpId"); + + b.HasIndex("Sha1"); + + b.HasIndex("Sha256"); + + b.HasIndex("Sha3"); + + b.HasIndex("Size"); + + b.HasIndex("Spamsum"); + + b.ToTable("MediaDumpFileImages"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaDumpImage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AccoustId") + .HasColumnType("varchar(255)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Md5") + .HasColumnType("binary(16)"); + + b.Property("MediaDumpId") + .HasColumnType("bigint unsigned"); + + b.Property("Sha1") + .HasColumnType("binary(20)"); + + b.Property("Sha256") + .HasColumnType("binary(32)"); + + b.Property("Sha3") + .HasColumnType("binary(64)"); + + b.Property("Size") + .HasColumnType("bigint unsigned"); + + b.Property("Spamsum") + .HasColumnType("varchar(255)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("AccoustId"); + + b.HasIndex("Md5"); + + b.HasIndex("MediaDumpId") + .IsUnique(); + + b.HasIndex("Sha1"); + + b.HasIndex("Sha256"); + + b.HasIndex("Sha3"); + + b.HasIndex("Size"); + + b.HasIndex("Spamsum"); + + b.ToTable("MediaDumpImages"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaDumpSubchannelImage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Md5") + .HasColumnType("binary(16)"); + + b.Property("MediaDumpId") + .HasColumnType("bigint unsigned"); + + b.Property("Sha1") + .HasColumnType("binary(20)"); + + b.Property("Sha256") + .HasColumnType("binary(32)"); + + b.Property("Sha3") + .HasColumnType("binary(64)"); + + b.Property("Size") + .HasColumnType("bigint unsigned"); + + b.Property("Spamsum") + .HasColumnType("varchar(255)"); + + b.Property("Status") + .HasColumnType("tinyint unsigned"); + + b.Property("TrackId") + .HasColumnType("bigint unsigned"); + + b.Property("TrackSequence") + .HasColumnType("smallint"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("Md5"); + + b.HasIndex("MediaDumpId") + .IsUnique(); + + b.HasIndex("Sha1"); + + b.HasIndex("Sha256"); + + b.HasIndex("Sha3"); + + b.HasIndex("Size"); + + b.HasIndex("Spamsum"); + + b.HasIndex("TrackId") + .IsUnique(); + + b.ToTable("MediaDumpSubchannelImages"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaDumpTrackImage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Format") + .HasColumnType("varchar(255)"); + + b.Property("Md5") + .HasColumnType("binary(16)"); + + b.Property("MediaDumpId") + .HasColumnType("bigint unsigned"); + + b.Property("Sha1") + .HasColumnType("binary(20)"); + + b.Property("Sha256") + .HasColumnType("binary(32)"); + + b.Property("Sha3") + .HasColumnType("binary(64)"); + + b.Property("Size") + .HasColumnType("bigint unsigned"); + + b.Property("Spamsum") + .HasColumnType("varchar(255)"); + + b.Property("TrackSequence") + .HasColumnType("smallint"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("Format"); + + b.HasIndex("Md5"); + + b.HasIndex("MediaDumpId"); + + b.HasIndex("Sha1"); + + b.HasIndex("Sha256"); + + b.HasIndex("Sha3"); + + b.HasIndex("Size"); + + b.HasIndex("Spamsum"); + + b.ToTable("MediaDumpTrackImages"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaFile", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AccessDate") + .HasColumnType("datetime(6)"); + + b.Property("Attributes") + .HasColumnType("bigint unsigned"); + + b.Property("BackupDate") + .HasColumnType("datetime(6)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("DeviceNumber") + .HasColumnType("int unsigned"); + + b.Property("GroupId") + .HasColumnType("bigint unsigned"); + + b.Property("Inode") + .HasColumnType("bigint unsigned"); + + b.Property("IsDirectory") + .HasColumnType("bit(1)"); + + b.Property("LastWriteDate") + .HasColumnType("datetime(6)"); + + b.Property("Links") + .HasColumnType("bigint unsigned"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("Path") + .IsRequired() + .HasMaxLength(8192) + .HasColumnType("varchar(8192)"); + + b.Property("PathSeparator") + .IsRequired() + .HasColumnType("varchar(1)"); + + b.Property("PosixMode") + .HasColumnType("smallint unsigned"); + + b.Property("StatusChangeDate") + .HasColumnType("datetime(6)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("UserId") + .HasColumnType("bigint unsigned"); + + b.HasKey("Id"); + + b.HasIndex("AccessDate"); + + b.HasIndex("BackupDate"); + + b.HasIndex("CreationDate"); + + b.HasIndex("GroupId"); + + b.HasIndex("IsDirectory"); + + b.HasIndex("LastWriteDate"); + + b.HasIndex("Name"); + + b.HasIndex("Path"); + + b.HasIndex("StatusChangeDate"); + + b.HasIndex("UserId"); + + b.ToTable("MediaFiles"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaTagDump", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("FileId") + .HasColumnType("bigint unsigned"); + + b.Property("MediaDumpId") + .HasColumnType("bigint unsigned"); + + b.Property("Type") + .HasColumnType("int"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("FileId"); + + b.HasIndex("MediaDumpId"); + + b.HasIndex("Type"); + + b.ToTable("MediaTagDumps"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MemoryByMachine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint(20)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("MachineId") + .HasColumnType("int(11)") + .HasColumnName("machine"); + + b.Property("Size") + .HasColumnType("bigint(20)") + .HasColumnName("size"); + + b.Property("Speed") + .HasColumnType("double") + .HasColumnName("speed"); + + b.Property("Type") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasDefaultValue(0) + .HasColumnName("type"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("Usage") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasDefaultValue(0) + .HasColumnName("usage"); + + b.HasKey("Id"); + + b.HasIndex("MachineId") + .HasDatabaseName("idx_memory_by_machine_machine"); + + b.HasIndex("Size") + .HasDatabaseName("idx_memory_by_machine_size"); + + b.HasIndex("Speed") + .HasDatabaseName("idx_memory_by_machine_speed"); + + b.HasIndex("Type") + .HasDatabaseName("idx_memory_by_machine_type"); + + b.HasIndex("Usage") + .HasDatabaseName("idx_memory_by_machine_usage"); + + b.ToTable("memory_by_machine", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.Message", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Body") + .IsRequired() + .HasMaxLength(5000) + .HasColumnType("varchar(5000)"); + + b.Property("ConversationId") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("IsSystemAuthored") + .HasColumnType("bit(1)"); + + b.Property("ParentMessageId") + .HasColumnType("bigint"); + + b.Property("SenderId") + .HasColumnType("varchar(255)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("ParentMessageId"); + + b.HasIndex("SenderId"); + + b.HasIndex("ConversationId", "CreatedOn"); + + b.ToTable("Messages"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MessageReport", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Explanation") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.Property("IsResolved") + .HasColumnType("bit(1)"); + + b.Property("MessageId") + .HasColumnType("bigint"); + + b.Property("Reason") + .HasColumnType("int"); + + b.Property("ReporterId") + .HasColumnType("varchar(255)"); + + b.Property("ResolvedByUserId") + .HasColumnType("varchar(255)"); + + b.Property("ResolvedOn") + .HasColumnType("datetime(6)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("IsResolved"); + + b.HasIndex("MessageId"); + + b.HasIndex("ReporterId"); + + b.HasIndex("ResolvedByUserId"); + + b.ToTable("MessageReports"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MessageState", b => + { + b.Property("MessageId") + .HasColumnType("bigint"); + + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.Property("DeletedAt") + .HasColumnType("datetime(6)"); + + b.Property("IsRead") + .HasColumnType("bit(1)"); + + b.Property("ReadAt") + .HasColumnType("datetime(6)"); + + b.HasKey("MessageId", "UserId"); + + b.HasIndex("UserId", "IsRead", "DeletedAt"); + + b.ToTable("MessageStates"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MinimumGpuBySoftwareRelease", b => + { + b.Property("ReleaseId") + .HasColumnType("bigint unsigned"); + + b.Property("GpuId") + .HasColumnType("int(11)"); + + b.HasKey("ReleaseId", "GpuId"); + + b.HasIndex("GpuId"); + + b.ToTable("MinimumGpuBySoftwareRelease"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MobyGamesCoverDownloadState", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Countries") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("CoverPageUrl") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("CoverType") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("ErrorMessage") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("GroupId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("MobyGameId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("OriginalUrl") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("Platform") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ProcessedOn") + .HasColumnType("datetime(6)"); + + b.Property("SoftwareCoverId") + .HasColumnType("char(36)"); + + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("SoftwareReleaseId") + .HasColumnType("bigint unsigned"); + + b.Property("Status") + .HasColumnType("tinyint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.ToTable("MobyGamesCoverDownloadStates"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MobyGamesImportState", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("BatchNumber") + .HasColumnType("int"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("ErrorMessage") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("MobyGameId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("MobyNumericId") + .HasColumnType("int"); + + b.Property("ProcessedOn") + .HasColumnType("datetime(6)"); + + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("Status") + .HasColumnType("tinyint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("MobyGameId") + .IsUnique(); + + b.HasIndex("Status"); + + b.ToTable("MobyGamesImportStates"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MobyGamesPromoArtDownloadState", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Caption") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("ErrorMessage") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("GroupName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("MobyGameId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("OriginalUrl") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("ProcessedOn") + .HasColumnType("datetime(6)"); + + b.Property("PromoPageUrl") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("SoftwarePromoArtId") + .HasColumnType("char(36)"); + + b.Property("Status") + .HasColumnType("tinyint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("MobyGameId"); + + b.HasIndex("PromoPageUrl") + .IsUnique(); + + b.HasIndex("Status"); + + b.ToTable("MobyGamesPromoArtDownloadStates"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MobyGamesRejection", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("GameName") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("MobyGameId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Reason") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("RejectedOn") + .HasColumnType("datetime(6)"); + + b.Property("ReviewAction") + .HasColumnType("tinyint unsigned"); + + b.Property("ReviewedOn") + .HasColumnType("datetime(6)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("MobyGameId"); + + b.HasIndex("ReviewAction"); + + b.ToTable("MobyGamesRejections"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MobyGamesReviewImportState", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("ErrorMessage") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("MobyGameId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProcessedOn") + .HasColumnType("datetime(6)"); + + b.Property("ReviewsImported") + .HasColumnType("int"); + + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("Status") + .HasColumnType("tinyint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("MobyGameId") + .IsUnique(); + + b.HasIndex("Status"); + + b.ToTable("MobyGamesReviewImportStates"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MobyGamesScreenshotDownloadState", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Caption") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("ErrorMessage") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("MobyGameId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("OriginalUrl") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("Platform") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ProcessedOn") + .HasColumnType("datetime(6)"); + + b.Property("ScreenshotPageUrl") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("SoftwareScreenshotId") + .HasColumnType("char(36)"); + + b.Property("Status") + .HasColumnType("tinyint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("MobyGameId"); + + b.HasIndex("ScreenshotPageUrl") + .IsUnique(); + + b.HasIndex("Status"); + + b.ToTable("MobyGamesScreenshotDownloadStates"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MobyGamesVideoImportState", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("ErrorMessage") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("ExtractedVideoId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("MobyGameId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProcessedOn") + .HasColumnType("datetime(6)"); + + b.Property("Provider") + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("SoftwareVideoId") + .HasColumnType("bigint"); + + b.Property("Status") + .HasColumnType("tinyint unsigned"); + + b.Property("Title") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("VideoUrl") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.HasKey("Id"); + + b.HasIndex("MobyGameId"); + + b.HasIndex("SoftwareId"); + + b.HasIndex("Status"); + + b.HasIndex("VideoUrl"); + + b.ToTable("MobyGamesVideoImportStates"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MoneyDonation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Donator") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("char(128)") + .HasColumnName("donator") + .HasDefaultValueSql("''"); + + b.Property("Quantity") + .ValueGeneratedOnAdd() + .HasColumnType("decimal(11,2)") + .HasColumnName("quantity") + .HasDefaultValueSql("'0.00'"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("Donator") + .HasDatabaseName("idx_money_donations_donator"); + + b.HasIndex("Quantity") + .HasDatabaseName("idx_money_donations_quantity"); + + b.ToTable("money_donations", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.News", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AddedId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint(20)") + .HasColumnName("added_id") + .HasDefaultValueSql("'0'"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Date") + .HasColumnType("datetime") + .HasColumnName("date"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Type") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasDefaultValue(1) + .HasColumnName("type"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("AddedId") + .HasDatabaseName("idx_news_ip"); + + b.HasIndex("Date") + .HasDatabaseName("idx_news_date"); + + b.HasIndex("Type") + .HasDatabaseName("idx_news_type"); + + b.ToTable("news", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.OwnedMachine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AcquisitionDate") + .HasColumnType("datetime(6)"); + + b.Property("AcquisitionDatePrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("Boxed") + .HasColumnType("bit(1)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("LastStatusDate") + .HasColumnType("datetime(6)"); + + b.Property("LastStatusDatePrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("LostDate") + .HasColumnType("datetime(6)"); + + b.Property("LostDatePrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("MachineId") + .HasColumnType("int(11)"); + + b.Property("Manuals") + .HasColumnType("bit(1)"); + + b.Property("SerialNumber") + .HasColumnType("varchar(255)"); + + b.Property("SerialNumberVisible") + .ValueGeneratedOnAdd() + .HasColumnType("bit(1)") + .HasDefaultValue(true); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("Trade") + .HasColumnType("bit(1)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("AcquisitionDate"); + + b.HasIndex("Boxed"); + + b.HasIndex("LastStatusDate"); + + b.HasIndex("LostDate"); + + b.HasIndex("MachineId"); + + b.HasIndex("Manuals"); + + b.HasIndex("SerialNumber"); + + b.HasIndex("SerialNumberVisible"); + + b.HasIndex("Status"); + + b.HasIndex("Trade"); + + b.HasIndex("UserId"); + + b.ToTable("OwnedMachines"); + }); + + modelBuilder.Entity("Marechai.Database.Models.PeopleByBook", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("BookId") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("PersonId") + .HasColumnType("int"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("char(3)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("BookId"); + + b.HasIndex("PersonId"); + + b.HasIndex("RoleId"); + + b.ToTable("PeopleByBooks"); + }); + + modelBuilder.Entity("Marechai.Database.Models.PeopleByCompany", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CompanyId") + .HasColumnType("int(11)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("End") + .HasColumnType("datetime(6)"); + + b.Property("EndPrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("Ongoing") + .HasColumnType("bit(1)"); + + b.Property("PersonId") + .HasColumnType("int"); + + b.Property("Position") + .HasColumnType("varchar(255)"); + + b.Property("Start") + .HasColumnType("datetime(6)"); + + b.Property("StartPrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("CompanyId"); + + b.HasIndex("End"); + + b.HasIndex("PersonId"); + + b.HasIndex("Position"); + + b.HasIndex("Start"); + + b.ToTable("PeopleByCompany", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.PeopleByDocument", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("DocumentId") + .HasColumnType("bigint"); + + b.Property("PersonId") + .HasColumnType("int"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("char(3)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("PersonId"); + + b.HasIndex("RoleId"); + + b.ToTable("PeopleByDocuments"); + }); + + modelBuilder.Entity("Marechai.Database.Models.PeopleByMagazine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("MagazineId") + .HasColumnType("bigint"); + + b.Property("PersonId") + .HasColumnType("int"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("char(3)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("MagazineId"); + + b.HasIndex("PersonId"); + + b.HasIndex("RoleId"); + + b.ToTable("PeopleByMagazines"); + }); + + modelBuilder.Entity("Marechai.Database.Models.PeopleBySoftware", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("PersonId") + .HasColumnType("int"); + + b.Property("Role") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("RoleId") + .HasColumnType("char(3)"); + + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("PersonId"); + + b.HasIndex("RoleId"); + + b.HasIndex("SoftwareId", "PersonId", "Role") + .IsUnique(); + + b.ToTable("PeopleBySoftware"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Person", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Alias") + .HasColumnType("varchar(255)"); + + b.Property("BirthDate") + .HasColumnType("datetime(6)"); + + b.Property("BirthDatePrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("CountryOfBirthId") + .HasColumnType("smallint(3)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("DeathDate") + .HasColumnType("datetime(6)"); + + b.Property("DeathDatePrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("DisplayName") + .HasColumnType("varchar(255)"); + + b.Property("Facebook") + .HasColumnType("varchar(255)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("Photo") + .HasColumnType("char(36)"); + + b.Property("Surname") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("Twitter") + .HasColumnType("varchar(255)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("Webpage") + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("Alias"); + + b.HasIndex("BirthDate"); + + b.HasIndex("CountryOfBirthId"); + + b.HasIndex("DeathDate"); + + b.HasIndex("DisplayName"); + + b.HasIndex("Facebook"); + + b.HasIndex("Name"); + + b.HasIndex("Photo"); + + b.HasIndex("Surname"); + + b.HasIndex("Twitter"); + + b.HasIndex("Webpage"); + + b.ToTable("People"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Processor", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AddrBus") + .HasColumnType("int(11)") + .HasColumnName("addr_bus"); + + b.Property("CompanyId") + .HasColumnType("int(11)") + .HasColumnName("company"); + + b.Property("Cores") + .HasColumnType("int(11)") + .HasColumnName("cores"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("DataBus") + .HasColumnType("int(11)") + .HasColumnName("data_bus"); + + b.Property("DieSize") + .HasColumnType("float") + .HasColumnName("die_size"); + + b.Property("FprSize") + .HasColumnType("int(11)") + .HasColumnName("FPR_size"); + + b.Property("Fprs") + .HasColumnType("int(11)") + .HasColumnName("FPRs"); + + b.Property("GprSize") + .HasColumnType("int(11)") + .HasColumnName("GPR_size"); + + b.Property("Gprs") + .HasColumnType("int(11)") + .HasColumnName("GPRs"); + + b.Property("InstructionSetId") + .HasColumnType("int(11)") + .HasColumnName("instruction_set"); + + b.Property("Introduced") + .HasColumnType("datetime") + .HasColumnName("introduced"); + + b.Property("IntroducedPrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("L1Data") + .HasColumnType("float") + .HasColumnName("L1_data"); + + b.Property("L1Instruction") + .HasColumnType("float") + .HasColumnName("L1_instruction"); + + b.Property("L2") + .HasColumnType("float"); + + b.Property("L3") + .HasColumnType("float"); + + b.Property("ModelCode") + .HasMaxLength(45) + .HasColumnType("varchar(45)") + .HasColumnName("model_code"); + + b.Property("Name") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("char(50)") + .HasColumnName("name") + .HasDefaultValueSql("''"); + + b.Property("Package") + .HasMaxLength(45) + .HasColumnType("varchar(45)") + .HasColumnName("package"); + + b.Property("Process") + .HasMaxLength(45) + .HasColumnType("varchar(45)") + .HasColumnName("process"); + + b.Property("ProcessNm") + .HasColumnType("float") + .HasColumnName("process_nm"); + + b.Property("SimdRegisters") + .HasColumnType("int(11)") + .HasColumnName("SIMD_registers"); + + b.Property("SimdSize") + .HasColumnType("int(11)") + .HasColumnName("SIMD_size"); + + b.Property("Speed") + .HasColumnType("double") + .HasColumnName("speed"); + + b.Property("ThreadsPerCore") + .HasColumnType("int(11)") + .HasColumnName("threads_per_core"); + + b.Property("Transistors") + .HasColumnType("bigint(20)") + .HasColumnName("transistors"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("AddrBus") + .HasDatabaseName("idx_processors_addr_bus"); + + b.HasIndex("CompanyId") + .HasDatabaseName("idx_processors_company"); + + b.HasIndex("Cores") + .HasDatabaseName("idx_processors_cores"); + + b.HasIndex("DataBus") + .HasDatabaseName("idx_processors_data_bus"); + + b.HasIndex("DieSize") + .HasDatabaseName("idx_processors_die_size"); + + b.HasIndex("FprSize") + .HasDatabaseName("idx_processors_FPR_size"); + + b.HasIndex("Fprs") + .HasDatabaseName("idx_processors_FPRs"); + + b.HasIndex("GprSize") + .HasDatabaseName("idx_processors_GPR_size"); + + b.HasIndex("Gprs") + .HasDatabaseName("idx_processors_GPRs"); + + b.HasIndex("InstructionSetId") + .HasDatabaseName("idx_processors_instruction_set"); + + b.HasIndex("Introduced") + .HasDatabaseName("idx_processors_introduced"); + + b.HasIndex("L1Data") + .HasDatabaseName("idx_processors_L1_data"); + + b.HasIndex("L1Instruction") + .HasDatabaseName("idx_processors_L1_instruction"); + + b.HasIndex("L2") + .HasDatabaseName("idx_processors_L2"); + + b.HasIndex("L3") + .HasDatabaseName("idx_processors_L3"); + + b.HasIndex("ModelCode") + .HasDatabaseName("idx_processors_model_code"); + + b.HasIndex("Name") + .HasDatabaseName("idx_processors_name"); + + b.HasIndex("Package") + .HasDatabaseName("idx_processors_package"); + + b.HasIndex("Process") + .HasDatabaseName("idx_processors_process"); + + b.HasIndex("ProcessNm") + .HasDatabaseName("idx_processors_process_nm"); + + b.HasIndex("SimdRegisters") + .HasDatabaseName("idx_processors_SIMD_registers"); + + b.HasIndex("SimdSize") + .HasDatabaseName("idx_processors_SIMD_size"); + + b.HasIndex("Speed") + .HasDatabaseName("idx_processors_speed"); + + b.HasIndex("ThreadsPerCore") + .HasDatabaseName("idx_processors_threads_per_core"); + + b.HasIndex("Transistors") + .HasDatabaseName("idx_processors_transistors"); + + b.ToTable("processors", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.ProcessorDescription", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Html") + .HasMaxLength(262144) + .HasColumnType("longtext"); + + b.Property("LanguageCode") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("char(3)") + .UseCollation("utf8mb4_general_ci"); + + b.Property("ProcessorId") + .HasColumnType("int(11)"); + + b.Property("Text") + .IsRequired() + .HasMaxLength(262144) + .HasColumnType("longtext"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("LanguageCode"); + + b.HasIndex("Text") + .HasAnnotation("MySql:FullTextIndex", true); + + b.HasIndex("ProcessorId", "LanguageCode") + .IsUnique() + .HasDatabaseName("idx_processor_descriptions_processor_language"); + + b.ToTable("ProcessorDescriptions"); + }); + + modelBuilder.Entity("Marechai.Database.Models.ProcessorPhoto", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Aperture") + .HasColumnType("double"); + + b.Property("Author") + .HasColumnType("varchar(255)"); + + b.Property("CameraManufacturer") + .HasColumnType("varchar(255)"); + + b.Property("CameraModel") + .HasColumnType("varchar(255)"); + + b.Property("ColorSpace") + .HasColumnType("smallint unsigned"); + + b.Property("Comments") + .HasColumnType("varchar(255)"); + + b.Property("Contrast") + .HasColumnType("smallint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("DigitalZoomRatio") + .HasColumnType("double"); + + b.Property("ExifVersion") + .HasColumnType("varchar(255)"); + + b.Property("ExposureMethod") + .HasColumnType("smallint unsigned"); + + b.Property("ExposureProgram") + .HasColumnType("smallint unsigned"); + + b.Property("ExposureTime") + .HasColumnType("double"); + + b.Property("Flash") + .HasColumnType("smallint unsigned"); + + b.Property("Focal") + .HasColumnType("double"); + + b.Property("FocalLength") + .HasColumnType("double"); + + b.Property("FocalLengthEquivalent") + .HasColumnType("double"); + + b.Property("HorizontalResolution") + .HasColumnType("double"); + + b.Property("IsoRating") + .HasColumnType("smallint unsigned"); + + b.Property("Lens") + .HasColumnType("varchar(255)"); + + b.Property("LicenseId") + .HasColumnType("int"); + + b.Property("LightSource") + .HasColumnType("smallint unsigned"); + + b.Property("MeteringMode") + .HasColumnType("smallint unsigned"); + + b.Property("Orientation") + .HasColumnType("smallint unsigned"); + + b.Property("OriginalExtension") + .HasColumnType("longtext"); + + b.Property("ProcessorId") + .HasColumnType("int(11)"); + + b.Property("ResolutionUnit") + .HasColumnType("smallint unsigned"); + + b.Property("Saturation") + .HasColumnType("smallint unsigned"); + + b.Property("SceneCaptureType") + .HasColumnType("smallint unsigned"); + + b.Property("SensingMethod") + .HasColumnType("smallint unsigned"); + + b.Property("Sharpness") + .HasColumnType("smallint unsigned"); + + b.Property("SoftwareUsed") + .HasColumnType("varchar(255)"); + + b.Property("Source") + .HasColumnType("longtext"); + + b.Property("SubjectDistanceRange") + .HasColumnType("smallint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("UploadDate") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.Property("VerticalResolution") + .HasColumnType("double"); + + b.Property("WhiteBalance") + .HasColumnType("smallint unsigned"); + + b.HasKey("Id"); + + b.HasIndex("Aperture"); + + b.HasIndex("Author"); + + b.HasIndex("CameraManufacturer"); + + b.HasIndex("CameraModel"); + + b.HasIndex("ColorSpace"); + + b.HasIndex("Comments"); + + b.HasIndex("Contrast"); + + b.HasIndex("CreationDate"); + + b.HasIndex("DigitalZoomRatio"); + + b.HasIndex("ExifVersion"); + + b.HasIndex("ExposureMethod"); + + b.HasIndex("ExposureProgram"); + + b.HasIndex("ExposureTime"); + + b.HasIndex("Flash"); + + b.HasIndex("Focal"); + + b.HasIndex("FocalLength"); + + b.HasIndex("FocalLengthEquivalent"); + + b.HasIndex("HorizontalResolution"); + + b.HasIndex("IsoRating"); + + b.HasIndex("Lens"); + + b.HasIndex("LicenseId"); + + b.HasIndex("LightSource"); + + b.HasIndex("MeteringMode"); + + b.HasIndex("Orientation"); + + b.HasIndex("ProcessorId"); + + b.HasIndex("ResolutionUnit"); + + b.HasIndex("Saturation"); + + b.HasIndex("SceneCaptureType"); + + b.HasIndex("SensingMethod"); + + b.HasIndex("Sharpness"); + + b.HasIndex("SoftwareUsed"); + + b.HasIndex("SubjectDistanceRange"); + + b.HasIndex("UploadDate"); + + b.HasIndex("UserId"); + + b.HasIndex("VerticalResolution"); + + b.HasIndex("WhiteBalance"); + + b.ToTable("ProcessorPhotos"); + }); + + modelBuilder.Entity("Marechai.Database.Models.ProcessorVideo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("ProcessorId") + .HasColumnType("int(11)"); + + b.Property("Provider") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("Title") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("VideoId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("ProcessorId"); + + b.HasIndex("ProcessorId", "Provider", "VideoId") + .IsUnique(); + + b.ToTable("ProcessorVideos"); + }); + + modelBuilder.Entity("Marechai.Database.Models.ProcessorsByMachine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint(20)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("MachineId") + .HasColumnType("int(11)") + .HasColumnName("machine"); + + b.Property("ProcessorId") + .HasColumnType("int(11)") + .HasColumnName("processor"); + + b.Property("Speed") + .HasColumnType("float") + .HasColumnName("speed"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("MachineId") + .HasDatabaseName("idx_processors_by_machine_machine"); + + b.HasIndex("ProcessorId") + .HasDatabaseName("idx_processors_by_machine_processor"); + + b.HasIndex("Speed") + .HasDatabaseName("idx_processors_by_machine_speed"); + + b.ToTable("processors_by_machine", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.RecommendedGpuBySoftwareRelease", b => + { + b.Property("ReleaseId") + .HasColumnType("bigint unsigned"); + + b.Property("GpuId") + .HasColumnType("int(11)"); + + b.HasKey("ReleaseId", "GpuId"); + + b.HasIndex("GpuId"); + + b.ToTable("RecommendedGpuBySoftwareRelease"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Resolution", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Chars") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue((sbyte)0) + .HasColumnName("chars"); + + b.Property("Colors") + .HasColumnType("bigint(20)") + .HasColumnName("colors"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Grayscale") + .HasColumnType("bit(1)"); + + b.Property("Height") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("height") + .HasDefaultValueSql("'0'"); + + b.Property("Palette") + .HasColumnType("bigint(20)") + .HasColumnName("palette"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("Width") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("width") + .HasDefaultValueSql("'0'"); + + b.HasKey("Id"); + + b.HasIndex("Colors") + .HasDatabaseName("idx_resolutions_colors"); + + b.HasIndex("Height") + .HasDatabaseName("idx_resolutions_height"); + + b.HasIndex("Palette") + .HasDatabaseName("idx_resolutions_palette"); + + b.HasIndex("Width") + .HasDatabaseName("idx_resolutions_width"); + + b.HasIndex("Width", "Height") + .HasDatabaseName("idx_resolutions_resolution"); + + b.HasIndex("Width", "Height", "Colors") + .HasDatabaseName("idx_resolutions_resolution_with_color"); + + b.HasIndex("Width", "Height", "Colors", "Palette") + .HasDatabaseName("idx_resolutions_resolution_with_color_and_palette"); + + b.ToTable("resolutions", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.ResolutionsByGpu", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint(20)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("GpuId") + .HasColumnType("int(11)") + .HasColumnName("gpu"); + + b.Property("ResolutionId") + .HasColumnType("int(11)") + .HasColumnName("resolution"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("GpuId") + .HasDatabaseName("idx_resolutions_by_gpu_gpu"); + + b.HasIndex("ResolutionId") + .HasDatabaseName("idx_resolutions_by_gpu_resolution"); + + b.ToTable("resolutions_by_gpu", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.ResolutionsByScreen", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("ResolutionId") + .HasColumnType("int(11)"); + + b.Property("ScreenId") + .HasColumnType("int"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("ResolutionId"); + + b.HasIndex("ScreenId"); + + b.ToTable("ResolutionsByScreen"); + }); + + modelBuilder.Entity("Marechai.Database.Models.ReviewReport", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Explanation") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.Property("IsResolved") + .HasColumnType("bit(1)"); + + b.Property("Reason") + .HasColumnType("int"); + + b.Property("ReporterId") + .HasColumnType("varchar(255)"); + + b.Property("ResolvedByUserId") + .HasColumnType("varchar(255)"); + + b.Property("ResolvedOn") + .HasColumnType("datetime(6)"); + + b.Property("ReviewId") + .HasColumnType("bigint"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("IsResolved"); + + b.HasIndex("ResolvedByUserId"); + + b.HasIndex("ReviewId"); + + b.HasIndex("ReporterId", "ReviewId") + .IsUnique(); + + b.ToTable("ReviewReports"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Screen", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Diagonal") + .HasColumnType("double"); + + b.Property("EffectiveColors") + .HasColumnType("bigint"); + + b.Property("Height") + .HasColumnType("double"); + + b.Property("NativeResolutionId") + .HasColumnType("int(11)"); + + b.Property("Type") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("Width") + .HasColumnType("double"); + + b.HasKey("Id"); + + b.HasIndex("Diagonal"); + + b.HasIndex("EffectiveColors"); + + b.HasIndex("Height"); + + b.HasIndex("NativeResolutionId"); + + b.HasIndex("Type"); + + b.HasIndex("Width"); + + b.ToTable("Screens"); + }); + + modelBuilder.Entity("Marechai.Database.Models.ScreensByMachine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("MachineId") + .HasColumnType("int(11)"); + + b.Property("ScreenId") + .HasColumnType("int"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("MachineId"); + + b.HasIndex("ScreenId"); + + b.ToTable("ScreensByMachine"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Software", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("BaseSoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("FamilyId") + .HasColumnType("bigint unsigned"); + + b.Property("Kind") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("PredecessorId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("BaseSoftwareId"); + + b.HasIndex("FamilyId"); + + b.HasIndex("Name"); + + b.HasIndex("PredecessorId"); + + b.ToTable("Softwares"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareAttribute", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Category") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Key") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("SoftwareReleaseId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("Value") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.HasKey("Id"); + + b.HasIndex("SoftwareReleaseId", "Category", "Key"); + + b.ToTable("SoftwareAttributes"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareBarcode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Code") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("ReleaseId") + .HasColumnType("bigint unsigned"); + + b.Property("Type") + .HasColumnType("tinyint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("Code") + .IsUnique(); + + b.HasIndex("ReleaseId"); + + b.ToTable("SoftwareBarcodes"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareBySoftwareRelease", b => + { + b.Property("ReleaseId") + .HasColumnType("bigint unsigned"); + + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.HasKey("ReleaseId", "SoftwareId"); + + b.HasIndex("SoftwareId"); + + b.ToTable("SoftwareBySoftwareRelease"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareCompanyRole", b => + { + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("CompanyId") + .HasColumnType("int(11)"); + + b.Property("RoleId") + .HasColumnType("char(3)"); + + b.HasKey("SoftwareId", "CompanyId", "RoleId"); + + b.HasIndex("CompanyId"); + + b.HasIndex("RoleId"); + + b.ToTable("SoftwareCompanyRoles"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareCover", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Caption") + .HasColumnType("longtext"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("OriginalExtension") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("SoftwareReleaseId") + .HasColumnType("bigint unsigned"); + + b.Property("Type") + .HasColumnType("tinyint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("SoftwareReleaseId"); + + b.ToTable("SoftwareCovers"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareCriticReview", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("MagazineId") + .HasColumnType("bigint"); + + b.Property("NormalizedScore") + .HasColumnType("int"); + + b.Property("OriginalScore") + .HasColumnType("float"); + + b.Property("OriginalScoreMaximum") + .HasColumnType("float"); + + b.Property("PlatformId") + .HasColumnType("bigint unsigned"); + + b.Property("ReviewDate") + .HasColumnType("datetime(6)"); + + b.Property("ReviewDatePrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("ReviewText") + .HasColumnType("longtext"); + + b.Property("ReviewUrl") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("MagazineId"); + + b.HasIndex("PlatformId"); + + b.HasIndex("SoftwareId"); + + b.HasIndex("SoftwareId", "MagazineId", "PlatformId") + .IsUnique(); + + b.ToTable("SoftwareCriticReviews"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareDescription", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Html") + .HasMaxLength(262144) + .HasColumnType("longtext"); + + b.Property("LanguageCode") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("char(3)") + .UseCollation("utf8mb4_general_ci"); + + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("Text") + .IsRequired() + .HasMaxLength(262144) + .HasColumnType("longtext"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("LanguageCode"); + + b.HasIndex("Text") + .HasAnnotation("MySql:FullTextIndex", true); + + b.HasIndex("SoftwareId", "LanguageCode") + .IsUnique() + .HasDatabaseName("idx_software_descriptions_software_language"); + + b.ToTable("SoftwareDescriptions"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareFamily", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Introduced") + .HasColumnType("datetime(6)"); + + b.Property("IntroducedPrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("ParentId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("Introduced"); + + b.HasIndex("Name"); + + b.HasIndex("ParentId"); + + b.ToTable("SoftwareFamilies"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareGenre", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Type") + .HasColumnType("tinyint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("Name", "Type") + .IsUnique(); + + b.ToTable("SoftwareGenres"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareOSCompatibility", b => + { + b.Property("SoftwareVersionId") + .HasColumnType("bigint unsigned"); + + b.Property("OSVersionId") + .HasColumnType("bigint unsigned"); + + b.HasKey("SoftwareVersionId", "OSVersionId"); + + b.HasIndex("OSVersionId"); + + b.ToTable("SoftwareOSCompatibility"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwarePlatform", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("SoftwarePlatforms"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwarePlatformsByMachine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint(20)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("MachineId") + .HasColumnType("int(11)") + .HasColumnName("machine"); + + b.Property("SoftwarePlatformId") + .HasColumnType("bigint(20) unsigned") + .HasColumnName("software_platform"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("MachineId") + .HasDatabaseName("idx_software_platforms_by_machine_machine"); + + b.HasIndex("SoftwarePlatformId") + .HasDatabaseName("idx_software_platforms_by_machine_software_platform"); + + b.ToTable("software_platforms_by_machine", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareProductCode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Code") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Issuer") + .HasColumnType("tinyint unsigned"); + + b.Property("ReleaseId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("ReleaseId"); + + b.HasIndex("Issuer", "Code") + .IsUnique(); + + b.ToTable("SoftwareProductCodes"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwarePromoArt", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Caption") + .HasColumnType("longtext"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("GroupId") + .HasColumnType("int"); + + b.Property("OriginalExtension") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("GroupId"); + + b.HasIndex("SoftwareId"); + + b.ToTable("SoftwarePromoArt"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwarePromoArtGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("SoftwarePromoArtGroups"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareRelease", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("IsCompilation") + .HasColumnType("bit(1)"); + + b.Property("PlatformId") + .HasColumnType("bigint unsigned"); + + b.Property("PublisherId") + .HasColumnType("int(11)"); + + b.Property("ReleaseDate") + .HasColumnType("datetime(6)"); + + b.Property("ReleaseDatePrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("SoftwareVersionId") + .HasColumnType("bigint unsigned"); + + b.Property("Title") + .HasColumnType("longtext"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("PlatformId"); + + b.HasIndex("PublisherId"); + + b.HasIndex("SoftwareId"); + + b.HasIndex("SoftwareVersionId", "PlatformId"); + + b.ToTable("SoftwareReleases"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareRequirement", b => + { + b.Property("SoftwareVersionId") + .HasColumnType("bigint unsigned"); + + b.Property("RequiredSoftwareVersionId") + .HasColumnType("bigint unsigned"); + + b.Property("RequirementType") + .HasColumnType("tinyint unsigned"); + + b.HasKey("SoftwareVersionId", "RequiredSoftwareVersionId", "RequirementType"); + + b.HasIndex("RequiredSoftwareVersionId"); + + b.ToTable("SoftwareRequirements"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareRole", b => + { + b.Property("Id") + .HasColumnType("char(3)"); + + b.Property("Enabled") + .ValueGeneratedOnAdd() + .HasColumnType("bit(1)") + .HasDefaultValue(true); + + b.Property("Name") + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("Enabled"); + + b.HasIndex("Name"); + + b.ToTable("SoftwareRoles"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareScreenshot", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Caption") + .HasColumnType("longtext"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("OriginalExtension") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("SoftwarePlatformId") + .HasColumnType("bigint unsigned"); + + b.Property("SoftwareVersionId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("SoftwareId"); + + b.HasIndex("SoftwarePlatformId"); + + b.HasIndex("SoftwareVersionId"); + + b.ToTable("SoftwareScreenshots"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareUserRating", b => + { + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Rating") + .HasColumnType("float"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("UserId", "SoftwareId"); + + b.HasIndex("SoftwareId"); + + b.ToTable("SoftwareUserRatings"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareUserReview", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("IsAnonymous") + .HasColumnType("bit(1)"); + + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("TheBad") + .HasColumnType("text"); + + b.Property("TheGood") + .HasColumnType("text"); + + b.Property("TheUgly") + .HasColumnType("text"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("SoftwareId"); + + b.HasIndex("UserId"); + + b.HasIndex("UserId", "SoftwareId") + .IsUnique(); + + b.ToTable("SoftwareUserReviews"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareUserReviewVote", b => + { + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.Property("ReviewId") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("IsUpvote") + .HasColumnType("bit(1)"); + + b.HasKey("UserId", "ReviewId"); + + b.HasIndex("ReviewId"); + + b.ToTable("SoftwareUserReviewVotes"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Codename") + .HasColumnType("longtext"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("LicenseId") + .HasColumnType("int"); + + b.Property("ParentVersionId") + .HasColumnType("bigint unsigned"); + + b.Property("PublicVersion") + .HasColumnType("longtext"); + + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("VersionString") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("LicenseId"); + + b.HasIndex("ParentVersionId"); + + b.HasIndex("SoftwareId"); + + b.HasIndex("VersionString"); + + b.ToTable("SoftwareVersions"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareVersionBySoftwareRelease", b => + { + b.Property("ReleaseId") + .HasColumnType("bigint unsigned"); + + b.Property("SoftwareVersionId") + .HasColumnType("bigint unsigned"); + + b.HasKey("ReleaseId", "SoftwareVersionId"); + + b.HasIndex("SoftwareVersionId"); + + b.ToTable("SoftwareVersionBySoftwareRelease"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareVideo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Provider") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("SoftwareId") + .HasColumnType("bigint unsigned"); + + b.Property("Title") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("VideoId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("SoftwareId"); + + b.HasIndex("SoftwareId", "Provider", "VideoId") + .IsUnique(); + + b.ToTable("SoftwareVideos"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoundByMachine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint(20)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("MachineId") + .HasColumnType("int(11)") + .HasColumnName("machine"); + + b.Property("SoundSynthId") + .HasColumnType("int(11)") + .HasColumnName("sound_synth"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("MachineId") + .HasDatabaseName("idx_sound_by_machine_machine"); + + b.HasIndex("SoundSynthId") + .HasDatabaseName("idx_sound_by_machine_sound_synth"); + + b.ToTable("sound_by_machine", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoundSynth", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CompanyId") + .HasColumnType("int(11)") + .HasColumnName("company"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Depth") + .HasColumnType("int(11)") + .HasColumnName("depth"); + + b.Property("Frequency") + .HasColumnType("double") + .HasColumnName("frequency"); + + b.Property("Introduced") + .HasColumnType("datetime") + .HasColumnName("introduced"); + + b.Property("IntroducedPrecision") + .HasColumnType("tinyint unsigned"); + + b.Property("ModelCode") + .HasMaxLength(45) + .HasColumnType("varchar(45)") + .HasColumnName("model_code"); + + b.Property("Name") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("char(50)") + .HasColumnName("name") + .HasDefaultValueSql("''"); + + b.Property("SquareWave") + .HasColumnType("int(11)") + .HasColumnName("square_wave"); + + b.Property("Type") + .HasColumnType("int(11)") + .HasColumnName("type"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("Voices") + .HasColumnType("int(11)") + .HasColumnName("voices"); + + b.Property("WhiteNoise") + .HasColumnType("int(11)") + .HasColumnName("white_noise"); + + b.HasKey("Id"); + + b.HasIndex("CompanyId") + .HasDatabaseName("idx_sound_synths_company"); + + b.HasIndex("Depth") + .HasDatabaseName("idx_sound_synths_depth"); + + b.HasIndex("Frequency") + .HasDatabaseName("idx_sound_synths_frequency"); + + b.HasIndex("Introduced") + .HasDatabaseName("idx_sound_synths_introduced"); + + b.HasIndex("ModelCode") + .HasDatabaseName("idx_sound_synths_model_code"); + + b.HasIndex("Name") + .HasDatabaseName("idx_sound_synths_name"); + + b.HasIndex("SquareWave") + .HasDatabaseName("idx_sound_synths_square_wave"); + + b.HasIndex("Type") + .HasDatabaseName("idx_sound_synths_type"); + + b.HasIndex("Voices") + .HasDatabaseName("idx_sound_synths_voices"); + + b.HasIndex("WhiteNoise") + .HasDatabaseName("idx_sound_synths_white_noise"); + + b.ToTable("sound_synths", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoundSynthBySoftwareRelease", b => + { + b.Property("ReleaseId") + .HasColumnType("bigint unsigned"); + + b.Property("SoundSynthId") + .HasColumnType("int(11)"); + + b.HasKey("ReleaseId", "SoundSynthId"); + + b.HasIndex("SoundSynthId"); + + b.ToTable("SoundSynthBySoftwareRelease"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoundSynthDescription", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Html") + .HasMaxLength(262144) + .HasColumnType("longtext"); + + b.Property("LanguageCode") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("char(3)") + .UseCollation("utf8mb4_general_ci"); + + b.Property("SoundSynthId") + .HasColumnType("int(11)"); + + b.Property("Text") + .IsRequired() + .HasMaxLength(262144) + .HasColumnType("longtext"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("LanguageCode"); + + b.HasIndex("Text") + .HasAnnotation("MySql:FullTextIndex", true); + + b.HasIndex("SoundSynthId", "LanguageCode") + .IsUnique() + .HasDatabaseName("idx_sound_synth_descriptions_sound_synth_language"); + + b.ToTable("SoundSynthDescriptions"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoundSynthPhoto", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Aperture") + .HasColumnType("double"); + + b.Property("Author") + .HasColumnType("varchar(255)"); + + b.Property("CameraManufacturer") + .HasColumnType("varchar(255)"); + + b.Property("CameraModel") + .HasColumnType("varchar(255)"); + + b.Property("ColorSpace") + .HasColumnType("smallint unsigned"); + + b.Property("Comments") + .HasColumnType("varchar(255)"); + + b.Property("Contrast") + .HasColumnType("smallint unsigned"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("DigitalZoomRatio") + .HasColumnType("double"); + + b.Property("ExifVersion") + .HasColumnType("varchar(255)"); + + b.Property("ExposureMethod") + .HasColumnType("smallint unsigned"); + + b.Property("ExposureProgram") + .HasColumnType("smallint unsigned"); + + b.Property("ExposureTime") + .HasColumnType("double"); + + b.Property("Flash") + .HasColumnType("smallint unsigned"); + + b.Property("Focal") + .HasColumnType("double"); + + b.Property("FocalLength") + .HasColumnType("double"); + + b.Property("FocalLengthEquivalent") + .HasColumnType("double"); + + b.Property("HorizontalResolution") + .HasColumnType("double"); + + b.Property("IsoRating") + .HasColumnType("smallint unsigned"); + + b.Property("Lens") + .HasColumnType("varchar(255)"); + + b.Property("LicenseId") + .HasColumnType("int"); + + b.Property("LightSource") + .HasColumnType("smallint unsigned"); + + b.Property("MeteringMode") + .HasColumnType("smallint unsigned"); + + b.Property("Orientation") + .HasColumnType("smallint unsigned"); + + b.Property("OriginalExtension") + .HasColumnType("longtext"); + + b.Property("ResolutionUnit") + .HasColumnType("smallint unsigned"); + + b.Property("Saturation") + .HasColumnType("smallint unsigned"); + + b.Property("SceneCaptureType") + .HasColumnType("smallint unsigned"); + + b.Property("SensingMethod") + .HasColumnType("smallint unsigned"); + + b.Property("Sharpness") + .HasColumnType("smallint unsigned"); + + b.Property("SoftwareUsed") + .HasColumnType("varchar(255)"); + + b.Property("SoundSynthId") + .HasColumnType("int(11)"); + + b.Property("Source") + .HasColumnType("longtext"); + + b.Property("SubjectDistanceRange") + .HasColumnType("smallint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("UploadDate") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.Property("VerticalResolution") + .HasColumnType("double"); + + b.Property("WhiteBalance") + .HasColumnType("smallint unsigned"); + + b.HasKey("Id"); + + b.HasIndex("Aperture"); + + b.HasIndex("Author"); + + b.HasIndex("CameraManufacturer"); + + b.HasIndex("CameraModel"); + + b.HasIndex("ColorSpace"); + + b.HasIndex("Comments"); + + b.HasIndex("Contrast"); + + b.HasIndex("CreationDate"); + + b.HasIndex("DigitalZoomRatio"); + + b.HasIndex("ExifVersion"); + + b.HasIndex("ExposureMethod"); + + b.HasIndex("ExposureProgram"); + + b.HasIndex("ExposureTime"); + + b.HasIndex("Flash"); + + b.HasIndex("Focal"); + + b.HasIndex("FocalLength"); + + b.HasIndex("FocalLengthEquivalent"); + + b.HasIndex("HorizontalResolution"); + + b.HasIndex("IsoRating"); + + b.HasIndex("Lens"); + + b.HasIndex("LicenseId"); + + b.HasIndex("LightSource"); + + b.HasIndex("MeteringMode"); + + b.HasIndex("Orientation"); + + b.HasIndex("ResolutionUnit"); + + b.HasIndex("Saturation"); + + b.HasIndex("SceneCaptureType"); + + b.HasIndex("SensingMethod"); + + b.HasIndex("Sharpness"); + + b.HasIndex("SoftwareUsed"); + + b.HasIndex("SoundSynthId"); + + b.HasIndex("SubjectDistanceRange"); + + b.HasIndex("UploadDate"); + + b.HasIndex("UserId"); + + b.HasIndex("VerticalResolution"); + + b.HasIndex("WhiteBalance"); + + b.ToTable("SoundSynthPhotos"); + }); + + modelBuilder.Entity("Marechai.Database.Models.StandaloneFile", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AccessDate") + .HasColumnType("datetime(6)"); + + b.Property("Attributes") + .HasColumnType("bigint unsigned"); + + b.Property("BackupDate") + .HasColumnType("datetime(6)"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("DeviceNumber") + .HasColumnType("int unsigned"); + + b.Property("GroupId") + .HasColumnType("bigint unsigned"); + + b.Property("Inode") + .HasColumnType("bigint unsigned"); + + b.Property("IsDirectory") + .HasColumnType("bit(1)"); + + b.Property("LastWriteDate") + .HasColumnType("datetime(6)"); + + b.Property("Links") + .HasColumnType("bigint unsigned"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("Path") + .IsRequired() + .HasMaxLength(8192) + .HasColumnType("varchar(8192)"); + + b.Property("PathSeparator") + .IsRequired() + .HasColumnType("varchar(1)"); + + b.Property("PosixMode") + .HasColumnType("smallint unsigned"); + + b.Property("SoftwareReleaseId") + .HasColumnType("bigint unsigned"); + + b.Property("StatusChangeDate") + .HasColumnType("datetime(6)"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.Property("UserId") + .HasColumnType("bigint unsigned"); + + b.HasKey("Id"); + + b.HasIndex("AccessDate"); + + b.HasIndex("BackupDate"); + + b.HasIndex("CreationDate"); + + b.HasIndex("GroupId"); + + b.HasIndex("IsDirectory"); + + b.HasIndex("LastWriteDate"); + + b.HasIndex("Name"); + + b.HasIndex("Path"); + + b.HasIndex("SoftwareReleaseId"); + + b.HasIndex("StatusChangeDate"); + + b.HasIndex("UserId"); + + b.ToTable("StandaloneFiles"); + }); + + modelBuilder.Entity("Marechai.Database.Models.StorageByMachine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint(20)") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Capacity") + .HasColumnType("bigint(20)") + .HasColumnName("capacity"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Interface") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasDefaultValue(0) + .HasColumnName("interface"); + + b.Property("MachineId") + .HasColumnType("int(11)") + .HasColumnName("machine"); + + b.Property("Type") + .ValueGeneratedOnAdd() + .HasColumnType("int(11)") + .HasDefaultValue(0) + .HasColumnName("type"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("Capacity") + .HasDatabaseName("idx_storage_capacity"); + + b.HasIndex("Interface") + .HasDatabaseName("idx_storage_interface"); + + b.HasIndex("MachineId") + .HasDatabaseName("idx_storage_machine"); + + b.HasIndex("Type") + .HasDatabaseName("idx_storage_type"); + + b.ToTable("storage_by_machine", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.UnM49", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("smallint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ParentId") + .HasColumnType("smallint"); + + b.Property("Type") + .HasColumnType("tinyint unsigned"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn")); + + b.HasKey("Id"); + + b.HasIndex("ParentId"); + + b.HasIndex("Type"); + + b.ToTable("UnM49"); + }); + + modelBuilder.Entity("Marechai.Database.Models.UnM49BySoftwareRelease", b => + { + b.Property("SoftwareReleaseId") + .HasColumnType("bigint unsigned"); + + b.Property("UnM49Id") + .HasColumnType("smallint"); + + b.HasKey("SoftwareReleaseId", "UnM49Id"); + + b.HasIndex("UnM49Id"); + + b.ToTable("UnM49BySoftwareRelease"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("longtext"); + + b.Property("ClaimValue") + .HasColumnType("longtext"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("longtext"); + + b.Property("ClaimValue") + .HasColumnType("longtext"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderDisplayName") + .HasColumnType("longtext"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.Property("RoleId") + .HasColumnType("varchar(255)"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.Property("LoginProvider") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens", (string)null); + }); + + modelBuilder.Entity("Marechai.Database.Models.Audit", b => + { + b.HasOne("Marechai.Database.Models.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Book", b => + { + b.HasOne("Marechai.Database.Models.Iso31661Numeric", "Country") + .WithMany("Books") + .HasForeignKey("CountryId"); + + b.HasOne("Marechai.Database.Models.Book", "Previous") + .WithOne("Next") + .HasForeignKey("Marechai.Database.Models.Book", "PreviousId"); + + b.HasOne("Marechai.Database.Models.Book", "Source") + .WithMany("Derivates") + .HasForeignKey("SourceId"); + + b.Navigation("Country"); + + b.Navigation("Previous"); + + b.Navigation("Source"); + }); + + modelBuilder.Entity("Marechai.Database.Models.BookScan", b => + { + b.HasOne("Marechai.Database.Models.Book", "Book") + .WithMany("Scans") + .HasForeignKey("BookId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "User") + .WithMany("BookScans") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("Book"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Marechai.Database.Models.BookSynopsis", b => + { + b.HasOne("Marechai.Database.Models.Book", "Book") + .WithMany("Synopses") + .HasForeignKey("BookId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Iso639", "Language") + .WithMany() + .HasForeignKey("LanguageCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_book_synopses_language"); + + b.Navigation("Book"); + + b.Navigation("Language"); + }); + + modelBuilder.Entity("Marechai.Database.Models.BooksByMachine", b => + { + b.HasOne("Marechai.Database.Models.Book", "Book") + .WithMany("Machines") + .HasForeignKey("BookId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Machine", "Machine") + .WithMany("Books") + .HasForeignKey("MachineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Book"); + + b.Navigation("Machine"); + }); + + modelBuilder.Entity("Marechai.Database.Models.BooksByMachineFamily", b => + { + b.HasOne("Marechai.Database.Models.Book", "Book") + .WithMany("MachineFamilies") + .HasForeignKey("BookId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.MachineFamily", "MachineFamily") + .WithMany("Books") + .HasForeignKey("MachineFamilyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Book"); + + b.Navigation("MachineFamily"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CollectedBook", b => + { + b.HasOne("Marechai.Database.Models.Book", "Book") + .WithMany("CollectedBy") + .HasForeignKey("BookId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "User") + .WithMany("CollectedBooks") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Book"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CollectedDocument", b => + { + b.HasOne("Marechai.Database.Models.Document", "Document") + .WithMany("CollectedBy") + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "User") + .WithMany("CollectedDocuments") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Document"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CollectedSoftwareRelease", b => + { + b.HasOne("Marechai.Database.Models.SoftwareRelease", "SoftwareRelease") + .WithMany("CollectedBy") + .HasForeignKey("SoftwareReleaseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "User") + .WithMany("CollectedSoftwareReleases") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("SoftwareRelease"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CompaniesByBook", b => + { + b.HasOne("Marechai.Database.Models.Book", "Book") + .WithMany("Companies") + .HasForeignKey("BookId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Company", "Company") + .WithMany("Books") + .HasForeignKey("CompanyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.DocumentRole", "Role") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Book"); + + b.Navigation("Company"); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CompaniesByDocument", b => + { + b.HasOne("Marechai.Database.Models.Company", "Company") + .WithMany("Documents") + .HasForeignKey("CompanyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Document", "Document") + .WithMany("Companies") + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.DocumentRole", "Role") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Company"); + + b.Navigation("Document"); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CompaniesByMagazine", b => + { + b.HasOne("Marechai.Database.Models.Company", "Company") + .WithMany("Magazines") + .HasForeignKey("CompanyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Magazine", "Magazine") + .WithMany("Companies") + .HasForeignKey("MagazineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.DocumentRole", "Role") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Company"); + + b.Navigation("Magazine"); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Company", b => + { + b.HasOne("Marechai.Database.Models.Iso31661Numeric", "Country") + .WithMany("Companies") + .HasForeignKey("CountryId") + .HasConstraintName("fk_companies_country"); + + b.HasOne("Marechai.Database.Models.Company", "SoldTo") + .WithMany("InverseSoldToNavigation") + .HasForeignKey("SoldToId") + .HasConstraintName("fk_companies_sold_to"); + + b.Navigation("Country"); + + b.Navigation("SoldTo"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CompanyBySoftwareFamily", b => + { + b.HasOne("Marechai.Database.Models.Company", "Company") + .WithMany("SoftwareFamilies2") + .HasForeignKey("CompanyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareRole", "Role") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareFamily", "SoftwareFamily") + .WithMany("Companies") + .HasForeignKey("SoftwareFamilyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Company"); + + b.Navigation("Role"); + + b.Navigation("SoftwareFamily"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CompanyBySoftwareVersion", b => + { + b.HasOne("Marechai.Database.Models.Company", "Company") + .WithMany("SoftwareVersions") + .HasForeignKey("CompanyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareRole", "Role") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareVersion", "SoftwareVersion") + .WithMany("Companies") + .HasForeignKey("SoftwareVersionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Company"); + + b.Navigation("Role"); + + b.Navigation("SoftwareVersion"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CompanyDescription", b => + { + b.HasOne("Marechai.Database.Models.Company", "Company") + .WithMany("Descriptions") + .HasForeignKey("CompanyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Iso639", "Language") + .WithMany() + .HasForeignKey("LanguageCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_company_descriptions_language"); + + b.Navigation("Company"); + + b.Navigation("Language"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CompanyLogo", b => + { + b.HasOne("Marechai.Database.Models.Company", "Company") + .WithMany("Logos") + .HasForeignKey("CompanyId") + .IsRequired() + .HasConstraintName("fk_company_logos_company1"); + + b.Navigation("Company"); + }); + + modelBuilder.Entity("Marechai.Database.Models.ConversationParticipant", b => + { + b.HasOne("Marechai.Database.Models.Conversation", "Conversation") + .WithMany("Participants") + .HasForeignKey("ConversationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Conversation"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CurrencyInflation", b => + { + b.HasOne("Marechai.Database.Models.Iso4217", "Currency") + .WithMany() + .HasForeignKey("CurrencyCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Currency"); + }); + + modelBuilder.Entity("Marechai.Database.Models.CurrencyPegging", b => + { + b.HasOne("Marechai.Database.Models.Iso4217", "Destination") + .WithMany() + .HasForeignKey("DestinationCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Iso4217", "Source") + .WithMany() + .HasForeignKey("SourceCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Destination"); + + b.Navigation("Source"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Document", b => + { + b.HasOne("Marechai.Database.Models.Iso31661Numeric", "Country") + .WithMany("Documents") + .HasForeignKey("CountryId"); + + b.Navigation("Country"); + }); + + modelBuilder.Entity("Marechai.Database.Models.DocumentScan", b => + { + b.HasOne("Marechai.Database.Models.Document", "Document") + .WithMany("Scans") + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "User") + .WithMany("DocumentScans") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("Document"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Marechai.Database.Models.DocumentSynopsis", b => + { + b.HasOne("Marechai.Database.Models.Document", "Document") + .WithMany("Synopses") + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Iso639", "Language") + .WithMany() + .HasForeignKey("LanguageCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_document_synopses_language"); + + b.Navigation("Document"); + + b.Navigation("Language"); + }); + + modelBuilder.Entity("Marechai.Database.Models.DocumentsByMachine", b => + { + b.HasOne("Marechai.Database.Models.Document", "Document") + .WithMany("Machines") + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Machine", "Machine") + .WithMany("Documents") + .HasForeignKey("MachineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Document"); + + b.Navigation("Machine"); + }); + + modelBuilder.Entity("Marechai.Database.Models.DocumentsByMachineFamily", b => + { + b.HasOne("Marechai.Database.Models.Document", "Document") + .WithMany("MachineFamilies") + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.MachineFamily", "MachineFamily") + .WithMany("Documents") + .HasForeignKey("MachineFamilyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Document"); + + b.Navigation("MachineFamily"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Dump", b => + { + b.HasOne("Marechai.Database.Models.MediaDump", "MediaDump") + .WithMany("Dumps") + .HasForeignKey("MediaDumpId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Media", "Media") + .WithMany("Dumps") + .HasForeignKey("MediaId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "User") + .WithMany("Dumps") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("Media"); + + b.Navigation("MediaDump"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Marechai.Database.Models.DumpHardware", b => + { + b.HasOne("Marechai.Database.Models.Dump", "Dump") + .WithMany("DumpHardware") + .HasForeignKey("DumpId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Dump"); + }); + + modelBuilder.Entity("Marechai.Database.Models.FileDataStream", b => + { + b.HasOne("Marechai.Database.Models.DbFile", "File") + .WithMany() + .HasForeignKey("FileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("File"); + }); + + modelBuilder.Entity("Marechai.Database.Models.FileDataStreamsByMediaFile", b => + { + b.HasOne("Marechai.Database.Models.FileDataStream", "FileDataStream") + .WithMany() + .HasForeignKey("FileDataStreamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.MediaFile", "MediaFile") + .WithMany("DataStreams") + .HasForeignKey("MediaFileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("FileDataStream"); + + b.Navigation("MediaFile"); + }); + + modelBuilder.Entity("Marechai.Database.Models.FileDataStreamsByStandaloneFile", b => + { + b.HasOne("Marechai.Database.Models.FileDataStream", "FileDataStream") + .WithMany() + .HasForeignKey("FileDataStreamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.StandaloneFile", "StandaloneFile") + .WithMany("DataStreams") + .HasForeignKey("StandaloneFileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("FileDataStream"); + + b.Navigation("StandaloneFile"); + }); + + modelBuilder.Entity("Marechai.Database.Models.FilesByFilesystem", b => + { + b.HasOne("Marechai.Database.Models.MediaFile", "File") + .WithMany() + .HasForeignKey("FileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Filesystem", "Filesystem") + .WithMany("Files") + .HasForeignKey("FilesystemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("File"); + + b.Navigation("Filesystem"); + }); + + modelBuilder.Entity("Marechai.Database.Models.FilesystemsByLogicalPartition", b => + { + b.HasOne("Marechai.Database.Models.Filesystem", "Filesystem") + .WithMany("Partitions") + .HasForeignKey("FilesystemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.LogicalPartition", "Partition") + .WithMany("Filesystems") + .HasForeignKey("PartitionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Filesystem"); + + b.Navigation("Partition"); + }); + + modelBuilder.Entity("Marechai.Database.Models.FilesystemsByMediaDumpFile", b => + { + b.HasOne("Marechai.Database.Models.Filesystem", "Filesystem") + .WithMany("MediaDumpFileImages") + .HasForeignKey("FilesystemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.MediaDumpFileImage", "MediaDumpFileImage") + .WithMany("Filesystems") + .HasForeignKey("MediaDumpFileImageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Filesystem"); + + b.Navigation("MediaDumpFileImage"); + }); + + modelBuilder.Entity("Marechai.Database.Models.GenreBySoftware", b => + { + b.HasOne("Marechai.Database.Models.SoftwareGenre", "Genre") + .WithMany("Softwares") + .HasForeignKey("GenreId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Software", "Software") + .WithMany("Genres") + .HasForeignKey("SoftwareId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Genre"); + + b.Navigation("Software"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Gpu", b => + { + b.HasOne("Marechai.Database.Models.Company", "Company") + .WithMany("Gpus") + .HasForeignKey("CompanyId") + .HasConstraintName("fk_gpus_company"); + + b.Navigation("Company"); + }); + + modelBuilder.Entity("Marechai.Database.Models.GpuDescription", b => + { + b.HasOne("Marechai.Database.Models.Gpu", "Gpu") + .WithMany("Descriptions") + .HasForeignKey("GpuId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Iso639", "Language") + .WithMany() + .HasForeignKey("LanguageCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_gpu_descriptions_language"); + + b.Navigation("Gpu"); + + b.Navigation("Language"); + }); + + modelBuilder.Entity("Marechai.Database.Models.GpuPhoto", b => + { + b.HasOne("Marechai.Database.Models.Gpu", "Gpu") + .WithMany("Photos") + .HasForeignKey("GpuId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.License", "License") + .WithMany() + .HasForeignKey("LicenseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("Gpu"); + + b.Navigation("License"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Marechai.Database.Models.GpuVideo", b => + { + b.HasOne("Marechai.Database.Models.Gpu", "Gpu") + .WithMany("Videos") + .HasForeignKey("GpuId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Gpu"); + }); + + modelBuilder.Entity("Marechai.Database.Models.GpusByMachine", b => + { + b.HasOne("Marechai.Database.Models.Gpu", "Gpu") + .WithMany("GpusByMachine") + .HasForeignKey("GpuId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_gpus_by_machine_gpu"); + + b.HasOne("Marechai.Database.Models.Machine", "Machine") + .WithMany("Gpus") + .HasForeignKey("MachineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_gpus_by_machine_machine"); + + b.Navigation("Gpu"); + + b.Navigation("Machine"); + }); + + modelBuilder.Entity("Marechai.Database.Models.InstructionSetExtensionsByProcessor", b => + { + b.HasOne("Marechai.Database.Models.InstructionSetExtension", "Extension") + .WithMany("InstructionSetExtensionsByProcessor") + .HasForeignKey("ExtensionId") + .IsRequired() + .HasConstraintName("fk_extension_extension_id"); + + b.HasOne("Marechai.Database.Models.Processor", "Processor") + .WithMany("InstructionSetExtensions") + .HasForeignKey("ProcessorId") + .IsRequired() + .HasConstraintName("fk_extension_processor_id"); + + b.Navigation("Extension"); + + b.Navigation("Processor"); + }); + + modelBuilder.Entity("Marechai.Database.Models.LanguageBySoftwareRelease", b => + { + b.HasOne("Marechai.Database.Models.Iso639", "Language") + .WithMany() + .HasForeignKey("LanguageCode") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareRelease", "SoftwareRelease") + .WithMany("Languages") + .HasForeignKey("SoftwareReleaseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Language"); + + b.Navigation("SoftwareRelease"); + }); + + modelBuilder.Entity("Marechai.Database.Models.LogicalPartitionsByMedia", b => + { + b.HasOne("Marechai.Database.Models.Media", "Media") + .WithMany("LogicalPartitions") + .HasForeignKey("MediaId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.LogicalPartition", "Partition") + .WithMany("Media") + .HasForeignKey("PartitionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Media"); + + b.Navigation("Partition"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Machine", b => + { + b.HasOne("Marechai.Database.Models.Company", "Company") + .WithMany("Machines") + .HasForeignKey("CompanyId") + .IsRequired() + .HasConstraintName("fk_machines_company"); + + b.HasOne("Marechai.Database.Models.MachineFamily", "Family") + .WithMany("Machines") + .HasForeignKey("FamilyId") + .HasConstraintName("fk_machines_family"); + + b.Navigation("Company"); + + b.Navigation("Family"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MachineDescription", b => + { + b.HasOne("Marechai.Database.Models.Iso639", "Language") + .WithMany() + .HasForeignKey("LanguageCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_machine_descriptions_language"); + + b.HasOne("Marechai.Database.Models.Machine", "Machine") + .WithMany("Descriptions") + .HasForeignKey("MachineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Language"); + + b.Navigation("Machine"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MachineFamily", b => + { + b.HasOne("Marechai.Database.Models.Company", "Company") + .WithMany("MachineFamilies") + .HasForeignKey("CompanyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_machine_families_company"); + + b.Navigation("Company"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MachinePhoto", b => + { + b.HasOne("Marechai.Database.Models.License", "License") + .WithMany("Photos") + .HasForeignKey("LicenseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Machine", "Machine") + .WithMany("Photos") + .HasForeignKey("MachineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "User") + .WithMany("Photos") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("License"); + + b.Navigation("Machine"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MachineVideo", b => + { + b.HasOne("Marechai.Database.Models.Machine", "Machine") + .WithMany("Videos") + .HasForeignKey("MachineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Machine"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Magazine", b => + { + b.HasOne("Marechai.Database.Models.Iso31661Numeric", "Country") + .WithMany("Magazines") + .HasForeignKey("CountryId"); + + b.Navigation("Country"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MagazineIssue", b => + { + b.HasOne("Marechai.Database.Models.Magazine", "Magazine") + .WithMany("Issues") + .HasForeignKey("MagazineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Magazine"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MagazineScan", b => + { + b.HasOne("Marechai.Database.Models.MagazineIssue", "Magazine") + .WithMany("Scans") + .HasForeignKey("MagazineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "User") + .WithMany("MagazineScans") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("Magazine"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MagazineSynopsis", b => + { + b.HasOne("Marechai.Database.Models.Iso639", "Language") + .WithMany() + .HasForeignKey("LanguageCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_magazine_synopses_language"); + + b.HasOne("Marechai.Database.Models.Magazine", "Magazine") + .WithMany("Synopses") + .HasForeignKey("MagazineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Language"); + + b.Navigation("Magazine"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MagazinesByMachine", b => + { + b.HasOne("Marechai.Database.Models.Machine", "Machine") + .WithMany("Magazines") + .HasForeignKey("MachineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.MagazineIssue", "Magazine") + .WithMany("Machines") + .HasForeignKey("MagazineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Machine"); + + b.Navigation("Magazine"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MagazinesByMachineFamily", b => + { + b.HasOne("Marechai.Database.Models.MachineFamily", "MachineFamily") + .WithMany("Magazines") + .HasForeignKey("MachineFamilyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.MagazineIssue", "Magazine") + .WithMany("MachineFamilies") + .HasForeignKey("MagazineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MachineFamily"); + + b.Navigation("Magazine"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MasteringText", b => + { + b.HasOne("Marechai.Database.Models.Media", "Media") + .WithMany("MasteringTexts") + .HasForeignKey("MediaId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Media"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Media", b => + { + b.HasOne("Marechai.Database.Models.MagazineIssue", "MagazineIssue") + .WithMany("Coverdiscs") + .HasForeignKey("MagazineIssueId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("MagazineIssue"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaDump", b => + { + b.HasOne("Marechai.Database.Models.Media", "Media") + .WithMany("MediaDumps") + .HasForeignKey("MediaId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Media"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaDumpFileImage", b => + { + b.HasOne("Marechai.Database.Models.MediaDump", "MediaDump") + .WithMany("Files") + .HasForeignKey("MediaDumpId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MediaDump"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaDumpImage", b => + { + b.HasOne("Marechai.Database.Models.MediaDump", "MediaDump") + .WithOne("Image") + .HasForeignKey("Marechai.Database.Models.MediaDumpImage", "MediaDumpId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MediaDump"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaDumpSubchannelImage", b => + { + b.HasOne("Marechai.Database.Models.MediaDump", "MediaDump") + .WithOne("Subchannel") + .HasForeignKey("Marechai.Database.Models.MediaDumpSubchannelImage", "MediaDumpId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("Marechai.Database.Models.MediaDumpTrackImage", "Track") + .WithOne("Subchannel") + .HasForeignKey("Marechai.Database.Models.MediaDumpSubchannelImage", "TrackId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("MediaDump"); + + b.Navigation("Track"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaDumpTrackImage", b => + { + b.HasOne("Marechai.Database.Models.MediaDump", "MediaDump") + .WithMany("Tracks") + .HasForeignKey("MediaDumpId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("MediaDump"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaTagDump", b => + { + b.HasOne("Marechai.Database.Models.DbFile", "File") + .WithMany() + .HasForeignKey("FileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.MediaDump", "MediaDump") + .WithMany("Tags") + .HasForeignKey("MediaDumpId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("File"); + + b.Navigation("MediaDump"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MemoryByMachine", b => + { + b.HasOne("Marechai.Database.Models.Machine", "Machine") + .WithMany("Memory") + .HasForeignKey("MachineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_memory_by_machine_machine"); + + b.Navigation("Machine"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Message", b => + { + b.HasOne("Marechai.Database.Models.Conversation", "Conversation") + .WithMany("Messages") + .HasForeignKey("ConversationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Message", "ParentMessage") + .WithMany() + .HasForeignKey("ParentMessageId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "Sender") + .WithMany() + .HasForeignKey("SenderId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("Conversation"); + + b.Navigation("ParentMessage"); + + b.Navigation("Sender"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MessageReport", b => + { + b.HasOne("Marechai.Database.Models.Message", "Message") + .WithMany() + .HasForeignKey("MessageId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "Reporter") + .WithMany() + .HasForeignKey("ReporterId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "ResolvedBy") + .WithMany() + .HasForeignKey("ResolvedByUserId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("Message"); + + b.Navigation("Reporter"); + + b.Navigation("ResolvedBy"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MessageState", b => + { + b.HasOne("Marechai.Database.Models.Message", "Message") + .WithMany("States") + .HasForeignKey("MessageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Message"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MinimumGpuBySoftwareRelease", b => + { + b.HasOne("Marechai.Database.Models.Gpu", "Gpu") + .WithMany("MinimumForSoftwareReleases") + .HasForeignKey("GpuId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareRelease", "Release") + .WithMany("MinimumGpus") + .HasForeignKey("ReleaseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Gpu"); + + b.Navigation("Release"); + }); + + modelBuilder.Entity("Marechai.Database.Models.OwnedMachine", b => + { + b.HasOne("Marechai.Database.Models.Machine", "Machine") + .WithMany() + .HasForeignKey("MachineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "User") + .WithMany("OwnedMachines") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("Machine"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Marechai.Database.Models.PeopleByBook", b => + { + b.HasOne("Marechai.Database.Models.Book", "Book") + .WithMany("People") + .HasForeignKey("BookId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Person", "Person") + .WithMany("Books") + .HasForeignKey("PersonId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.DocumentRole", "Role") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Book"); + + b.Navigation("Person"); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("Marechai.Database.Models.PeopleByCompany", b => + { + b.HasOne("Marechai.Database.Models.Company", "Company") + .WithMany("People") + .HasForeignKey("CompanyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Person", "Person") + .WithMany("Companies") + .HasForeignKey("PersonId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Company"); + + b.Navigation("Person"); + }); + + modelBuilder.Entity("Marechai.Database.Models.PeopleByDocument", b => + { + b.HasOne("Marechai.Database.Models.Document", "Document") + .WithMany("People") + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Person", "Person") + .WithMany("Documents") + .HasForeignKey("PersonId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.DocumentRole", "Role") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Document"); + + b.Navigation("Person"); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("Marechai.Database.Models.PeopleByMagazine", b => + { + b.HasOne("Marechai.Database.Models.MagazineIssue", "Magazine") + .WithMany("People") + .HasForeignKey("MagazineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Person", "Person") + .WithMany("Magazines") + .HasForeignKey("PersonId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.DocumentRole", "Role") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Magazine"); + + b.Navigation("Person"); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("Marechai.Database.Models.PeopleBySoftware", b => + { + b.HasOne("Marechai.Database.Models.Person", "Person") + .WithMany() + .HasForeignKey("PersonId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.DocumentRole", "DocumentRole") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Marechai.Database.Models.Software", "Software") + .WithMany("Credits") + .HasForeignKey("SoftwareId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DocumentRole"); + + b.Navigation("Person"); + + b.Navigation("Software"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Person", b => + { + b.HasOne("Marechai.Database.Models.Iso31661Numeric", "CountryOfBirth") + .WithMany("People") + .HasForeignKey("CountryOfBirthId"); + + b.Navigation("CountryOfBirth"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Processor", b => + { + b.HasOne("Marechai.Database.Models.Company", "Company") + .WithMany("Processors") + .HasForeignKey("CompanyId") + .HasConstraintName("fk_processors_company"); + + b.HasOne("Marechai.Database.Models.InstructionSet", "InstructionSet") + .WithMany("Processors") + .HasForeignKey("InstructionSetId") + .HasConstraintName("fk_processors_instruction_set"); + + b.Navigation("Company"); + + b.Navigation("InstructionSet"); + }); + + modelBuilder.Entity("Marechai.Database.Models.ProcessorDescription", b => + { + b.HasOne("Marechai.Database.Models.Iso639", "Language") + .WithMany() + .HasForeignKey("LanguageCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_processor_descriptions_language"); + + b.HasOne("Marechai.Database.Models.Processor", "Processor") + .WithMany("Descriptions") + .HasForeignKey("ProcessorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Language"); + + b.Navigation("Processor"); + }); + + modelBuilder.Entity("Marechai.Database.Models.ProcessorPhoto", b => + { + b.HasOne("Marechai.Database.Models.License", "License") + .WithMany() + .HasForeignKey("LicenseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Processor", "Processor") + .WithMany("Photos") + .HasForeignKey("ProcessorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("License"); + + b.Navigation("Processor"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Marechai.Database.Models.ProcessorVideo", b => + { + b.HasOne("Marechai.Database.Models.Processor", "Processor") + .WithMany("Videos") + .HasForeignKey("ProcessorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Processor"); + }); + + modelBuilder.Entity("Marechai.Database.Models.ProcessorsByMachine", b => + { + b.HasOne("Marechai.Database.Models.Machine", "Machine") + .WithMany("Processors") + .HasForeignKey("MachineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_processors_by_machine_machine"); + + b.HasOne("Marechai.Database.Models.Processor", "Processor") + .WithMany("ProcessorsByMachine") + .HasForeignKey("ProcessorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_processors_by_machine_processor"); + + b.Navigation("Machine"); + + b.Navigation("Processor"); + }); + + modelBuilder.Entity("Marechai.Database.Models.RecommendedGpuBySoftwareRelease", b => + { + b.HasOne("Marechai.Database.Models.Gpu", "Gpu") + .WithMany("RecommendedForSoftwareReleases") + .HasForeignKey("GpuId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareRelease", "Release") + .WithMany("RecommendedGpus") + .HasForeignKey("ReleaseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Gpu"); + + b.Navigation("Release"); + }); + + modelBuilder.Entity("Marechai.Database.Models.ResolutionsByGpu", b => + { + b.HasOne("Marechai.Database.Models.Gpu", "Gpu") + .WithMany("ResolutionsByGpu") + .HasForeignKey("GpuId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_resolutions_by_gpu_gpu"); + + b.HasOne("Marechai.Database.Models.Resolution", "Resolution") + .WithMany("ResolutionsByGpu") + .HasForeignKey("ResolutionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_resolutions_by_gpu_resolution"); + + b.Navigation("Gpu"); + + b.Navigation("Resolution"); + }); + + modelBuilder.Entity("Marechai.Database.Models.ResolutionsByScreen", b => + { + b.HasOne("Marechai.Database.Models.Resolution", "Resolution") + .WithMany("ResolutionsByScreen") + .HasForeignKey("ResolutionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Screen", "Screen") + .WithMany("Resolutions") + .HasForeignKey("ScreenId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Resolution"); + + b.Navigation("Screen"); + }); + + modelBuilder.Entity("Marechai.Database.Models.ReviewReport", b => + { + b.HasOne("Marechai.Database.Models.ApplicationUser", "Reporter") + .WithMany("ReviewReports") + .HasForeignKey("ReporterId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "ResolvedBy") + .WithMany() + .HasForeignKey("ResolvedByUserId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Marechai.Database.Models.SoftwareUserReview", "Review") + .WithMany("Reports") + .HasForeignKey("ReviewId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Reporter"); + + b.Navigation("ResolvedBy"); + + b.Navigation("Review"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Screen", b => + { + b.HasOne("Marechai.Database.Models.Resolution", "NativeResolution") + .WithMany("Screens") + .HasForeignKey("NativeResolutionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("NativeResolution"); + }); + + modelBuilder.Entity("Marechai.Database.Models.ScreensByMachine", b => + { + b.HasOne("Marechai.Database.Models.Machine", "Machine") + .WithMany("Screens") + .HasForeignKey("MachineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Screen", "Screen") + .WithMany("ScreensByMachines") + .HasForeignKey("ScreenId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Machine"); + + b.Navigation("Screen"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Software", b => + { + b.HasOne("Marechai.Database.Models.Software", "BaseSoftware") + .WithMany("Addons") + .HasForeignKey("BaseSoftwareId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Marechai.Database.Models.SoftwareFamily", "Family") + .WithMany("Softwares") + .HasForeignKey("FamilyId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Marechai.Database.Models.Software", "Predecessor") + .WithMany("Successors") + .HasForeignKey("PredecessorId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("BaseSoftware"); + + b.Navigation("Family"); + + b.Navigation("Predecessor"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareAttribute", b => + { + b.HasOne("Marechai.Database.Models.SoftwareRelease", "SoftwareRelease") + .WithMany("Attributes") + .HasForeignKey("SoftwareReleaseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("SoftwareRelease"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareBarcode", b => + { + b.HasOne("Marechai.Database.Models.SoftwareRelease", "Release") + .WithMany("Barcodes") + .HasForeignKey("ReleaseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Release"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareBySoftwareRelease", b => + { + b.HasOne("Marechai.Database.Models.SoftwareRelease", "Release") + .WithMany("IncludedSoftware") + .HasForeignKey("ReleaseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Software", "Software") + .WithMany("CompilationReleases") + .HasForeignKey("SoftwareId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Release"); + + b.Navigation("Software"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareCompanyRole", b => + { + b.HasOne("Marechai.Database.Models.Company", "Company") + .WithMany("SoftwareRoles") + .HasForeignKey("CompanyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareRole", "Role") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Software", "Software") + .WithMany("CompanyRoles") + .HasForeignKey("SoftwareId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Company"); + + b.Navigation("Role"); + + b.Navigation("Software"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareCover", b => + { + b.HasOne("Marechai.Database.Models.SoftwareRelease", "Release") + .WithMany("Covers") + .HasForeignKey("SoftwareReleaseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Release"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareCriticReview", b => + { + b.HasOne("Marechai.Database.Models.Magazine", "Magazine") + .WithMany() + .HasForeignKey("MagazineId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwarePlatform", "Platform") + .WithMany() + .HasForeignKey("PlatformId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Marechai.Database.Models.Software", "Software") + .WithMany("CriticReviews") + .HasForeignKey("SoftwareId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Magazine"); + + b.Navigation("Platform"); + + b.Navigation("Software"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareDescription", b => + { + b.HasOne("Marechai.Database.Models.Iso639", "Language") + .WithMany() + .HasForeignKey("LanguageCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_software_descriptions_language"); + + b.HasOne("Marechai.Database.Models.Software", "Software") + .WithMany("Descriptions") + .HasForeignKey("SoftwareId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Language"); + + b.Navigation("Software"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareFamily", b => + { + b.HasOne("Marechai.Database.Models.SoftwareFamily", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Parent"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareOSCompatibility", b => + { + b.HasOne("Marechai.Database.Models.SoftwareVersion", "OSVersion") + .WithMany() + .HasForeignKey("OSVersionId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareVersion", "SoftwareVersion") + .WithMany("OSCompatibility") + .HasForeignKey("SoftwareVersionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("OSVersion"); + + b.Navigation("SoftwareVersion"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwarePlatformsByMachine", b => + { + b.HasOne("Marechai.Database.Models.Machine", "Machine") + .WithMany("SoftwarePlatforms") + .HasForeignKey("MachineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_software_platforms_by_machine_machine"); + + b.HasOne("Marechai.Database.Models.SoftwarePlatform", "SoftwarePlatform") + .WithMany("Machines") + .HasForeignKey("SoftwarePlatformId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_software_platforms_by_machine_software_platform"); + + b.Navigation("Machine"); + + b.Navigation("SoftwarePlatform"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareProductCode", b => + { + b.HasOne("Marechai.Database.Models.SoftwareRelease", "Release") + .WithMany("ProductCodes") + .HasForeignKey("ReleaseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Release"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwarePromoArt", b => + { + b.HasOne("Marechai.Database.Models.SoftwarePromoArtGroup", "Group") + .WithMany("PromoArt") + .HasForeignKey("GroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Software", "Software") + .WithMany("PromoArt") + .HasForeignKey("SoftwareId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Group"); + + b.Navigation("Software"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareRelease", b => + { + b.HasOne("Marechai.Database.Models.SoftwarePlatform", "Platform") + .WithMany("SoftwareReleases") + .HasForeignKey("PlatformId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Marechai.Database.Models.Company", "Publisher") + .WithMany("SoftwareReleases") + .HasForeignKey("PublisherId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.Software", "Software") + .WithMany("DirectReleases") + .HasForeignKey("SoftwareId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("Marechai.Database.Models.SoftwareVersion", "SoftwareVersion") + .WithMany("Releases") + .HasForeignKey("SoftwareVersionId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("Platform"); + + b.Navigation("Publisher"); + + b.Navigation("Software"); + + b.Navigation("SoftwareVersion"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareRequirement", b => + { + b.HasOne("Marechai.Database.Models.SoftwareVersion", "RequiredSoftwareVersion") + .WithMany() + .HasForeignKey("RequiredSoftwareVersionId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareVersion", "SoftwareVersion") + .WithMany("Requirements") + .HasForeignKey("SoftwareVersionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("RequiredSoftwareVersion"); + + b.Navigation("SoftwareVersion"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareScreenshot", b => + { + b.HasOne("Marechai.Database.Models.Software", "Software") + .WithMany("Screenshots") + .HasForeignKey("SoftwareId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwarePlatform", "Platform") + .WithMany("Screenshots") + .HasForeignKey("SoftwarePlatformId"); + + b.HasOne("Marechai.Database.Models.SoftwareVersion", "Version") + .WithMany("Screenshots") + .HasForeignKey("SoftwareVersionId"); + + b.Navigation("Platform"); + + b.Navigation("Software"); + + b.Navigation("Version"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareUserRating", b => + { + b.HasOne("Marechai.Database.Models.Software", "Software") + .WithMany("UserRatings") + .HasForeignKey("SoftwareId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "User") + .WithMany("SoftwareRatings") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Software"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareUserReview", b => + { + b.HasOne("Marechai.Database.Models.Software", "Software") + .WithMany("UserReviews") + .HasForeignKey("SoftwareId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "User") + .WithMany("SoftwareReviews") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("Software"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareUserReviewVote", b => + { + b.HasOne("Marechai.Database.Models.SoftwareUserReview", "Review") + .WithMany("Votes") + .HasForeignKey("ReviewId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "User") + .WithMany("ReviewVotes") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Review"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareVersion", b => + { + b.HasOne("Marechai.Database.Models.License", "License") + .WithMany() + .HasForeignKey("LicenseId"); + + b.HasOne("Marechai.Database.Models.SoftwareVersion", "ParentVersion") + .WithMany("Children") + .HasForeignKey("ParentVersionId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("Marechai.Database.Models.Software", "Software") + .WithMany("Versions") + .HasForeignKey("SoftwareId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("License"); + + b.Navigation("ParentVersion"); + + b.Navigation("Software"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareVersionBySoftwareRelease", b => + { + b.HasOne("Marechai.Database.Models.SoftwareRelease", "Release") + .WithMany("IncludedVersions") + .HasForeignKey("ReleaseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoftwareVersion", "SoftwareVersion") + .WithMany("CompilationReleases") + .HasForeignKey("SoftwareVersionId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Release"); + + b.Navigation("SoftwareVersion"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareVideo", b => + { + b.HasOne("Marechai.Database.Models.Software", "Software") + .WithMany("Videos") + .HasForeignKey("SoftwareId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Software"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoundByMachine", b => + { + b.HasOne("Marechai.Database.Models.Machine", "Machine") + .WithMany("Sound") + .HasForeignKey("MachineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_sound_by_machine_machine"); + + b.HasOne("Marechai.Database.Models.SoundSynth", "SoundSynth") + .WithMany("SoundByMachine") + .HasForeignKey("SoundSynthId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_sound_by_machine_sound_synth"); + + b.Navigation("Machine"); + + b.Navigation("SoundSynth"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoundSynth", b => + { + b.HasOne("Marechai.Database.Models.Company", "Company") + .WithMany("SoundSynths") + .HasForeignKey("CompanyId") + .HasConstraintName("fk_sound_synths_company"); + + b.Navigation("Company"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoundSynthBySoftwareRelease", b => + { + b.HasOne("Marechai.Database.Models.SoftwareRelease", "Release") + .WithMany("SupportedSoundSynths") + .HasForeignKey("ReleaseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoundSynth", "SoundSynth") + .WithMany("SupportedBySoftwareReleases") + .HasForeignKey("SoundSynthId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Release"); + + b.Navigation("SoundSynth"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoundSynthDescription", b => + { + b.HasOne("Marechai.Database.Models.Iso639", "Language") + .WithMany() + .HasForeignKey("LanguageCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_sound_synth_descriptions_language"); + + b.HasOne("Marechai.Database.Models.SoundSynth", "SoundSynth") + .WithMany("Descriptions") + .HasForeignKey("SoundSynthId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Language"); + + b.Navigation("SoundSynth"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoundSynthPhoto", b => + { + b.HasOne("Marechai.Database.Models.License", "License") + .WithMany() + .HasForeignKey("LicenseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.SoundSynth", "SoundSynth") + .WithMany("Photos") + .HasForeignKey("SoundSynthId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("License"); + + b.Navigation("SoundSynth"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Marechai.Database.Models.StandaloneFile", b => + { + b.HasOne("Marechai.Database.Models.SoftwareRelease", "SoftwareRelease") + .WithMany() + .HasForeignKey("SoftwareReleaseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("SoftwareRelease"); + }); + + modelBuilder.Entity("Marechai.Database.Models.StorageByMachine", b => + { + b.HasOne("Marechai.Database.Models.Machine", "Machine") + .WithMany("Storage") + .HasForeignKey("MachineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_storage_by_machine_machine"); + + b.Navigation("Machine"); + }); + + modelBuilder.Entity("Marechai.Database.Models.UnM49", b => + { + b.HasOne("Marechai.Database.Models.UnM49", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Parent"); + }); + + modelBuilder.Entity("Marechai.Database.Models.UnM49BySoftwareRelease", b => + { + b.HasOne("Marechai.Database.Models.SoftwareRelease", "SoftwareRelease") + .WithMany("Regions") + .HasForeignKey("SoftwareReleaseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.UnM49", "UnM49") + .WithMany("SoftwareReleases") + .HasForeignKey("UnM49Id") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("SoftwareRelease"); + + b.Navigation("UnM49"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("Marechai.Database.Models.ApplicationRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("Marechai.Database.Models.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("Marechai.Database.Models.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.HasOne("Marechai.Database.Models.ApplicationRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marechai.Database.Models.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("Marechai.Database.Models.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Marechai.Database.Models.ApplicationUser", b => + { + b.Navigation("BookScans"); + + b.Navigation("CollectedBooks"); + + b.Navigation("CollectedDocuments"); + + b.Navigation("CollectedSoftwareReleases"); + + b.Navigation("DocumentScans"); + + b.Navigation("Dumps"); + + b.Navigation("MagazineScans"); + + b.Navigation("OwnedMachines"); + + b.Navigation("Photos"); + + b.Navigation("ReviewReports"); + + b.Navigation("ReviewVotes"); + + b.Navigation("SoftwareRatings"); + + b.Navigation("SoftwareReviews"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Book", b => + { + b.Navigation("CollectedBy"); + + b.Navigation("Companies"); + + b.Navigation("Derivates"); + + b.Navigation("MachineFamilies"); + + b.Navigation("Machines"); + + b.Navigation("Next"); + + b.Navigation("People"); + + b.Navigation("Scans"); + + b.Navigation("Synopses"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Company", b => + { + b.Navigation("Books"); + + b.Navigation("Descriptions"); + + b.Navigation("Documents"); + + b.Navigation("Gpus"); + + b.Navigation("InverseSoldToNavigation"); + + b.Navigation("Logos"); + + b.Navigation("MachineFamilies"); + + b.Navigation("Machines"); + + b.Navigation("Magazines"); + + b.Navigation("People"); + + b.Navigation("Processors"); + + b.Navigation("SoftwareFamilies2"); + + b.Navigation("SoftwareReleases"); + + b.Navigation("SoftwareRoles"); + + b.Navigation("SoftwareVersions"); + + b.Navigation("SoundSynths"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Conversation", b => + { + b.Navigation("Messages"); + + b.Navigation("Participants"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Document", b => + { + b.Navigation("CollectedBy"); + + b.Navigation("Companies"); + + b.Navigation("MachineFamilies"); + + b.Navigation("Machines"); + + b.Navigation("People"); + + b.Navigation("Scans"); + + b.Navigation("Synopses"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Dump", b => + { + b.Navigation("DumpHardware"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Filesystem", b => + { + b.Navigation("Files"); + + b.Navigation("MediaDumpFileImages"); + + b.Navigation("Partitions"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Gpu", b => + { + b.Navigation("Descriptions"); + + b.Navigation("GpusByMachine"); + + b.Navigation("MinimumForSoftwareReleases"); + + b.Navigation("Photos"); + + b.Navigation("RecommendedForSoftwareReleases"); + + b.Navigation("ResolutionsByGpu"); + + b.Navigation("Videos"); + }); + + modelBuilder.Entity("Marechai.Database.Models.InstructionSet", b => + { + b.Navigation("Processors"); + }); + + modelBuilder.Entity("Marechai.Database.Models.InstructionSetExtension", b => + { + b.Navigation("InstructionSetExtensionsByProcessor"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Iso31661Numeric", b => + { + b.Navigation("Books"); + + b.Navigation("Companies"); + + b.Navigation("Documents"); + + b.Navigation("Magazines"); + + b.Navigation("People"); + }); + + modelBuilder.Entity("Marechai.Database.Models.License", b => + { + b.Navigation("Photos"); + }); + + modelBuilder.Entity("Marechai.Database.Models.LogicalPartition", b => + { + b.Navigation("Filesystems"); + + b.Navigation("Media"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Machine", b => + { + b.Navigation("Books"); + + b.Navigation("Descriptions"); + + b.Navigation("Documents"); + + b.Navigation("Gpus"); + + b.Navigation("Magazines"); + + b.Navigation("Memory"); + + b.Navigation("Photos"); + + b.Navigation("Processors"); + + b.Navigation("Screens"); + + b.Navigation("SoftwarePlatforms"); + + b.Navigation("Sound"); + + b.Navigation("Storage"); + + b.Navigation("Videos"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MachineFamily", b => + { + b.Navigation("Books"); + + b.Navigation("Documents"); + + b.Navigation("Machines"); + + b.Navigation("Magazines"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Magazine", b => + { + b.Navigation("Companies"); + + b.Navigation("Issues"); + + b.Navigation("Synopses"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MagazineIssue", b => + { + b.Navigation("Coverdiscs"); + + b.Navigation("MachineFamilies"); + + b.Navigation("Machines"); + + b.Navigation("People"); + + b.Navigation("Scans"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Media", b => + { + b.Navigation("Dumps"); + + b.Navigation("LogicalPartitions"); + + b.Navigation("MasteringTexts"); + + b.Navigation("MediaDumps"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaDump", b => + { + b.Navigation("Dumps"); + + b.Navigation("Files"); + + b.Navigation("Image"); + + b.Navigation("Subchannel"); + + b.Navigation("Tags"); + + b.Navigation("Tracks"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaDumpFileImage", b => + { + b.Navigation("Filesystems"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaDumpTrackImage", b => + { + b.Navigation("Subchannel"); + }); + + modelBuilder.Entity("Marechai.Database.Models.MediaFile", b => + { + b.Navigation("DataStreams"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Message", b => + { + b.Navigation("States"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Person", b => + { + b.Navigation("Books"); + + b.Navigation("Companies"); + + b.Navigation("Documents"); + + b.Navigation("Magazines"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Processor", b => + { + b.Navigation("Descriptions"); + + b.Navigation("InstructionSetExtensions"); + + b.Navigation("Photos"); + + b.Navigation("ProcessorsByMachine"); + + b.Navigation("Videos"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Resolution", b => + { + b.Navigation("ResolutionsByGpu"); + + b.Navigation("ResolutionsByScreen"); + + b.Navigation("Screens"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Screen", b => + { + b.Navigation("Resolutions"); + + b.Navigation("ScreensByMachines"); + }); + + modelBuilder.Entity("Marechai.Database.Models.Software", b => + { + b.Navigation("Addons"); + + b.Navigation("CompanyRoles"); + + b.Navigation("CompilationReleases"); + + b.Navigation("Credits"); + + b.Navigation("CriticReviews"); + + b.Navigation("Descriptions"); + + b.Navigation("DirectReleases"); + + b.Navigation("Genres"); + + b.Navigation("PromoArt"); + + b.Navigation("Screenshots"); + + b.Navigation("Successors"); + + b.Navigation("UserRatings"); + + b.Navigation("UserReviews"); + + b.Navigation("Versions"); + + b.Navigation("Videos"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareFamily", b => + { + b.Navigation("Children"); + + b.Navigation("Companies"); + + b.Navigation("Softwares"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareGenre", b => + { + b.Navigation("Softwares"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwarePlatform", b => + { + b.Navigation("Machines"); + + b.Navigation("Screenshots"); + + b.Navigation("SoftwareReleases"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwarePromoArtGroup", b => + { + b.Navigation("PromoArt"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareRelease", b => + { + b.Navigation("Attributes"); + + b.Navigation("Barcodes"); + + b.Navigation("CollectedBy"); + + b.Navigation("Covers"); + + b.Navigation("IncludedSoftware"); + + b.Navigation("IncludedVersions"); + + b.Navigation("Languages"); + + b.Navigation("MinimumGpus"); + + b.Navigation("ProductCodes"); + + b.Navigation("RecommendedGpus"); + + b.Navigation("Regions"); + + b.Navigation("SupportedSoundSynths"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareUserReview", b => + { + b.Navigation("Reports"); + + b.Navigation("Votes"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoftwareVersion", b => + { + b.Navigation("Children"); + + b.Navigation("Companies"); + + b.Navigation("CompilationReleases"); + + b.Navigation("OSCompatibility"); + + b.Navigation("Releases"); + + b.Navigation("Requirements"); + + b.Navigation("Screenshots"); + }); + + modelBuilder.Entity("Marechai.Database.Models.SoundSynth", b => + { + b.Navigation("Descriptions"); + + b.Navigation("Photos"); + + b.Navigation("SoundByMachine"); + + b.Navigation("SupportedBySoftwareReleases"); + }); + + modelBuilder.Entity("Marechai.Database.Models.StandaloneFile", b => + { + b.Navigation("DataStreams"); + }); + + modelBuilder.Entity("Marechai.Database.Models.UnM49", b => + { + b.Navigation("Children"); + + b.Navigation("SoftwareReleases"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Marechai.Database/Migrations/20260507233219_AddProcessorVideos.cs b/Marechai.Database/Migrations/20260507233219_AddProcessorVideos.cs new file mode 100644 index 00000000..3abec145 --- /dev/null +++ b/Marechai.Database/Migrations/20260507233219_AddProcessorVideos.cs @@ -0,0 +1,64 @@ +using System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Marechai.Database.Migrations +{ + /// + public partial class AddProcessorVideos : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "ProcessorVideos", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + ProcessorId = table.Column(type: "int(11)", nullable: false), + Provider = table.Column(type: "varchar(32)", maxLength: 32, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + VideoId = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Title = table.Column(type: "varchar(512)", maxLength: 512, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + CreatedOn = table.Column(type: "datetime(6)", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + UpdatedOn = table.Column(type: "datetime(6)", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn) + }, + constraints: table => + { + table.PrimaryKey("PK_ProcessorVideos", x => x.Id); + table.ForeignKey( + name: "FK_ProcessorVideos_processors_ProcessorId", + column: x => x.ProcessorId, + principalTable: "processors", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_ProcessorVideos_ProcessorId", + table: "ProcessorVideos", + column: "ProcessorId"); + + migrationBuilder.CreateIndex( + name: "IX_ProcessorVideos_ProcessorId_Provider_VideoId", + table: "ProcessorVideos", + columns: new[] { "ProcessorId", "Provider", "VideoId" }, + unique: true); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "ProcessorVideos"); + } + } +} diff --git a/Marechai.Database/Migrations/MarechaiContextModelSnapshot.cs b/Marechai.Database/Migrations/MarechaiContextModelSnapshot.cs index c1897ff2..83cb2246 100644 --- a/Marechai.Database/Migrations/MarechaiContextModelSnapshot.cs +++ b/Marechai.Database/Migrations/MarechaiContextModelSnapshot.cs @@ -6251,6 +6251,53 @@ namespace Marechai.Database.Migrations 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") @@ -9710,6 +9757,17 @@ namespace Marechai.Database.Migrations 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") @@ -10760,6 +10818,8 @@ namespace Marechai.Database.Migrations b.Navigation("Photos"); b.Navigation("ProcessorsByMachine"); + + b.Navigation("Videos"); }); modelBuilder.Entity("Marechai.Database.Models.Resolution", b => diff --git a/Marechai.Database/Models/MarechaiContext.cs b/Marechai.Database/Models/MarechaiContext.cs index 8a01d925..9fe1258a 100644 --- a/Marechai.Database/Models/MarechaiContext.cs +++ b/Marechai.Database/Models/MarechaiContext.cs @@ -181,6 +181,7 @@ public class MarechaiContext : IdentityDbContext SoftwareVideos { get; set; } public virtual DbSet MachineVideos { get; set; } public virtual DbSet GpuVideos { get; set; } + public virtual DbSet ProcessorVideos { get; set; } public virtual DbSet SoftwareCriticReviews { get; set; } public virtual DbSet MobyGamesReviewImportStates { get; set; } public virtual DbSet SoftwareUserRatings { get; set; } @@ -2909,6 +2910,17 @@ public class MarechaiContext : IdentityDbContext(entity => + { + entity.HasIndex(e => e.ProcessorId); + entity.HasIndex(e => new { e.ProcessorId, e.Provider, e.VideoId }).IsUnique(); + + entity.HasOne(e => e.Processor) + .WithMany(p => p.Videos) + .HasForeignKey(e => e.ProcessorId) + .OnDelete(DeleteBehavior.Cascade); + }); + modelBuilder.Entity(entity => { entity.HasIndex(e => e.VideoUrl); diff --git a/Marechai.Database/Models/Processor.cs b/Marechai.Database/Models/Processor.cs index 53a8debf..3365236b 100644 --- a/Marechai.Database/Models/Processor.cs +++ b/Marechai.Database/Models/Processor.cs @@ -102,4 +102,5 @@ public class Processor : BaseModel public virtual ICollection Descriptions { get; set; } public virtual ICollection Photos { get; set; } public virtual ICollection ProcessorsByMachine { get; set; } + public virtual ICollection Videos { get; set; } } \ No newline at end of file diff --git a/Marechai.Database/Models/ProcessorVideo.cs b/Marechai.Database/Models/ProcessorVideo.cs new file mode 100644 index 00000000..07841347 --- /dev/null +++ b/Marechai.Database/Models/ProcessorVideo.cs @@ -0,0 +1,46 @@ +/****************************************************************************** +// 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; + +namespace Marechai.Database.Models; + +public class ProcessorVideo : BaseModel +{ + [Required] + public int ProcessorId { get; set; } + public virtual Processor Processor { get; set; } + + [Required] + [StringLength(32)] + public string Provider { get; set; } + + [Required] + [StringLength(64)] + public string VideoId { get; set; } + + [StringLength(512)] + public string Title { get; set; } +} diff --git a/Marechai.Server/Controllers/ProcessorVideosController.cs b/Marechai.Server/Controllers/ProcessorVideosController.cs new file mode 100644 index 00000000..051ca306 --- /dev/null +++ b/Marechai.Server/Controllers/ProcessorVideosController.cs @@ -0,0 +1,190 @@ +/******************************************************************************* +// 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.Collections.Generic; +using System.Linq; +using System.Security.Claims; +using System.Threading.Tasks; +using Marechai.Data.Dtos; +using Marechai.Database.Models; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; + +namespace Marechai.Server.Controllers; + +[Route("/processors/videos")] +[ApiController] +public class ProcessorVideosController(MarechaiContext context) : ControllerBase +{ + [HttpGet("/processors/{processorId:int}/videos")] + [AllowAnonymous] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + public Task> GetVideosByProcessorAsync(int processorId) => context.ProcessorVideos + .Where(v => v.ProcessorId == processorId) + .OrderBy(v => v.Title) + .Select(v => new ProcessorVideoDto + { + Id = v.Id, + ProcessorId = v.ProcessorId, + ProcessorName = v.Processor.Name, + Provider = v.Provider, + VideoId = v.VideoId, + Title = v.Title + }) + .ToListAsync(); + + [HttpGet("{id:long}")] + [AllowAnonymous] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status404NotFound)] + public async Task> GetAsync(long id) + { + ProcessorVideoDto dto = await context.ProcessorVideos + .Where(v => v.Id == id) + .Select(v => new ProcessorVideoDto + { + Id = v.Id, + ProcessorId = v.ProcessorId, + ProcessorName = v.Processor.Name, + Provider = v.Provider, + VideoId = v.VideoId, + Title = v.Title + }) + .FirstOrDefaultAsync(); + + if(dto is null) return NotFound(); + + return dto; + } + + [HttpPost("/processors/{processorId:int}/videos")] + [Authorize(Roles = "Admin,UberAdmin")] + [ProducesResponseType(StatusCodes.Status201Created)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status403Forbidden)] + [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(StatusCodes.Status409Conflict)] + public async Task> CreateAsync(int processorId, + [FromBody] CreateProcessorVideoRequest request) + { + string userId = User.FindFirstValue(ClaimTypes.Sid); + + if(userId is null) return Unauthorized(); + + if(string.IsNullOrWhiteSpace(request.Provider) || string.IsNullOrWhiteSpace(request.VideoId)) + return BadRequest("Provider and Video ID are required."); + + string provider = request.Provider.Trim(); + string videoId = request.VideoId.Trim(); + string title = string.IsNullOrWhiteSpace(request.Title) ? null : request.Title.Trim(); + + bool processorExists = await context.Processors.AnyAsync(p => p.Id == processorId); + + if(!processorExists) return NotFound(); + + bool exists = await context.ProcessorVideos.AnyAsync(v => v.ProcessorId == processorId && + v.Provider == provider && + v.VideoId == videoId); + + if(exists) return Conflict("This video is already linked to this processor."); + + var model = new ProcessorVideo + { + ProcessorId = processorId, + Provider = provider, + VideoId = videoId, + Title = title + }; + + context.ProcessorVideos.Add(model); + await context.SaveChangesAsync(); + + string processorName = await context.Processors.Where(p => p.Id == processorId) + .Select(p => p.Name) + .FirstOrDefaultAsync(); + + var dto = new ProcessorVideoDto + { + Id = model.Id, + ProcessorId = processorId, + ProcessorName = processorName, + Provider = provider, + VideoId = videoId, + Title = title + }; + + return CreatedAtAction(nameof(GetAsync), new { id = model.Id }, dto); + } + + [HttpPut("{id:long}")] + [Authorize(Roles = "Admin,UberAdmin")] + [ProducesResponseType(StatusCodes.Status204NoContent)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status403Forbidden)] + [ProducesResponseType(StatusCodes.Status404NotFound)] + public async Task UpdateAsync(long id, [FromBody] UpdateProcessorVideoRequest request) + { + string userId = User.FindFirstValue(ClaimTypes.Sid); + + if(userId is null) return Unauthorized(); + + ProcessorVideo video = await context.ProcessorVideos.FindAsync(id); + + if(video is null) return NotFound(); + + video.Title = string.IsNullOrWhiteSpace(request.Title) ? null : request.Title.Trim(); + + await context.SaveChangesAsync(); + + return NoContent(); + } + + [HttpDelete("{id:long}")] + [Authorize(Roles = "Admin,UberAdmin")] + [ProducesResponseType(StatusCodes.Status204NoContent)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status403Forbidden)] + [ProducesResponseType(StatusCodes.Status404NotFound)] + public async Task DeleteAsync(long id) + { + string userId = User.FindFirstValue(ClaimTypes.Sid); + + if(userId is null) return Unauthorized(); + + ProcessorVideo video = await context.ProcessorVideos.FindAsync(id); + + if(video is null) return NotFound(); + + context.ProcessorVideos.Remove(video); + await context.SaveChangesAsync(); + + return NoContent(); + } +} diff --git a/Marechai/Pages/Admin/ProcessorVideos.razor b/Marechai/Pages/Admin/ProcessorVideos.razor new file mode 100644 index 00000000..e09a9f3d --- /dev/null +++ b/Marechai/Pages/Admin/ProcessorVideos.razor @@ -0,0 +1,164 @@ +@page "/admin/processors/{Id:int}/videos" +@attribute [Authorize(Roles = "Admin, UberAdmin")] +@using Marechai.ApiClient.Models +@using Marechai.Services +@inject ProcessorsService ProcessorsService +@inject IStringLocalizer L +@inject IDialogService DialogService +@inject NavigationManager NavigationManager + +@L["Back to Processors"] + + + + + @L["Video Management"] + + @(_processorName ?? L["Manage processor videos."]) + + +@if(!string.IsNullOrWhiteSpace(_errorMessage)) +{ + @_errorMessage +} + +@if(!string.IsNullOrWhiteSpace(_successMessage)) +{ + @_successMessage +} + +@if(_isLoading) +{ +
+ +
+ return; +} + +@* ── Add Video Section ── *@ + + @L["Link Video"] + + + + @if(!string.IsNullOrWhiteSpace(_detectedVideoId)) + { + + + @L["Detected Video ID"]: + @_detectedVideoId + + } + + + + + + + + + + + + + + @if(_isSaving) + { + + @L["Saving..."] + } + else + { + @L["Link Video"] + } + + + + +@* ── Videos Grid ── *@ + + + @L["Videos"] + @if(_videos is not null) + { + @_videos.Count + } + + + + + @if(_videos is null || _videos.Count == 0) + { + @L["No videos found for this processor."] + } + else + { + + @foreach(ProcessorVideoDto video in _videos) + { + + + + @if(string.Equals(video.Provider, "YouTube", StringComparison.OrdinalIgnoreCase)) + { +
+ +
+ } + else + { + + @video.Provider: @video.VideoId + + } +
+ + + @video.Provider + @video.VideoId + + + + + @L["Delete"] + +
+
+ } +
+ } +
diff --git a/Marechai/Pages/Admin/ProcessorVideos.razor.cs b/Marechai/Pages/Admin/ProcessorVideos.razor.cs new file mode 100644 index 00000000..27c40c5a --- /dev/null +++ b/Marechai/Pages/Admin/ProcessorVideos.razor.cs @@ -0,0 +1,168 @@ +/****************************************************************************** +// 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.Collections.Generic; +using System.Threading.Tasks; +using Marechai.ApiClient.Models; +using Marechai.Helpers; +using Microsoft.AspNetCore.Components; +using MudBlazor; + +namespace Marechai.Pages.Admin; + +public partial class ProcessorVideos +{ + string _detectedVideoId; + string _errorMessage; + bool _isLoading = true; + bool _isSaving; + string _manualVideoId; + string _processorName; + string _provider = "YouTube"; + string _successMessage; + string _title; + string _urlInput; + List _videos; + + [Parameter] public int Id { get; set; } + + bool CanLink => !string.IsNullOrWhiteSpace(EffectiveProvider) && !string.IsNullOrWhiteSpace(EffectiveVideoId); + + string EffectiveProvider => string.IsNullOrWhiteSpace(_manualVideoId) + ? "YouTube" + : (_provider ?? string.Empty).Trim(); + + string EffectiveVideoId => !string.IsNullOrWhiteSpace(_manualVideoId) + ? _manualVideoId.Trim() + : _detectedVideoId; + + protected override async Task OnInitializedAsync() + { + ProcessorDto processor = await ProcessorsService.GetByIdAsync(Id); + _processorName = processor?.Name; + await LoadDataAsync(); + } + + async Task LoadDataAsync() + { + _isLoading = true; + _videos = await ProcessorsService.GetVideosByProcessorAsync(Id); + _isLoading = false; + } + + void OnUrlInputChanged() + { + _detectedVideoId = YouTubeUrlParser.TryExtract(_urlInput, out string id) ? id : null; + } + + async Task LinkVideoAsync() + { + _errorMessage = null; + _successMessage = null; + + if(!CanLink) return; + + _isSaving = true; + + try + { + (ProcessorVideoDto dto, string error) = await ProcessorsService.CreateVideoAsync(Id, + EffectiveProvider, EffectiveVideoId, string.IsNullOrWhiteSpace(_title) ? null : _title.Trim()); + + if(dto is not null) + { + _successMessage = L["Video linked successfully."]; + _urlInput = null; + _detectedVideoId = null; + _manualVideoId = null; + _title = null; + _provider = "YouTube"; + await LoadDataAsync(); + } + else + { + _errorMessage = string.IsNullOrWhiteSpace(error) ? L["Failed to link video."] : error; + } + } + finally + { + _isSaving = false; + } + } + + async Task OnTitleChangedAsync(ProcessorVideoDto video, string newTitle) + { + if(video.Title == newTitle) return; + + (bool succeeded, string error) = + await ProcessorsService.UpdateVideoTitleAsync(video.Id!.Value, newTitle); + + if(succeeded) + { + video.Title = newTitle; + _successMessage = L["Video updated successfully."]; + } + else + { + _errorMessage = string.IsNullOrWhiteSpace(error) ? L["Failed to update video."] : error; + } + } + + async Task ConfirmDeleteAsync(ProcessorVideoDto video) + { + DialogParameters parameters = new() + { + { + x => x.ContentText, + L["Are you sure you want to delete this video? This action cannot be undone."] + } + }; + + IDialogReference dialog = + await DialogService.ShowAsync(L["Delete Video"], parameters, + new DialogOptions + { + MaxWidth = MaxWidth.ExtraSmall, + FullWidth = true + }); + + DialogResult result = await dialog.Result; + + if(result is not { Canceled: false }) return; + + (bool succeeded, string errorMessage) = + await ProcessorsService.DeleteVideoAsync(video.Id ?? 0); + + if(succeeded) + { + _successMessage = L["Video deleted successfully."]; + await LoadDataAsync(); + } + else + { + _errorMessage = string.IsNullOrWhiteSpace(errorMessage) ? L["Failed to delete video."] : errorMessage; + } + } +} diff --git a/Marechai/Pages/Admin/Processors.razor b/Marechai/Pages/Admin/Processors.razor index b49efae6..85613f8b 100644 --- a/Marechai/Pages/Admin/Processors.razor +++ b/Marechai/Pages/Admin/Processors.razor @@ -64,6 +64,7 @@ + diff --git a/Marechai/Pages/Processors/View.razor b/Marechai/Pages/Processors/View.razor index d96bd4e8..bc08e822 100644 --- a/Marechai/Pages/Processors/View.razor +++ b/Marechai/Pages/Processors/View.razor @@ -298,6 +298,47 @@ +@* ── Videos Card ── *@ +@if(_videos is { Count: > 0 }) +{ + + + + + @L["Videos"] + @_videos.Count + + + @foreach(ProcessorVideoDto video in _videos) + { + + + @if(string.Equals(video.Provider, "YouTube", StringComparison.OrdinalIgnoreCase)) + { +
+ +
+ } + @if(!string.IsNullOrWhiteSpace(video.Title)) + { + + @video.Title + + } +
+
+ } +
+
+
+} + @* ── Description Card ── *@ @if(!string.IsNullOrWhiteSpace(_description)) { diff --git a/Marechai/Pages/Processors/View.razor.cs b/Marechai/Pages/Processors/View.razor.cs index 23f8cace..ef813b4a 100644 --- a/Marechai/Pages/Processors/View.razor.cs +++ b/Marechai/Pages/Processors/View.razor.cs @@ -45,6 +45,7 @@ public partial class View PhotoLightbox _lightbox; List _photos = []; ProcessorDto _processor; + List _videos = []; [Parameter] public int Id { get; set; } @@ -87,6 +88,8 @@ public partial class View _photos = await ProcessorPhotosService.GetGuidsByProcessorAsync(Id); + _videos = await Service.GetVideosByProcessorAsync(Id); + _loaded = true; StateHasChanged(); } diff --git a/Marechai/Resources/Services/ProcessorsService.de.resx b/Marechai/Resources/Services/ProcessorsService.de.resx index 5a8080ef..f4abf8b0 100644 --- a/Marechai/Resources/Services/ProcessorsService.de.resx +++ b/Marechai/Resources/Services/ProcessorsService.de.resx @@ -526,4 +526,104 @@ Nur Jahr Year only + + Videos + Videos + + + Videoverwaltung + Video Management + + + Prozessor-Videos verwalten. + Manage processor videos. + + + Zurück zu Prozessoren + Back to Processors + + + Video verknüpfen + Link Video + + + YouTube-URL oder Video-ID + YouTube URL or Video ID + + + Erkannte Video-ID + Detected Video ID + + + Videotitel + Video Title + + + Erweitert + Advanced + + + Anbieter + Provider + + + Anbietername (z. B. YouTube). + Provider name (e.g. YouTube). + + + Video-ID + Video ID + + + Verwenden Sie dies, wenn die obige URL nicht analysiert werden kann (Nicht-YouTube-Anbieter). + Use this when the URL above cannot be parsed (non-YouTube providers). + + + Speichern… + Saving... + + + Für diesen Prozessor wurden keine Videos gefunden. + No videos found for this processor. + + + Titel + Title + + + Löschen + Delete + + + Video erfolgreich verknüpft. + Video linked successfully. + + + Video konnte nicht verknüpft werden. + Failed to link video. + + + Video erfolgreich aktualisiert. + Video updated successfully. + + + Video konnte nicht aktualisiert werden. + Failed to update video. + + + Möchten Sie dieses Video wirklich löschen? Diese Aktion kann nicht rückgängig gemacht werden. + Are you sure you want to delete this video? This action cannot be undone. + + + Video löschen + Delete Video + + + Video erfolgreich gelöscht. + Video deleted successfully. + + + Video konnte nicht gelöscht werden. + Failed to delete video. + diff --git a/Marechai/Resources/Services/ProcessorsService.en.resx b/Marechai/Resources/Services/ProcessorsService.en.resx index a0d34a56..a3c19f64 100644 --- a/Marechai/Resources/Services/ProcessorsService.en.resx +++ b/Marechai/Resources/Services/ProcessorsService.en.resx @@ -655,4 +655,79 @@ Status Column header for import status + + Videos + + + Video Management + + + Manage processor videos. + + + Back to Processors + + + Link Video + + + YouTube URL or Video ID + + + Detected Video ID + + + Video Title + + + Advanced + + + Provider + + + Provider name (e.g. YouTube). + + + Video ID + + + Use this when the URL above cannot be parsed (non-YouTube providers). + + + Saving... + + + No videos found for this processor. + + + Title + + + Delete + + + Video linked successfully. + + + Failed to link video. + + + Video updated successfully. + + + Failed to update video. + + + Are you sure you want to delete this video? This action cannot be undone. + + + Delete Video + + + Video deleted successfully. + + + Failed to delete video. + \ No newline at end of file diff --git a/Marechai/Resources/Services/ProcessorsService.es.resx b/Marechai/Resources/Services/ProcessorsService.es.resx index e5512f61..537ee235 100644 --- a/Marechai/Resources/Services/ProcessorsService.es.resx +++ b/Marechai/Resources/Services/ProcessorsService.es.resx @@ -607,4 +607,104 @@ Estado Column header for import status + + Vídeos + Videos + + + Gestión de vídeos + Video Management + + + Gestionar vídeos del procesador. + Manage processor videos. + + + Volver a procesadores + Back to Processors + + + Vincular vídeo + Link Video + + + URL de YouTube o ID del vídeo + YouTube URL or Video ID + + + ID de vídeo detectado + Detected Video ID + + + Título del vídeo + Video Title + + + Avanzado + Advanced + + + Proveedor + Provider + + + Nombre del proveedor (p. ej., YouTube). + Provider name (e.g. YouTube). + + + ID del vídeo + Video ID + + + Úselo cuando la URL anterior no pueda analizarse (proveedores distintos de YouTube). + Use this when the URL above cannot be parsed (non-YouTube providers). + + + Guardando… + Saving... + + + No se encontraron vídeos para este procesador. + No videos found for this processor. + + + Título + Title + + + Eliminar + Delete + + + Vídeo vinculado correctamente. + Video linked successfully. + + + No se pudo vincular el vídeo. + Failed to link video. + + + Vídeo actualizado correctamente. + Video updated successfully. + + + No se pudo actualizar el vídeo. + Failed to update video. + + + ¿Está seguro de que desea eliminar este vídeo? Esta acción no se puede deshacer. + Are you sure you want to delete this video? This action cannot be undone. + + + Eliminar vídeo + Delete Video + + + Vídeo eliminado correctamente. + Video deleted successfully. + + + No se pudo eliminar el vídeo. + Failed to delete video. + \ No newline at end of file diff --git a/Marechai/Resources/Services/ProcessorsService.fr.resx b/Marechai/Resources/Services/ProcessorsService.fr.resx index 67a6d16d..c4e111d7 100644 --- a/Marechai/Resources/Services/ProcessorsService.fr.resx +++ b/Marechai/Resources/Services/ProcessorsService.fr.resx @@ -526,4 +526,104 @@ Année uniquement Year only + + Vidéos + Videos + + + Gestion des vidéos + Video Management + + + Gérer les vidéos du processeur. + Manage processor videos. + + + Retour aux processeurs + Back to Processors + + + Associer une vidéo + Link Video + + + URL YouTube ou identifiant de la vidéo + YouTube URL or Video ID + + + Identifiant de vidéo détecté + Detected Video ID + + + Titre de la vidéo + Video Title + + + Avancé + Advanced + + + Fournisseur + Provider + + + Nom du fournisseur (par ex. YouTube). + Provider name (e.g. YouTube). + + + Identifiant de la vidéo + Video ID + + + Utilisez ceci lorsque l'URL ci-dessus ne peut pas être analysée (fournisseurs autres que YouTube). + Use this when the URL above cannot be parsed (non-YouTube providers). + + + Enregistrement… + Saving... + + + Aucune vidéo trouvée pour ce processeur. + No videos found for this processor. + + + Titre + Title + + + Supprimer + Delete + + + Vidéo associée avec succès. + Video linked successfully. + + + Échec de l'association de la vidéo. + Failed to link video. + + + Vidéo mise à jour avec succès. + Video updated successfully. + + + Échec de la mise à jour de la vidéo. + Failed to update video. + + + Êtes-vous sûr de vouloir supprimer cette vidéo ? Cette action ne peut pas être annulée. + Are you sure you want to delete this video? This action cannot be undone. + + + Supprimer la vidéo + Delete Video + + + Vidéo supprimée avec succès. + Video deleted successfully. + + + Échec de la suppression de la vidéo. + Failed to delete video. + diff --git a/Marechai/Resources/Services/ProcessorsService.it.resx b/Marechai/Resources/Services/ProcessorsService.it.resx index 01be15b7..9bff0b75 100644 --- a/Marechai/Resources/Services/ProcessorsService.it.resx +++ b/Marechai/Resources/Services/ProcessorsService.it.resx @@ -526,4 +526,104 @@ Solo anno Year only + + Video + Videos + + + Gestione video + Video Management + + + Gestisci i video del processore. + Manage processor videos. + + + Torna ai processori + Back to Processors + + + Collega video + Link Video + + + URL di YouTube o ID del video + YouTube URL or Video ID + + + ID del video rilevato + Detected Video ID + + + Titolo del video + Video Title + + + Avanzate + Advanced + + + Fornitore + Provider + + + Nome del fornitore (es. YouTube). + Provider name (e.g. YouTube). + + + ID del video + Video ID + + + Usalo quando l'URL sopra non può essere analizzato (fornitori diversi da YouTube). + Use this when the URL above cannot be parsed (non-YouTube providers). + + + Salvataggio… + Saving... + + + Nessun video trovato per questo processore. + No videos found for this processor. + + + Titolo + Title + + + Elimina + Delete + + + Video collegato con successo. + Video linked successfully. + + + Impossibile collegare il video. + Failed to link video. + + + Video aggiornato con successo. + Video updated successfully. + + + Impossibile aggiornare il video. + Failed to update video. + + + Sei sicuro di voler eliminare questo video? Questa azione non può essere annullata. + Are you sure you want to delete this video? This action cannot be undone. + + + Elimina video + Delete Video + + + Video eliminato con successo. + Video deleted successfully. + + + Impossibile eliminare il video. + Failed to delete video. + diff --git a/Marechai/Services/ProcessorsService.cs b/Marechai/Services/ProcessorsService.cs index 6e1606bf..9ee0e1e8 100644 --- a/Marechai/Services/ProcessorsService.cs +++ b/Marechai/Services/ProcessorsService.cs @@ -258,4 +258,92 @@ public class ProcessorsService(Marechai.ApiClient.Client client) return (false, ex.Message); } } + + // ── Videos ── + + static string ExtractErrorMessage(ApiException ex) + { + if(ex is ProblemDetails pd) return pd.Detail ?? pd.Title ?? ex.Message; + + return ex.Message; + } + + public async Task> GetVideosByProcessorAsync(int processorId) + { + try + { + var result = await client.Processors[processorId].Videos.GetAsync(); + + return result ?? []; + } + catch + { + return []; + } + } + + public async Task<(ProcessorVideoDto dto, string error)> CreateVideoAsync(int processorId, string provider, + string videoId, + string title) + { + try + { + var dto = await client.Processors[processorId] + .Videos.PostAsync(new CreateProcessorVideoRequest + { + Provider = provider, + VideoId = videoId, + Title = title + }); + + return (dto, null); + } + catch(ApiException ex) + { + return (null, ExtractErrorMessage(ex)); + } + catch(Exception ex) + { + return (null, ex.Message); + } + } + + public async Task<(bool succeeded, string error)> UpdateVideoTitleAsync(long id, string title) + { + try + { + await client.Processors.Videos[id].PutAsync(new UpdateProcessorVideoRequest + { + Title = title + }); + + return (true, null); + } + catch(ApiException ex) + { + return (false, ExtractErrorMessage(ex)); + } + catch(Exception ex) + { + return (false, ex.Message); + } + } + + public async Task<(bool succeeded, string error)> DeleteVideoAsync(long id) + { + try + { + await client.Processors.Videos[id].DeleteAsync(); + + return (true, null); + } + catch(ApiException ex) + { + return (false, ExtractErrorMessage(ex)); + } + catch(Exception ex) + { + return (false, ex.Message); + } + } }