diff --git a/Marechai.ApiClient/Models/AssignCoverGroupToReleaseRequestDto.cs b/Marechai.ApiClient/Models/AssignCoverGroupToReleaseRequestDto.cs
new file mode 100644
index 00000000..ce474cbf
--- /dev/null
+++ b/Marechai.ApiClient/Models/AssignCoverGroupToReleaseRequestDto.cs
@@ -0,0 +1,59 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using System.Collections.Generic;
+using System.IO;
+using System;
+namespace Marechai.ApiClient.Models
+{
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ #pragma warning disable CS1591
+ public partial class AssignCoverGroupToReleaseRequestDto : IAdditionalDataHolder, IParsable
+ #pragma warning restore CS1591
+ {
+ /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
+ public IDictionary AdditionalData { get; set; }
+ /// The release_id property
+ public int? ReleaseId { get; set; }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ public AssignCoverGroupToReleaseRequestDto()
+ {
+ AdditionalData = new Dictionary();
+ }
+ ///
+ /// Creates a new instance of the appropriate class based on discriminator value
+ ///
+ /// A
+ /// The parse node to use to read the discriminator value and create the object
+ public static global::Marechai.ApiClient.Models.AssignCoverGroupToReleaseRequestDto CreateFromDiscriminatorValue(IParseNode parseNode)
+ {
+ if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode));
+ return new global::Marechai.ApiClient.Models.AssignCoverGroupToReleaseRequestDto();
+ }
+ ///
+ /// The deserialization information for the current model
+ ///
+ /// A IDictionary<string, Action<IParseNode>>
+ public virtual IDictionary> GetFieldDeserializers()
+ {
+ return new Dictionary>
+ {
+ { "release_id", n => { ReleaseId = n.GetIntValue(); } },
+ };
+ }
+ ///
+ /// Serializes information the current object
+ ///
+ /// Serialization writer to use to serialize this model
+ public virtual void Serialize(ISerializationWriter writer)
+ {
+ if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
+ writer.WriteIntValue("release_id", ReleaseId);
+ writer.WriteAdditionalData(AdditionalData);
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/Marechai.ApiClient/Models/SoftwareCoverDto.cs b/Marechai.ApiClient/Models/SoftwareCoverDto.cs
index a61a8e27..9ac12c23 100644
--- a/Marechai.ApiClient/Models/SoftwareCoverDto.cs
+++ b/Marechai.ApiClient/Models/SoftwareCoverDto.cs
@@ -29,6 +29,14 @@ namespace Marechai.ApiClient.Models
#nullable restore
#else
public string Caption { get; set; }
+#endif
+ /// The group_id property
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public string? GroupId { get; set; }
+#nullable restore
+#else
+ public string GroupId { get; set; }
#endif
/// The id property
public Guid? Id { get; set; }
@@ -64,6 +72,8 @@ namespace Marechai.ApiClient.Models
#else
public string ReleaseTitle { get; set; }
#endif
+ /// The software_id property
+ public int? SoftwareId { get; set; }
/// The software_release_id property
public int? SoftwareReleaseId { get; set; }
/// The type property
@@ -103,11 +113,13 @@ namespace Marechai.ApiClient.Models
{
{ "canonical_caption", n => { CanonicalCaption = n.GetStringValue(); } },
{ "caption", n => { Caption = n.GetStringValue(); } },
+ { "group_id", n => { GroupId = n.GetStringValue(); } },
{ "id", n => { Id = n.GetGuidValue(); } },
{ "original_extension", n => { OriginalExtension = n.GetStringValue(); } },
{ "platform_name", n => { PlatformName = n.GetStringValue(); } },
{ "region_names", n => { RegionNames = n.GetStringValue(); } },
{ "release_title", n => { ReleaseTitle = n.GetStringValue(); } },
+ { "software_id", n => { SoftwareId = n.GetIntValue(); } },
{ "software_release_id", n => { SoftwareReleaseId = n.GetIntValue(); } },
{ "type", n => { Type = n.GetIntValue(); } },
{ "type_name", n => { TypeName = n.GetStringValue(); } },
@@ -122,11 +134,13 @@ namespace Marechai.ApiClient.Models
if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
writer.WriteStringValue("canonical_caption", CanonicalCaption);
writer.WriteStringValue("caption", Caption);
+ writer.WriteStringValue("group_id", GroupId);
writer.WriteGuidValue("id", Id);
writer.WriteStringValue("original_extension", OriginalExtension);
writer.WriteStringValue("platform_name", PlatformName);
writer.WriteStringValue("region_names", RegionNames);
writer.WriteStringValue("release_title", ReleaseTitle);
+ writer.WriteIntValue("software_id", SoftwareId);
writer.WriteIntValue("software_release_id", SoftwareReleaseId);
writer.WriteIntValue("type", Type);
writer.WriteStringValue("type_name", TypeName);
diff --git a/Marechai.ApiClient/Software/Covers/CoversRequestBuilder.cs b/Marechai.ApiClient/Software/Covers/CoversRequestBuilder.cs
index 88017362..3d37a558 100644
--- a/Marechai.ApiClient/Software/Covers/CoversRequestBuilder.cs
+++ b/Marechai.ApiClient/Software/Covers/CoversRequestBuilder.cs
@@ -1,6 +1,7 @@
//
#pragma warning disable CS0618
using Marechai.ApiClient.Software.Covers.Admin;
+using Marechai.ApiClient.Software.Covers.Groups;
using Marechai.ApiClient.Software.Covers.Item;
using Marechai.ApiClient.Software.Covers.Pending;
using Marechai.ApiClient.Software.Covers.Upload;
@@ -23,6 +24,11 @@ namespace Marechai.ApiClient.Software.Covers
{
get => new global::Marechai.ApiClient.Software.Covers.Admin.AdminRequestBuilder(PathParameters, RequestAdapter);
}
+ /// The groups property
+ public global::Marechai.ApiClient.Software.Covers.Groups.GroupsRequestBuilder Groups
+ {
+ get => new global::Marechai.ApiClient.Software.Covers.Groups.GroupsRequestBuilder(PathParameters, RequestAdapter);
+ }
/// The pending property
public global::Marechai.ApiClient.Software.Covers.Pending.PendingRequestBuilder Pending
{
diff --git a/Marechai.ApiClient/Software/Covers/Groups/GroupsRequestBuilder.cs b/Marechai.ApiClient/Software/Covers/Groups/GroupsRequestBuilder.cs
new file mode 100644
index 00000000..af569a69
--- /dev/null
+++ b/Marechai.ApiClient/Software/Covers/Groups/GroupsRequestBuilder.cs
@@ -0,0 +1,48 @@
+//
+#pragma warning disable CS0618
+using Marechai.ApiClient.Software.Covers.Groups.Item;
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading.Tasks;
+using System;
+namespace Marechai.ApiClient.Software.Covers.Groups
+{
+ ///
+ /// Builds and executes requests for operations under \software\covers\groups
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class GroupsRequestBuilder : BaseRequestBuilder
+ {
+ /// Gets an item from the Marechai.ApiClient.software.covers.groups.item collection
+ /// Unique identifier of the item
+ /// A
+ public global::Marechai.ApiClient.Software.Covers.Groups.Item.WithGroupItemRequestBuilder this[string position]
+ {
+ get
+ {
+ var urlTplParams = new Dictionary(PathParameters);
+ urlTplParams.Add("groupId", position);
+ return new global::Marechai.ApiClient.Software.Covers.Groups.Item.WithGroupItemRequestBuilder(urlTplParams, RequestAdapter);
+ }
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public GroupsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/software/covers/groups", pathParameters)
+ {
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public GroupsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/software/covers/groups", rawUrl)
+ {
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/Marechai.ApiClient/Software/Covers/Groups/Item/AssignRelease/AssignReleaseRequestBuilder.cs b/Marechai.ApiClient/Software/Covers/Groups/Item/AssignRelease/AssignReleaseRequestBuilder.cs
new file mode 100644
index 00000000..69fe5aad
--- /dev/null
+++ b/Marechai.ApiClient/Software/Covers/Groups/Item/AssignRelease/AssignReleaseRequestBuilder.cs
@@ -0,0 +1,100 @@
+//
+#pragma warning disable CS0618
+using Marechai.ApiClient.Models;
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using Microsoft.Kiota.Abstractions;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading.Tasks;
+using System.Threading;
+using System;
+namespace Marechai.ApiClient.Software.Covers.Groups.Item.AssignRelease
+{
+ ///
+ /// Builds and executes requests for operations under \software\covers\groups\{groupId}\assign-release
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class AssignReleaseRequestBuilder : BaseRequestBuilder
+ {
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public AssignReleaseRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/software/covers/groups/{groupId}/assign-release", pathParameters)
+ {
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public AssignReleaseRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/software/covers/groups/{groupId}/assign-release", rawUrl)
+ {
+ }
+ /// A
+ /// The request body
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+ /// When receiving a 400 status code
+ /// When receiving a 401 status code
+ /// When receiving a 404 status code
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task PostAsync(global::Marechai.ApiClient.Models.AssignCoverGroupToReleaseRequestDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#nullable restore
+#else
+ public async Task PostAsync(global::Marechai.ApiClient.Models.AssignCoverGroupToReleaseRequestDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#endif
+ if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
+ var requestInfo = ToPostRequestInformation(body, requestConfiguration);
+ var errorMapping = new Dictionary>
+ {
+ { "400", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue },
+ { "401", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue },
+ { "404", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue },
+ };
+ return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
+ }
+ /// A
+ /// The request body
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToPostRequestInformation(global::Marechai.ApiClient.Models.AssignCoverGroupToReleaseRequestDto body, Action>? requestConfiguration = default)
+ {
+#nullable restore
+#else
+ public RequestInformation ToPostRequestInformation(global::Marechai.ApiClient.Models.AssignCoverGroupToReleaseRequestDto body, Action> requestConfiguration = default)
+ {
+#endif
+ if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
+ var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters);
+ requestInfo.Configure(requestConfiguration);
+ requestInfo.Headers.TryAdd("Accept", "application/json, text/plain;q=0.9");
+ requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body);
+ return requestInfo;
+ }
+ ///
+ /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
+ ///
+ /// A
+ /// The raw URL to use for the request builder.
+ public global::Marechai.ApiClient.Software.Covers.Groups.Item.AssignRelease.AssignReleaseRequestBuilder WithUrl(string rawUrl)
+ {
+ return new global::Marechai.ApiClient.Software.Covers.Groups.Item.AssignRelease.AssignReleaseRequestBuilder(rawUrl, RequestAdapter);
+ }
+ ///
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+ ///
+ [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")]
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class AssignReleaseRequestBuilderPostRequestConfiguration : RequestConfiguration
+ {
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/Marechai.ApiClient/Software/Covers/Groups/Item/WithGroupItemRequestBuilder.cs b/Marechai.ApiClient/Software/Covers/Groups/Item/WithGroupItemRequestBuilder.cs
new file mode 100644
index 00000000..d9273e7e
--- /dev/null
+++ b/Marechai.ApiClient/Software/Covers/Groups/Item/WithGroupItemRequestBuilder.cs
@@ -0,0 +1,41 @@
+//
+#pragma warning disable CS0618
+using Marechai.ApiClient.Software.Covers.Groups.Item.AssignRelease;
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading.Tasks;
+using System;
+namespace Marechai.ApiClient.Software.Covers.Groups.Item
+{
+ ///
+ /// Builds and executes requests for operations under \software\covers\groups\{groupId}
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class WithGroupItemRequestBuilder : BaseRequestBuilder
+ {
+ /// The assignRelease property
+ public global::Marechai.ApiClient.Software.Covers.Groups.Item.AssignRelease.AssignReleaseRequestBuilder AssignRelease
+ {
+ get => new global::Marechai.ApiClient.Software.Covers.Groups.Item.AssignRelease.AssignReleaseRequestBuilder(PathParameters, RequestAdapter);
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public WithGroupItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/software/covers/groups/{groupId}", pathParameters)
+ {
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public WithGroupItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/software/covers/groups/{groupId}", rawUrl)
+ {
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/Marechai.ApiClient/Software/Covers/Upload/UploadPostRequestBody.cs b/Marechai.ApiClient/Software/Covers/Upload/UploadPostRequestBody.cs
index a962f617..bfb4acf5 100644
--- a/Marechai.ApiClient/Software/Covers/Upload/UploadPostRequestBody.cs
+++ b/Marechai.ApiClient/Software/Covers/Upload/UploadPostRequestBody.cs
@@ -29,9 +29,19 @@ namespace Marechai.ApiClient.Software.Covers.Upload
#nullable restore
#else
public byte[] File { get; set; }
+#endif
+ /// The groupId property
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public string? GroupId { get; set; }
+#nullable restore
+#else
+ public string GroupId { get; set; }
#endif
/// The releaseId property
public int? ReleaseId { get; set; }
+ /// The softwareId property
+ public int? SoftwareId { get; set; }
/// The type property
public int? Type { get; set; }
///
@@ -61,7 +71,9 @@ namespace Marechai.ApiClient.Software.Covers.Upload
{
{ "caption", n => { Caption = n.GetStringValue(); } },
{ "file", n => { File = n.GetByteArrayValue(); } },
+ { "groupId", n => { GroupId = n.GetStringValue(); } },
{ "releaseId", n => { ReleaseId = n.GetIntValue(); } },
+ { "softwareId", n => { SoftwareId = n.GetIntValue(); } },
{ "type", n => { Type = n.GetIntValue(); } },
};
}
@@ -74,7 +86,9 @@ namespace Marechai.ApiClient.Software.Covers.Upload
if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
writer.WriteStringValue("caption", Caption);
writer.WriteByteArrayValue("file", File);
+ writer.WriteStringValue("groupId", GroupId);
writer.WriteIntValue("releaseId", ReleaseId);
+ writer.WriteIntValue("softwareId", SoftwareId);
writer.WriteIntValue("type", Type);
writer.WriteAdditionalData(AdditionalData);
}
diff --git a/Marechai.ApiClient/kiota-lock.json b/Marechai.ApiClient/kiota-lock.json
index ed76c69f..08be822e 100644
--- a/Marechai.ApiClient/kiota-lock.json
+++ b/Marechai.ApiClient/kiota-lock.json
@@ -1,6 +1,6 @@
{
- "descriptionHash": "A88EB48B54E94488C4D344ADBB16029566E71C3B603604B7A2F91B8705E8B1E5E8218E2011C3875C7649E176D644CF079C91CFDA713572F6C0B897891334950C",
- "descriptionLocation": "../../../../../tmp/marechai-openapi.json",
+ "descriptionHash": "92F5A73B292800E8C1CFC56D5768B35B2511C183969519E08D7A58F7C587813BE421876AA47EA1D18D8ACC90E55B4F183C440C97CA6045A043E89522030A4DE8",
+ "descriptionLocation": "../openapi.yaml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.31.1",
"clientClassName": "Client",
diff --git a/Marechai.Data/Dtos/AssignCoverGroupToReleaseRequestDto.cs b/Marechai.Data/Dtos/AssignCoverGroupToReleaseRequestDto.cs
new file mode 100644
index 00000000..0ded7061
--- /dev/null
+++ b/Marechai.Data/Dtos/AssignCoverGroupToReleaseRequestDto.cs
@@ -0,0 +1,42 @@
+/******************************************************************************
+// MARECHAI: Master repository of computing history artifacts information
+// ----------------------------------------------------------------------------
+//
+// Author(s) : Natalia Portillo
+//
+// --[ License ] --------------------------------------------------------------
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as
+// published by the Free Software Foundation, either version 3 of the
+// License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// ----------------------------------------------------------------------------
+// Copyright © 2003-2026 Natalia Portillo
+*******************************************************************************/
+
+using System.ComponentModel.DataAnnotations;
+using System.Text.Json.Serialization;
+
+namespace Marechai.Data.Dtos;
+
+///
+/// Request body for
+/// POST /software/covers/groups/{groupId}/assign-release. Assigns every
+/// SoftwareCover sharing the given GroupId to a single
+/// in one action.
+///
+public class AssignCoverGroupToReleaseRequestDto
+{
+ [JsonPropertyName("release_id")]
+ [Required]
+ public ulong ReleaseId { get; set; }
+}
diff --git a/Marechai.Data/Dtos/SoftwareCoverDto.cs b/Marechai.Data/Dtos/SoftwareCoverDto.cs
index be785f21..76988045 100644
--- a/Marechai.Data/Dtos/SoftwareCoverDto.cs
+++ b/Marechai.Data/Dtos/SoftwareCoverDto.cs
@@ -31,9 +31,14 @@ namespace Marechai.Data.Dtos;
public class SoftwareCoverDto : BaseDto
{
+ [JsonPropertyName("software_id")]
+ public ulong? SoftwareId { get; set; }
+
[JsonPropertyName("software_release_id")]
- [Required]
- public ulong SoftwareReleaseId { get; set; }
+ public ulong? SoftwareReleaseId { get; set; }
+
+ [JsonPropertyName("group_id")]
+ public string? GroupId { get; set; }
[JsonPropertyName("release_title")]
public string? ReleaseTitle { get; set; }
diff --git a/Marechai.Database/Interceptors/SearchIndexInterceptor.cs b/Marechai.Database/Interceptors/SearchIndexInterceptor.cs
index 6c0000cf..14488702 100644
--- a/Marechai.Database/Interceptors/SearchIndexInterceptor.cs
+++ b/Marechai.Database/Interceptors/SearchIndexInterceptor.cs
@@ -270,10 +270,7 @@ public sealed class SearchIndexInterceptor : SaveChangesInterceptor
ulong swId = sw.Id;
bool hasImg = ctx.SoftwareScreenshots.Any(s => s.SoftwareId == swId) ||
ctx.SoftwarePromoArt.Any(p => p.SoftwareId == swId) ||
- ctx.SoftwareCovers.Any(c => ctx.SoftwareReleases
- .Where(r => r.SoftwareId == swId)
- .Select(r => r.Id)
- .Contains(c.SoftwareReleaseId));
+ ctx.SoftwareCovers.Any(c => c.SoftwareId == swId);
SearchIndexUpdater.Upsert(ctx, SearchEntityType.Software, (long)sw.Id, sw.Name, null, null, null, null, hasImg,
(byte)sw.Kind);
return true;
diff --git a/Marechai.Database/Migrations/20260622185149_MakeCoverSoftwareLinkPrimary.Designer.cs b/Marechai.Database/Migrations/20260622185149_MakeCoverSoftwareLinkPrimary.Designer.cs
new file mode 100644
index 00000000..71cae141
--- /dev/null
+++ b/Marechai.Database/Migrations/20260622185149_MakeCoverSoftwareLinkPrimary.Designer.cs
@@ -0,0 +1,12537 @@
+//
+using System;
+using Marechai.Database.Models;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace Marechai.Database.Migrations
+{
+ [DbContext(typeof(MarechaiContext))]
+ [Migration("20260622185149_MakeCoverSoftwareLinkPrimary")]
+ partial class MakeCoverSoftwareLinkPrimary
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "9.0.11")
+ .HasAnnotation("Proxies:ChangeTracking", false)
+ .HasAnnotation("Proxies:CheckEquality", false)
+ .HasAnnotation("Proxies:LazyLoading", true)
+ .HasAnnotation("Relational:MaxIdentifierLength", 64);
+
+ MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
+
+ modelBuilder.Entity("Marechai.Database.Models.ApplicationRole", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("varchar(255)");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnType("longtext");
+
+ b.Property("Created")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Description")
+ .HasColumnType("longtext");
+
+ b.Property("Name")
+ .HasMaxLength(256)
+ .HasColumnType("varchar(256)");
+
+ b.Property("NormalizedName")
+ .HasMaxLength(256)
+ .HasColumnType("varchar(256)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("NormalizedName")
+ .IsUnique()
+ .HasDatabaseName("RoleNameIndex");
+
+ b.ToTable("AspNetRoles", (string)null);
+ });
+
+ modelBuilder.Entity("Marechai.Database.Models.ApplicationUser", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("varchar(255)");
+
+ b.Property("AccessFailedCount")
+ .HasColumnType("int");
+
+ b.Property("AvatarGuid")
+ .HasColumnType("char(36)");
+
+ b.Property("Bio")
+ .HasMaxLength(2000)
+ .HasColumnType("varchar(2000)");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnType("longtext");
+
+ b.Property("DeletionRequestedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("DisplayName")
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)");
+
+ b.Property("Email")
+ .HasMaxLength(256)
+ .HasColumnType("varchar(256)");
+
+ b.Property("EmailConfirmed")
+ .HasColumnType("bit(1)");
+
+ b.Property("Facebook")
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)");
+
+ b.Property("GitHub")
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)");
+
+ b.Property("IsSystemAccount")
+ .HasColumnType("bit(1)");
+
+ b.Property("LastLanguageVisited")
+ .HasMaxLength(10)
+ .HasColumnType("varchar(10)");
+
+ b.Property("LinkedIn")
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)");
+
+ b.Property("Location")
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)");
+
+ b.Property("LockoutEnabled")
+ .HasColumnType("bit(1)");
+
+ b.Property("LockoutEnd")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Mastodon")
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)");
+
+ b.Property("NormalizedEmail")
+ .HasMaxLength(256)
+ .HasColumnType("varchar(256)");
+
+ b.Property("NormalizedUserName")
+ .HasMaxLength(256)
+ .HasColumnType("varchar(256)");
+
+ b.Property("NotifyOnNewMessage")
+ .HasColumnType("bit(1)");
+
+ b.Property("OriginalAvatarExtension")
+ .HasMaxLength(10)
+ .HasColumnType("varchar(10)");
+
+ b.Property("PasswordHash")
+ .HasColumnType("longtext");
+
+ b.Property("PhoneNumber")
+ .HasColumnType("longtext");
+
+ b.Property("PhoneNumberConfirmed")
+ .HasColumnType("bit(1)");
+
+ b.Property("PreferredThemeId")
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)");
+
+ b.Property("SecurityStamp")
+ .HasColumnType("longtext");
+
+ b.Property("Twitter")
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)");
+
+ b.Property("TwoFactorEnabled")
+ .HasColumnType("bit(1)");
+
+ b.Property("TwoFactorViaAuthenticator")
+ .HasColumnType("bit(1)");
+
+ b.Property("TwoFactorViaEmail")
+ .HasColumnType("bit(1)");
+
+ b.Property("UseGravatar")
+ .HasColumnType("bit(1)");
+
+ b.Property("UserName")
+ .HasMaxLength(256)
+ .HasColumnType("varchar(256)");
+
+ b.Property("Website")
+ .HasMaxLength(500)
+ .HasColumnType("varchar(500)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("NormalizedEmail")
+ .HasDatabaseName("EmailIndex");
+
+ b.HasIndex("NormalizedUserName")
+ .IsUnique()
+ .HasDatabaseName("UserNameIndex");
+
+ b.ToTable("AspNetUsers", (string)null);
+ });
+
+ modelBuilder.Entity("Marechai.Database.Models.Audit", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("AffectedColumns")
+ .HasColumnType("json");
+
+ b.Property("CreatedOn")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("datetime(6)");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn"));
+
+ b.Property("Keys")
+ .HasColumnType("json");
+
+ b.Property("NewValues")
+ .HasColumnType("json");
+
+ b.Property("OldValues")
+ .HasColumnType("json");
+
+ b.Property("Table")
+ .HasColumnType("varchar(255)");
+
+ b.Property("Type")
+ .HasColumnType("tinyint unsigned");
+
+ b.Property("UpdatedOn")
+ .ValueGeneratedOnAddOrUpdate()
+ .HasColumnType("datetime(6)");
+
+ MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn"));
+
+ b.Property("UserId")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Table");
+
+ b.HasIndex("Type");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("Audit");
+ });
+
+ modelBuilder.Entity("Marechai.Database.Models.Book", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("CountryId")
+ .HasColumnType("smallint(3)");
+
+ b.Property("CoverGuid")
+ .HasColumnType("char(36)");
+
+ b.Property("CreatedOn")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("datetime(6)");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn"));
+
+ b.Property("Edition")
+ .HasColumnType("int");
+
+ b.Property("InternetArchiveUrl")
+ .HasMaxLength(2048)
+ .HasColumnType("varchar(2048)");
+
+ b.Property("Isbn")
+ .HasMaxLength(13)
+ .HasColumnType("varchar(13)");
+
+ b.Property("NativeTitle")
+ .HasColumnType("varchar(255)");
+
+ b.Property("OriginalCoverExtension")
+ .HasColumnType("longtext");
+
+ b.Property("Pages")
+ .HasColumnType("smallint");
+
+ b.Property("PreviousId")
+ .HasColumnType("bigint");
+
+ b.Property("Published")
+ .HasColumnType("datetime(6)");
+
+ b.Property("PublishedPrecision")
+ .HasColumnType("tinyint unsigned");
+
+ b.Property("SortTitle")
+ .HasColumnType("longtext");
+
+ b.Property("SourceId")
+ .HasColumnType("bigint");
+
+ b.Property("Title")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("UpdatedOn")
+ .ValueGeneratedOnAddOrUpdate()
+ .HasColumnType("datetime(6)");
+
+ MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn"));
+
+ b.HasKey("Id");
+
+ b.HasIndex("CountryId");
+
+ b.HasIndex("Edition");
+
+ b.HasIndex("Isbn");
+
+ b.HasIndex("NativeTitle");
+
+ b.HasIndex("Pages");
+
+ b.HasIndex("PreviousId")
+ .IsUnique();
+
+ b.HasIndex("Published");
+
+ b.HasIndex("SourceId");
+
+ b.HasIndex("Title");
+
+ b.ToTable("Books");
+ });
+
+ modelBuilder.Entity("Marechai.Database.Models.BookSynopsis", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("BookId")
+ .HasColumnType("bigint");
+
+ b.Property("CreatedOn")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("datetime(6)");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn"));
+
+ b.Property("LanguageCode")
+ .IsRequired()
+ .HasMaxLength(3)
+ .HasColumnType("char(3)");
+
+ b.Property("Text")
+ .IsRequired()
+ .HasMaxLength(262144)
+ .HasColumnType("longtext");
+
+ b.Property("UpdatedOn")
+ .ValueGeneratedOnAddOrUpdate()
+ .HasColumnType("datetime(6)");
+
+ MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn"));
+
+ b.HasKey("Id");
+
+ b.HasIndex("LanguageCode");
+
+ b.HasIndex("Text")
+ .HasAnnotation("MySql:FullTextIndex", true);
+
+ b.HasIndex("BookId", "LanguageCode")
+ .IsUnique()
+ .HasDatabaseName("idx_book_synopses_book_language");
+
+ b.ToTable("BookSynopses");
+ });
+
+ modelBuilder.Entity("Marechai.Database.Models.BooksByMachine", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("BookId")
+ .HasColumnType("bigint");
+
+ b.Property("CreatedOn")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("datetime(6)");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn"));
+
+ b.Property("MachineId")
+ .HasColumnType("int(11)");
+
+ b.Property("UpdatedOn")
+ .ValueGeneratedOnAddOrUpdate()
+ .HasColumnType("datetime(6)");
+
+ MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn"));
+
+ b.HasKey("Id");
+
+ b.HasIndex("BookId");
+
+ b.HasIndex("MachineId");
+
+ b.ToTable("BooksByMachines");
+ });
+
+ modelBuilder.Entity("Marechai.Database.Models.BooksByMachineFamily", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("BookId")
+ .HasColumnType("bigint");
+
+ b.Property("CreatedOn")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("datetime(6)");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn"));
+
+ b.Property("MachineFamilyId")
+ .HasColumnType("int(11)");
+
+ b.Property("UpdatedOn")
+ .ValueGeneratedOnAddOrUpdate()
+ .HasColumnType("datetime(6)");
+
+ MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn"));
+
+ b.HasKey("Id");
+
+ b.HasIndex("BookId");
+
+ b.HasIndex("MachineFamilyId");
+
+ b.ToTable("BooksByMachineFamilies");
+ });
+
+ modelBuilder.Entity("Marechai.Database.Models.BrowserTest", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int(11)")
+ .HasColumnName("id");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("Agif")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("tinyint(1)")
+ .HasDefaultValue((sbyte)0)
+ .HasColumnName("agif");
+
+ b.Property("Browser")
+ .IsRequired()
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)")
+ .HasColumnName("browser")
+ .HasDefaultValueSql("''");
+
+ b.Property("Colors")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("tinyint(1)")
+ .HasDefaultValue((sbyte)0)
+ .HasColumnName("colors");
+
+ b.Property("CreatedOn")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("datetime(6)");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn"));
+
+ b.Property("Flash")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("tinyint(1)")
+ .HasDefaultValue((sbyte)0)
+ .HasColumnName("flash");
+
+ b.Property("Frames")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("tinyint(1)")
+ .HasDefaultValue((sbyte)0)
+ .HasColumnName("frames");
+
+ b.Property("Gif87")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("tinyint(1)")
+ .HasDefaultValue((sbyte)0)
+ .HasColumnName("gif87");
+
+ b.Property("Gif89")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("tinyint(1)")
+ .HasDefaultValue((sbyte)0)
+ .HasColumnName("gif89");
+
+ b.Property("Jpeg")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("tinyint(1)")
+ .HasDefaultValue((sbyte)0)
+ .HasColumnName("jpeg");
+
+ b.Property("Js")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("tinyint(1)")
+ .HasDefaultValue((sbyte)0)
+ .HasColumnName("js");
+
+ b.Property("Os")
+ .IsRequired()
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(32)
+ .HasColumnType("varchar(32)")
+ .HasColumnName("os")
+ .HasDefaultValueSql("''");
+
+ b.Property("Platform")
+ .IsRequired()
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(8)
+ .HasColumnType("varchar(8)")
+ .HasColumnName("platform")
+ .HasDefaultValueSql("''");
+
+ b.Property("Png")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("tinyint(1)")
+ .HasDefaultValue((sbyte)0)
+ .HasColumnName("png");
+
+ b.Property("Pngt")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("tinyint(1)")
+ .HasDefaultValue((sbyte)0)
+ .HasColumnName("pngt");
+
+ b.Property("Table")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("tinyint(1)")
+ .HasDefaultValue((sbyte)0)
+ .HasColumnName("table");
+
+ b.Property("UpdatedOn")
+ .ValueGeneratedOnAddOrUpdate()
+ .HasColumnType("datetime(6)");
+
+ MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn"));
+
+ b.Property("UserAgent")
+ .IsRequired()
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)")
+ .HasColumnName("user_agent")
+ .HasDefaultValueSql("''");
+
+ b.Property("Version")
+ .IsRequired()
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(16)
+ .HasColumnType("varchar(16)")
+ .HasColumnName("version")
+ .HasDefaultValueSql("''");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Browser")
+ .HasDatabaseName("idx_browser_tests_browser");
+
+ b.HasIndex("Os")
+ .HasDatabaseName("idx_browser_tests_os");
+
+ b.HasIndex("Platform")
+ .HasDatabaseName("idx_browser_tests_platform");
+
+ b.HasIndex("UserAgent")
+ .HasDatabaseName("idx_browser_tests_user_agent");
+
+ b.HasIndex("Version")
+ .HasDatabaseName("idx_browser_tests_version");
+
+ b.ToTable("browser_tests", (string)null);
+ });
+
+ modelBuilder.Entity("Marechai.Database.Models.CollectedBook", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("varchar(255)");
+
+ b.Property("BookId")
+ .HasColumnType("bigint");
+
+ b.Property("CreatedOn")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("datetime(6)");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn"));
+
+ b.HasKey("UserId", "BookId");
+
+ b.HasIndex("BookId");
+
+ b.ToTable("CollectedBooks");
+ });
+
+ modelBuilder.Entity("Marechai.Database.Models.CollectedDocument", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("varchar(255)");
+
+ b.Property("DocumentId")
+ .HasColumnType("bigint");
+
+ b.Property("CreatedOn")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("datetime(6)");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn"));
+
+ b.HasKey("UserId", "DocumentId");
+
+ b.HasIndex("DocumentId");
+
+ b.ToTable("CollectedDocuments");
+ });
+
+ modelBuilder.Entity("Marechai.Database.Models.CollectedMagazineIssue", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("varchar(255)");
+
+ b.Property("MagazineIssueId")
+ .HasColumnType("bigint");
+
+ b.Property("CreatedOn")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("datetime(6)");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn"));
+
+ b.HasKey("UserId", "MagazineIssueId");
+
+ b.HasIndex("MagazineIssueId");
+
+ b.ToTable("CollectedMagazineIssues");
+ });
+
+ modelBuilder.Entity("Marechai.Database.Models.CollectedSoftwareRelease", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("varchar(255)");
+
+ b.Property("SoftwareReleaseId")
+ .HasColumnType("bigint unsigned");
+
+ b.Property("CreatedOn")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("datetime(6)");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn"));
+
+ b.HasKey("UserId", "SoftwareReleaseId");
+
+ b.HasIndex("SoftwareReleaseId");
+
+ b.ToTable("CollectedSoftwareReleases");
+ });
+
+ modelBuilder.Entity("Marechai.Database.Models.CompaniesByBook", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("BookId")
+ .HasColumnType("bigint");
+
+ b.Property("CompanyId")
+ .HasColumnType("int(11)");
+
+ b.Property("CreatedOn")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("datetime(6)");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn"));
+
+ b.Property("RoleId")
+ .IsRequired()
+ .HasColumnType("char(3)");
+
+ b.Property("UpdatedOn")
+ .ValueGeneratedOnAddOrUpdate()
+ .HasColumnType("datetime(6)");
+
+ MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn"));
+
+ b.HasKey("Id");
+
+ b.HasIndex("BookId");
+
+ b.HasIndex("CompanyId");
+
+ b.HasIndex("RoleId");
+
+ b.ToTable("CompaniesByBooks");
+ });
+
+ modelBuilder.Entity("Marechai.Database.Models.CompaniesByDocument", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("CompanyId")
+ .HasColumnType("int(11)");
+
+ b.Property("CreatedOn")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("datetime(6)");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn"));
+
+ b.Property("DocumentId")
+ .HasColumnType("bigint");
+
+ b.Property("RoleId")
+ .IsRequired()
+ .HasColumnType("char(3)");
+
+ b.Property("UpdatedOn")
+ .ValueGeneratedOnAddOrUpdate()
+ .HasColumnType("datetime(6)");
+
+ MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn"));
+
+ b.HasKey("Id");
+
+ b.HasIndex("CompanyId");
+
+ b.HasIndex("DocumentId");
+
+ b.HasIndex("RoleId");
+
+ b.ToTable("CompaniesByDocuments");
+ });
+
+ modelBuilder.Entity("Marechai.Database.Models.CompaniesByMagazine", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("CompanyId")
+ .HasColumnType("int(11)");
+
+ b.Property("CreatedOn")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("datetime(6)");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn"));
+
+ b.Property("MagazineId")
+ .HasColumnType("bigint");
+
+ b.Property("RoleId")
+ .IsRequired()
+ .HasColumnType("char(3)");
+
+ b.Property("UpdatedOn")
+ .ValueGeneratedOnAddOrUpdate()
+ .HasColumnType("datetime(6)");
+
+ MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn"));
+
+ b.HasKey("Id");
+
+ b.HasIndex("CompanyId");
+
+ b.HasIndex("MagazineId");
+
+ b.HasIndex("RoleId");
+
+ b.ToTable("CompaniesByMagazines");
+ });
+
+ modelBuilder.Entity("Marechai.Database.Models.Company", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int(11)")
+ .HasColumnName("id");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("Address")
+ .HasMaxLength(80)
+ .HasColumnType("varchar(80)")
+ .HasColumnName("address");
+
+ b.Property("City")
+ .HasMaxLength(80)
+ .HasColumnType("varchar(80)")
+ .HasColumnName("city");
+
+ b.Property("CountryId")
+ .HasColumnType("smallint(3)")
+ .HasColumnName("country");
+
+ b.Property("CreatedOn")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("datetime(6)");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn"));
+
+ b.Property("Facebook")
+ .HasMaxLength(45)
+ .HasColumnType("varchar(45)")
+ .HasColumnName("facebook");
+
+ b.Property("Founded")
+ .HasColumnType("datetime")
+ .HasColumnName("founded");
+
+ b.Property("FoundedPrecision")
+ .HasColumnType("tinyint unsigned");
+
+ b.Property("LegalName")
+ .HasColumnType("longtext");
+
+ b.Property("Name")
+ .IsRequired()
+ .ValueGeneratedOnAdd()
+ .HasColumnType("varchar(128)")
+ .HasColumnName("name")
+ .HasDefaultValueSql("''");
+
+ b.Property("PostalCode")
+ .HasMaxLength(25)
+ .HasColumnType("varchar(25)")
+ .HasColumnName("postal_code");
+
+ b.Property("Province")
+ .HasMaxLength(80)
+ .HasColumnType("varchar(80)")
+ .HasColumnName("province");
+
+ b.Property("Sold")
+ .HasColumnType("datetime")
+ .HasColumnName("sold");
+
+ b.Property("SoldPrecision")
+ .HasColumnType("tinyint unsigned");
+
+ b.Property("SoldToId")
+ .HasColumnType("int(11)")
+ .HasColumnName("sold_to");
+
+ b.Property("Status")
+ .HasColumnType("int(11)")
+ .HasColumnName("status");
+
+ b.Property("Twitter")
+ .HasMaxLength(45)
+ .HasColumnType("varchar(45)")
+ .HasColumnName("twitter");
+
+ b.Property("UpdatedOn")
+ .ValueGeneratedOnAddOrUpdate()
+ .HasColumnType("datetime(6)");
+
+ MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn"));
+
+ b.Property("Website")
+ .HasMaxLength(255)
+ .HasColumnType("varchar(255)")
+ .HasColumnName("website");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Address")
+ .HasDatabaseName("idx_companies_address");
+
+ b.HasIndex("City")
+ .HasDatabaseName("idx_companies_city");
+
+ b.HasIndex("CountryId")
+ .HasDatabaseName("idx_companies_country");
+
+ b.HasIndex("Facebook")
+ .HasDatabaseName("idx_companies_facebook");
+
+ b.HasIndex("Founded")
+ .HasDatabaseName("idx_companies_founded");
+
+ b.HasIndex("Name")
+ .HasDatabaseName("idx_companies_name");
+
+ b.HasIndex("PostalCode")
+ .HasDatabaseName("idx_companies_postal_code");
+
+ b.HasIndex("Province")
+ .HasDatabaseName("idx_companies_province");
+
+ b.HasIndex("Sold")
+ .HasDatabaseName("idx_companies_sold");
+
+ b.HasIndex("SoldToId")
+ .HasDatabaseName("idx_companies_sold_to");
+
+ b.HasIndex("Status")
+ .HasDatabaseName("idx_companies_status");
+
+ b.HasIndex("Twitter")
+ .HasDatabaseName("idx_companies_twitter");
+
+ b.HasIndex("Website")
+ .HasDatabaseName("idx_companies_website");
+
+ b.ToTable("companies", (string)null);
+ });
+
+ modelBuilder.Entity("Marechai.Database.Models.CompanyBySoftwareFamily", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint unsigned");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("CompanyId")
+ .HasColumnType("int(11)");
+
+ b.Property("CreatedOn")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("datetime(6)");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn"));
+
+ b.Property("RoleId")
+ .IsRequired()
+ .HasColumnType("char(3)");
+
+ b.Property("SoftwareFamilyId")
+ .HasColumnType("bigint unsigned");
+
+ b.Property("UpdatedOn")
+ .ValueGeneratedOnAddOrUpdate()
+ .HasColumnType("datetime(6)");
+
+ MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn"));
+
+ b.HasKey("Id");
+
+ b.HasIndex("CompanyId");
+
+ b.HasIndex("RoleId");
+
+ b.HasIndex("SoftwareFamilyId");
+
+ b.ToTable("CompaniesBySoftwareFamilies");
+ });
+
+ modelBuilder.Entity("Marechai.Database.Models.CompanyBySoftwareVersion", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint unsigned");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("CompanyId")
+ .HasColumnType("int(11)");
+
+ b.Property("CreatedOn")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("datetime(6)");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn"));
+
+ b.Property("RoleId")
+ .IsRequired()
+ .HasColumnType("char(3)");
+
+ b.Property("SoftwareVersionId")
+ .HasColumnType("bigint unsigned");
+
+ b.Property("UpdatedOn")
+ .ValueGeneratedOnAddOrUpdate()
+ .HasColumnType("datetime(6)");
+
+ MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn"));
+
+ b.HasKey("Id");
+
+ b.HasIndex("CompanyId");
+
+ b.HasIndex("RoleId");
+
+ b.HasIndex("SoftwareVersionId");
+
+ b.ToTable("CompaniesBySoftwareVersions");
+ });
+
+ modelBuilder.Entity("Marechai.Database.Models.CompanyDescription", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("CompanyId")
+ .HasColumnType("int(11)");
+
+ b.Property("CreatedOn")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("datetime(6)");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn"));
+
+ b.Property("Html")
+ .HasMaxLength(262144)
+ .HasColumnType("longtext");
+
+ b.Property("LanguageCode")
+ .IsRequired()
+ .HasMaxLength(3)
+ .HasColumnType("char(3)");
+
+ b.Property("Text")
+ .IsRequired()
+ .HasMaxLength(262144)
+ .HasColumnType("longtext");
+
+ b.Property("UpdatedOn")
+ .ValueGeneratedOnAddOrUpdate()
+ .HasColumnType("datetime(6)");
+
+ MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn"));
+
+ b.HasKey("Id");
+
+ b.HasIndex("LanguageCode");
+
+ b.HasIndex("Text")
+ .HasAnnotation("MySql:FullTextIndex", true);
+
+ b.HasIndex("CompanyId", "LanguageCode")
+ .IsUnique()
+ .HasDatabaseName("idx_company_descriptions_company_language");
+
+ b.ToTable("CompanyDescriptions");
+ });
+
+ modelBuilder.Entity("Marechai.Database.Models.CompanyLogo", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int(11)")
+ .HasColumnName("id");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("CompanyId")
+ .HasColumnType("int(11)")
+ .HasColumnName("company_id");
+
+ b.Property("Guid")
+ .HasColumnType("char(36)")
+ .HasColumnName("logo_guid");
+
+ b.Property("CreatedOn")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("datetime(6)");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn"));
+
+ b.Property("UpdatedOn")
+ .ValueGeneratedOnAddOrUpdate()
+ .HasColumnType("datetime(6)");
+
+ MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn"));
+
+ b.Property("Year")
+ .HasColumnType("int(4)")
+ .HasColumnName("year");
+
+ b.HasKey("Id", "CompanyId", "Guid");
+
+ b.HasIndex("CompanyId")
+ .HasDatabaseName("idx_company_id");
+
+ b.HasIndex("Guid")
+ .HasDatabaseName("idx_guid");
+
+ b.HasIndex("Id")
+ .IsUnique()
+ .HasDatabaseName("idx_id");
+
+ b.ToTable("company_logos", (string)null);
+ });
+
+ modelBuilder.Entity("Marechai.Database.Models.Conversation", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("CreatedOn")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("datetime(6)");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CreatedOn"));
+
+ b.Property("IsSystemThread")
+ .HasColumnType("bit(1)");
+
+ b.Property("Subject")
+ .HasMaxLength(256)
+ .HasColumnType("varchar(256)");
+
+ b.Property("UpdatedOn")
+ .ValueGeneratedOnAddOrUpdate()
+ .HasColumnType("datetime(6)");
+
+ MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedOn"));
+
+ b.HasKey("Id");
+
+ b.HasIndex("IsSystemThread");
+
+ b.ToTable("Conversations");
+ });
+
+ modelBuilder.Entity("Marechai.Database.Models.ConversationParticipant", b =>
+ {
+ b.Property("ConversationId")
+ .HasColumnType("bigint");
+
+ b.Property("UserId")
+ .HasColumnType("varchar(255)");
+
+ b.Property("JoinedOn")
+ .HasColumnType("datetime(6)");
+
+ b.Property("LeftOn")
+ .HasColumnType("datetime(6)");
+
+ b.HasKey("ConversationId", "UserId");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("ConversationParticipants");
+ });
+
+ modelBuilder.Entity("Marechai.Database.Models.CurrencyInflation", b =>
+ {
+ b.Property