From fecbf0ec3b4d5ff65ae945029aeda86df0b46a7d Mon Sep 17 00:00:00 2001 From: Hamid Reza Mohammadi Date: Sat, 3 Oct 2026 18:05:55 +0330 Subject: [PATCH] people tags #387 --- .../Admin/Pages/ReviewPersonEdits.cshtml | 5 + .../Admin/Pages/ReviewPersonEdits.cshtml.cs | 13 + GanjooRazor/Areas/User/Pages/Editor.cshtml | 13 +- .../Areas/User/Pages/SuggestPersonEdit.cshtml | 13 + .../User/Pages/SuggestPersonEdit.cshtml.cs | 1 + GanjooRazor/wwwroot/js/familytree.js | 28 +- ...20261003143457_AddPersonGender.Designer.cs | 6628 +++++++++++++++++ .../20261003143457_AddPersonGender.cs | 40 + .../RMuseumDbContextModelSnapshot.cs | 6 + .../Ganjoor/GanjoorPersonEditSuggestion.cs | 5 + .../Models/Ganjoor/GanjoorRelatedPerson.cs | 7 + RMuseum/Models/Ganjoor/PersonGender.cs | 30 + .../ViewModels/PersonGraphSuggestion.cs | 6 + RMuseum/RMuseum.xml | 57 + .../GanjoorRelatedPersonService.cs | 1 + .../GanjoorService-ModeratePoemCorrection.cs | 15 +- 16 files changed, 6862 insertions(+), 6 deletions(-) create mode 100644 RMuseum/Migrations/20261003143457_AddPersonGender.Designer.cs create mode 100644 RMuseum/Migrations/20261003143457_AddPersonGender.cs create mode 100644 RMuseum/Models/Ganjoor/PersonGender.cs diff --git a/GanjooRazor/Areas/Admin/Pages/ReviewPersonEdits.cshtml b/GanjooRazor/Areas/Admin/Pages/ReviewPersonEdits.cshtml index 1216683e..0bb40291 100644 --- a/GanjooRazor/Areas/Admin/Pages/ReviewPersonEdits.cshtml +++ b/GanjooRazor/Areas/Admin/Pages/ReviewPersonEdits.cshtml @@ -113,6 +113,11 @@ else @Model.ImportanceLabel(p.Importance) @Model.ImportanceLabel(s.SuggestedImportance) + + جنسیت + @Model.GenderLabel(p.Gender) + @Model.GenderLabel(s.SuggestedGender) + توضیحات @p.Description diff --git a/GanjooRazor/Areas/Admin/Pages/ReviewPersonEdits.cshtml.cs b/GanjooRazor/Areas/Admin/Pages/ReviewPersonEdits.cshtml.cs index 93ab2129..87afec0f 100644 --- a/GanjooRazor/Areas/Admin/Pages/ReviewPersonEdits.cshtml.cs +++ b/GanjooRazor/Areas/Admin/Pages/ReviewPersonEdits.cshtml.cs @@ -69,6 +69,19 @@ namespace GanjooRazor.Areas.Admin.Pages } } + public string GenderLabel(PersonGender gender) + { + switch (gender) + { + case PersonGender.Male: + return "مرد"; + case PersonGender.Female: + return "زن"; + default: + return "نامشخص"; + } + } + public IActionResult OnPost() { Skip = string.IsNullOrEmpty(Request.Query["skip"]) ? 0 : int.Parse(Request.Query["skip"]); diff --git a/GanjooRazor/Areas/User/Pages/Editor.cshtml b/GanjooRazor/Areas/User/Pages/Editor.cshtml index fc488fe8..b8a85f63 100644 --- a/GanjooRazor/Areas/User/Pages/Editor.cshtml +++ b/GanjooRazor/Areas/User/Pages/Editor.cshtml @@ -561,7 +561,8 @@ birthLocationId: null, deathLocationId: null, familyTreeCaption: $('#geotag-new-person-familytreecaption').val() || null, - importance: $('#geotag-new-person-importance').val() + importance: $('#geotag-new-person-importance').val(), + gender: $('#geotag-new-person-gender').val() }; var relatedPeople = []; @@ -854,6 +855,7 @@ $('#geotag-new-person-wikiurl').val(''); $('#geotag-new-person-familytreecaption').val(''); $('#geotag-new-person-importance').val('Normal'); + $('#geotag-new-person-gender').val('Unknown'); $('#geotag-person-relatives-list').empty(); if (document.getElementById('new-person-widget').style.display !== 'none') { toggleNewPersonWidget(); @@ -2691,6 +2693,15 @@ else

فقط اندازهٔ نمایش این نامبرده را در نمودار شخصیت‌ها تعیین می‌کند.

+
+ + +

فقط در ترسیم نمودار تبارنامه استفاده می‌شود (برای تشخیص اینکه کدام والد به عنوان ادامهٔ اصلی شاخهٔ خانوادگی رسم شود).

+

اگر خویشاوندی یا وابستگی این نامبرده با نامبردۀ دیگری را می‌دانید، می‌توانید همین‌جا اضافه کنید (نامبردۀ دیگر باید از قبل در فهرست موجود باشد؛ diff --git a/GanjooRazor/Areas/User/Pages/SuggestPersonEdit.cshtml b/GanjooRazor/Areas/User/Pages/SuggestPersonEdit.cshtml index e1f1ace0..0bf2f1cf 100644 --- a/GanjooRazor/Areas/User/Pages/SuggestPersonEdit.cshtml +++ b/GanjooRazor/Areas/User/Pages/SuggestPersonEdit.cshtml @@ -78,6 +78,19 @@ else + + + جنسیت: +

صِرفاً در ترسیم نمودار تبارنامه استفاده می‌شود (برای تشخیص اینکه کدام والد به عنوان ادامهٔ اصلی شاخهٔ خانوادگی رسم شود)؛ در هیچ فهرست یا جستجویی تأثیری ندارد.

+ + + + + توضیحات: diff --git a/GanjooRazor/Areas/User/Pages/SuggestPersonEdit.cshtml.cs b/GanjooRazor/Areas/User/Pages/SuggestPersonEdit.cshtml.cs index 6ef494c4..1761e4b1 100644 --- a/GanjooRazor/Areas/User/Pages/SuggestPersonEdit.cshtml.cs +++ b/GanjooRazor/Areas/User/Pages/SuggestPersonEdit.cshtml.cs @@ -90,6 +90,7 @@ namespace GanjooRazor.Areas.User.Pages SuggestedDeathLocationId = Person.DeathLocationId, SuggestedFamilyTreeCaption = Person.FamilyTreeCaption, SuggestedImportance = Person.Importance, + SuggestedGender = Person.Gender, }; } diff --git a/GanjooRazor/wwwroot/js/familytree.js b/GanjooRazor/wwwroot/js/familytree.js index d1b76a2f..462fe320 100644 --- a/GanjooRazor/wwwroot/js/familytree.js +++ b/GanjooRazor/wwwroot/js/familytree.js @@ -79,8 +79,21 @@ allIds.forEach(function (id) { isRoot[id] = !parentsOf[id] || parentsOf[id].length === 0; }); // one child can have two recorded parents (mother + father) - pick a single "primary" - // parent per child to build a drawable tree, preferring whichever parent is NOT themselves - // a chart-root (so the root-level spouse ends up as the "attached" side, see below) + // parent per child to build a drawable tree. Preference order: + // 1) whichever parent is NOT themselves a chart-root (so the tree keeps following a + // documented lineage instead of dead-ending at a root with no known ancestors) - + // the root-level parent then ends up as the "attached" side, see below; + // 2) if that's a tie (both parents are roots, or both have their own recorded + // ancestors - common in legendary/mythological genealogies where both sides are + // fully documented), prefer the father (PersonGender.Male = 1), matching + // conventional patrilineal genealogy-chart practice; + // 3) if gender doesn't resolve it either (same gender, or neither recorded), fall back + // to ascending person id, just to be deterministic - this last step has no meaning + // of its own and is only a last resort. + function genderRank(id) { + var g = (persons[id] && persons[id].gender) || 0; + return g === 1 ? 0 : (g === 2 ? 1 : 2); // Male first, then Female, then Unknown + } var primaryParentOf = {}; var secondaryParentOf = {}; allIds.forEach(function (childId) { @@ -90,6 +103,8 @@ var sorted = ps.slice().sort(function (a, b) { var ar = isRoot[a] ? 1 : 0, br = isRoot[b] ? 1 : 0; if (ar !== br) return ar - br; + var ag = genderRank(a), bg = genderRank(b); + if (ag !== bg) return ag - bg; return a - b; }); primaryParentOf[childId] = sorted[0]; @@ -202,6 +217,9 @@ return { w: baseW + bump.w, h: baseH + bump.h }; } + // 0=Normal (regular weight), 1=Important (semi-bold), 2=VeryImportant (bold) + var IMPORTANCE_FONT_WEIGHT = { 0: 400, 1: 600, 2: 700 }; + function renderFamilyTree(containerId, svgId, tooltipId, data, requestedRootId) { var container = document.getElementById(containerId); var svg = document.getElementById(svgId); @@ -264,8 +282,12 @@ 'class': isRequested ? 'ft-box ft-box-current' : 'ft-box' }); g.appendChild(rect); + // same importance->weight idea as the width/height bump above - Important/VeryImportant + // names are drawn bolder, not just in a bigger box, so they stand out at a glance + var fontWeight = IMPORTANCE_FONT_WEIGHT[(p && p.importance) || 0] || IMPORTANCE_FONT_WEIGHT[0]; var text = el('text', { - x: x, y: y + 5, 'text-anchor': 'middle', 'class': 'ft-box-text', direction: 'rtl' + x: x, y: y + 5, 'text-anchor': 'middle', 'class': 'ft-box-text', direction: 'rtl', + style: 'font-weight:' + fontWeight }); text.textContent = personLabel(p); g.appendChild(text); diff --git a/RMuseum/Migrations/20261003143457_AddPersonGender.Designer.cs b/RMuseum/Migrations/20261003143457_AddPersonGender.Designer.cs new file mode 100644 index 00000000..ccf9cd35 --- /dev/null +++ b/RMuseum/Migrations/20261003143457_AddPersonGender.Designer.cs @@ -0,0 +1,6628 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using RMuseum.DbContext; + +#nullable disable + +namespace RMuseum.Migrations +{ + [DbContext(typeof(RMuseumDbContext))] + [Migration("20261003143457_AddPersonGender")] + partial class AddPersonGender + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "10.0.11") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens", (string)null); + }); + + modelBuilder.Entity("RMuseum.Models.Accounting.DonationExpenditure", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Amount") + .HasColumnType("decimal(18,2)"); + + b.Property("GanjoorDonationId") + .HasColumnType("int"); + + b.Property("GanjoorExpenseId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("GanjoorDonationId"); + + b.HasIndex("GanjoorExpenseId"); + + b.ToTable("DonationExpenditure"); + }); + + modelBuilder.Entity("RMuseum.Models.Accounting.GanjoorDonation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Amount") + .HasColumnType("decimal(18,2)"); + + b.Property("AmountString") + .HasColumnType("nvarchar(max)"); + + b.Property("DateString") + .HasColumnType("nvarchar(max)"); + + b.Property("DonorLink") + .HasColumnType("nvarchar(max)"); + + b.Property("DonorName") + .HasColumnType("nvarchar(max)"); + + b.Property("ExpenditureDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("ImportedRecord") + .HasColumnType("bit"); + + b.Property("RecordDate") + .HasColumnType("datetime2"); + + b.Property("Remaining") + .HasColumnType("decimal(18,2)"); + + b.Property("Unit") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("GanjoorDonations"); + }); + + modelBuilder.Entity("RMuseum.Models.Accounting.GanjoorExpense", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Amount") + .HasColumnType("decimal(18,2)"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("ExpenseDate") + .HasColumnType("datetime2"); + + b.Property("Unit") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("GanjoorExpenses"); + }); + + modelBuilder.Entity("RMuseum.Models.Artifact.RArtifactItemRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CoverImageIndex") + .HasColumnType("int"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DescriptionInEnglish") + .HasColumnType("nvarchar(max)"); + + b.Property("FriendlyUrl") + .HasColumnType("nvarchar(450)"); + + b.Property("LastModified") + .HasColumnType("datetime2"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("NameInEnglish") + .HasColumnType("nvarchar(max)"); + + b.Property("Order") + .HasColumnType("int"); + + b.Property("RArtifactMasterRecordId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RArtifactMasterRecordId", "FriendlyUrl") + .IsUnique() + .HasFilter("[FriendlyUrl] IS NOT NULL"); + + b.HasIndex("RArtifactMasterRecordId", "Order") + .IsUnique(); + + b.ToTable("Items"); + }); + + modelBuilder.Entity("RMuseum.Models.Artifact.RArtifactMasterRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CoverImageId") + .HasColumnType("uniqueidentifier"); + + b.Property("CoverItemIndex") + .HasColumnType("int"); + + b.Property("DateTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DescriptionInEnglish") + .HasColumnType("nvarchar(max)"); + + b.Property("FriendlyUrl") + .HasColumnType("nvarchar(450)"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("LastModified") + .HasColumnType("datetime2"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("NameInEnglish") + .HasColumnType("nvarchar(max)"); + + b.Property("Status") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CoverImageId"); + + b.HasIndex("FriendlyUrl") + .IsUnique() + .HasFilter("[FriendlyUrl] IS NOT NULL"); + + b.HasIndex("LastModified"); + + b.HasIndex("CoverItemIndex", "Status"); + + b.ToTable("Artifacts"); + }); + + modelBuilder.Entity("RMuseum.Models.Artifact.RTag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("FriendlyUrl") + .HasColumnType("nvarchar(450)"); + + b.Property("GlobalValue") + .HasColumnType("bit"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("NameInEnglish") + .HasColumnType("nvarchar(max)"); + + b.Property("Order") + .HasColumnType("int"); + + b.Property("PluralName") + .HasColumnType("nvarchar(max)"); + + b.Property("PluralNameInEnglish") + .HasColumnType("nvarchar(max)"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("TagType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("FriendlyUrl"); + + b.ToTable("Tags"); + }); + + modelBuilder.Entity("RMuseum.Models.Artifact.RTagValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BookId") + .HasColumnType("int"); + + b.Property("FriendlyUrl") + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.Property("PDFBookId") + .HasColumnType("int"); + + b.Property("PDFPageId") + .HasColumnType("int"); + + b.Property("RArtifactItemRecordId") + .HasColumnType("uniqueidentifier"); + + b.Property("RArtifactMasterRecordId") + .HasColumnType("uniqueidentifier"); + + b.Property("RTagId") + .HasColumnType("uniqueidentifier"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.Property("ValueInEnglish") + .HasColumnType("nvarchar(max)"); + + b.Property("ValueSupplement") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("BookId"); + + b.HasIndex("FriendlyUrl"); + + b.HasIndex("PDFBookId"); + + b.HasIndex("PDFPageId"); + + b.HasIndex("RArtifactItemRecordId"); + + b.HasIndex("RArtifactMasterRecordId"); + + b.HasIndex("RTagId"); + + b.ToTable("TagValues"); + }); + + modelBuilder.Entity("RMuseum.Models.Bookmark.RUserBookmark", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DateTime") + .HasColumnType("datetime2"); + + b.Property("Note") + .HasColumnType("nvarchar(max)"); + + b.Property("RAppUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("RArtifactItemRecordId") + .HasColumnType("uniqueidentifier"); + + b.Property("RArtifactMasterRecordId") + .HasColumnType("uniqueidentifier"); + + b.Property("RBookmarkType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RAppUserId"); + + b.HasIndex("RArtifactItemRecordId"); + + b.HasIndex("RArtifactMasterRecordId"); + + b.ToTable("UserBookmarks"); + }); + + modelBuilder.Entity("RMuseum.Models.ExternalFTPUpload.QueuedFTPUpload", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("DeleteFileAfterUpload") + .HasColumnType("bit"); + + b.Property("Error") + .HasColumnType("nvarchar(max)"); + + b.Property("LocalFilePath") + .HasColumnType("nvarchar(max)"); + + b.Property("ProcessDate") + .HasColumnType("datetime2"); + + b.Property("Processing") + .HasColumnType("bit"); + + b.Property("QueueDate") + .HasColumnType("datetime2"); + + b.Property("RemoteFilePath") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("QueuedFTPUploads"); + }); + + modelBuilder.Entity("RMuseum.Models.FAQ.FAQCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CatOrder") + .HasColumnType("int"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Published") + .HasColumnType("bit"); + + b.Property("Title") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("FAQCategories"); + }); + + modelBuilder.Entity("RMuseum.Models.FAQ.FAQItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AnswerExcerpt") + .HasColumnType("nvarchar(max)"); + + b.Property("CategoryId") + .HasColumnType("int"); + + b.Property("ContentForSearch") + .HasColumnType("nvarchar(max)"); + + b.Property("FullAnswer") + .HasColumnType("nvarchar(max)"); + + b.Property("HashTag1") + .HasColumnType("nvarchar(max)"); + + b.Property("HashTag2") + .HasColumnType("nvarchar(max)"); + + b.Property("HashTag3") + .HasColumnType("nvarchar(max)"); + + b.Property("HashTag4") + .HasColumnType("nvarchar(max)"); + + b.Property("ItemOrderInCategory") + .HasColumnType("int"); + + b.Property("Pinned") + .HasColumnType("bit"); + + b.Property("PinnedItemOrder") + .HasColumnType("int"); + + b.Property("Published") + .HasColumnType("bit"); + + b.Property("Question") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("CategoryId"); + + b.ToTable("FAQItems"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.CategoryWordCount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CatId") + .HasColumnType("int"); + + b.Property("Count") + .HasColumnType("int"); + + b.Property("RowNmbrInCat") + .HasColumnType("int"); + + b.Property("Word") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("CatId", "Word") + .IsUnique() + .HasFilter("[Word] IS NOT NULL"); + + b.ToTable("CategoryWordCounts"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.CategoryWordCountSummary", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CatId") + .HasColumnType("int"); + + b.Property("TotalWordCount") + .HasColumnType("int"); + + b.Property("UniqueWordCount") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CatId") + .IsUnique(); + + b.ToTable("CategoryWordCountSummaries"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.DigitalSource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CoupletsCount") + .HasColumnType("int"); + + b.Property("FullName") + .HasColumnType("nvarchar(max)"); + + b.Property("ShortName") + .HasColumnType("nvarchar(max)"); + + b.Property("SourceType") + .HasColumnType("nvarchar(max)"); + + b.Property("UrlSlug") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("DigitalSources"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.DiscoverQuotedQueueItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("PoemId") + .HasColumnType("int"); + + b.Property("PoetId") + .HasColumnType("int"); + + b.Property("RelatedPoemId") + .HasColumnType("int"); + + b.Property("RelatedPoetId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("DiscoverQuotedQueueItems"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorCachedRelatedPoem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("FullTitle") + .HasColumnType("nvarchar(max)"); + + b.Property("FullUrl") + .HasColumnType("nvarchar(450)"); + + b.Property("HtmlExcerpt") + .HasColumnType("nvarchar(max)"); + + b.Property("PoemId") + .HasColumnType("int"); + + b.Property("PoetId") + .HasColumnType("int"); + + b.Property("PoetImageUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("PoetMorePoemsLikeThisCount") + .HasColumnType("int"); + + b.Property("PoetName") + .HasColumnType("nvarchar(max)"); + + b.Property("RelationOrder") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("FullUrl"); + + b.HasIndex("PoemId"); + + b.ToTable("GanjoorCachedRelatedPoems"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorCachedRelatedSection", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("FullTitle") + .HasColumnType("nvarchar(max)"); + + b.Property("FullUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("HtmlExcerpt") + .HasColumnType("nvarchar(max)"); + + b.Property("PoemId") + .HasColumnType("int"); + + b.Property("PoetId") + .HasColumnType("int"); + + b.Property("PoetImageUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("PoetMorePoemsLikeThisCount") + .HasColumnType("int"); + + b.Property("PoetName") + .HasColumnType("nvarchar(max)"); + + b.Property("RelationOrder") + .HasColumnType("int"); + + b.Property("SectionIndex") + .HasColumnType("int"); + + b.Property("TargetPoemId") + .HasColumnType("int"); + + b.Property("TargetSectionIndex") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("PoemId", "SectionIndex"); + + b.ToTable("GanjoorCachedRelatedSections"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorCat", b => + { + b.Property("Id") + .HasColumnType("int"); + + b.Property("BookName") + .HasColumnType("nvarchar(max)"); + + b.Property("CatType") + .HasColumnType("int"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DescriptionHtml") + .HasColumnType("nvarchar(max)"); + + b.Property("FullUrl") + .HasColumnType("nvarchar(450)"); + + b.Property("MapName") + .HasColumnType("nvarchar(max)"); + + b.Property("MixedModeOrder") + .HasColumnType("int"); + + b.Property("ParentId") + .HasColumnType("int"); + + b.Property("PoetId") + .HasColumnType("int"); + + b.Property("Published") + .HasColumnType("bit"); + + b.Property("RImageId") + .HasColumnType("uniqueidentifier"); + + b.Property("SumUpSubsGeoLocations") + .HasColumnType("bit"); + + b.Property("TableOfContentsStyle") + .HasColumnType("int"); + + b.Property("Title") + .HasColumnType("nvarchar(max)"); + + b.Property("UrlSlug") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("FullUrl"); + + b.HasIndex("PoetId"); + + b.HasIndex("RImageId"); + + b.HasIndex("ParentId", "PoetId"); + + SqlServerIndexBuilderExtensions.IncludeProperties(b.HasIndex("ParentId", "PoetId"), new[] { "Id" }); + + b.ToTable("GanjoorCategories"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorCatCorrection", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AffectedTheCat") + .HasColumnType("bit"); + + b.Property("ApplicationOrder") + .HasColumnType("int"); + + b.Property("CatId") + .HasColumnType("int"); + + b.Property("Date") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DescriptionHtml") + .HasColumnType("nvarchar(max)"); + + b.Property("HideMyName") + .HasColumnType("bit"); + + b.Property("Note") + .HasColumnType("nvarchar(max)"); + + b.Property("OriginalDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("OriginalDescriptionHtml") + .HasColumnType("nvarchar(max)"); + + b.Property("PageId") + .HasColumnType("int"); + + b.Property("Result") + .HasColumnType("int"); + + b.Property("ReviewDate") + .HasColumnType("datetime2"); + + b.Property("ReviewNote") + .HasColumnType("nvarchar(max)"); + + b.Property("Reviewed") + .HasColumnType("bit"); + + b.Property("ReviewerUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("CatId"); + + b.HasIndex("ReviewerUserId"); + + b.HasIndex("UserId"); + + b.ToTable("GanjoorCatCorrections"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorCentury", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("EndYear") + .HasColumnType("int"); + + b.Property("HalfCenturyOrder") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("ShowInTimeLine") + .HasColumnType("bit"); + + b.Property("StartYear") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("GanjoorCenturies"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorCenturyPoet", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("GanjoorCenturyId") + .HasColumnType("int"); + + b.Property("PoetId") + .HasColumnType("int"); + + b.Property("PoetOrder") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("GanjoorCenturyId"); + + b.HasIndex("PoetId"); + + b.ToTable("GanjoorCenturyPoet"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorComment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AuthorEmail") + .HasColumnType("nvarchar(max)"); + + b.Property("AuthorIpAddress") + .HasColumnType("nvarchar(max)"); + + b.Property("AuthorName") + .HasColumnType("nvarchar(max)"); + + b.Property("AuthorUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("CommentDate") + .HasColumnType("datetime2"); + + b.Property("CoupletIndex") + .HasColumnType("int"); + + b.Property("DislikeCount") + .HasColumnType("int"); + + b.Property("HtmlComment") + .HasColumnType("nvarchar(max)"); + + b.Property("InReplyToId") + .HasColumnType("int"); + + b.Property("LikeCount") + .HasColumnType("int"); + + b.Property("PoemId") + .HasColumnType("int"); + + b.Property("SortKey") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("Verse12d") + .HasColumnType("int"); + + b.Property("Verse1Id") + .HasColumnType("int"); + + b.Property("Verse2Id") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CommentDate"); + + b.HasIndex("InReplyToId"); + + b.HasIndex("Status"); + + b.HasIndex("UserId"); + + b.HasIndex("Verse1Id"); + + b.HasIndex("Verse2Id"); + + b.HasIndex("PoemId", "CommentDate"); + + b.HasIndex("PoemId", "SortKey"); + + b.ToTable("GanjoorComments"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorCommentAbuseReport", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("GanjoorCommentId") + .HasColumnType("int"); + + b.Property("ReasonCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ReasonText") + .HasColumnType("nvarchar(max)"); + + b.Property("ReportedById") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("GanjoorCommentId"); + + b.HasIndex("ReportedById"); + + b.ToTable("GanjoorReportedComments"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorCommentReaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("GanjoorCommentId") + .HasColumnType("int"); + + b.Property("PoemId") + .HasColumnType("int"); + + b.Property("ReactionDate") + .HasColumnType("datetime2"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("Value") + .HasColumnType("smallint"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.HasIndex("GanjoorCommentId", "UserId") + .IsUnique(); + + b.HasIndex("PoemId", "UserId"); + + b.ToTable("GanjoorCommentReactions"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorDuplicate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("DestPoemId") + .HasColumnType("int"); + + b.Property("SrcCatId") + .HasColumnType("int"); + + b.Property("SrcPoemId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("DestPoemId"); + + b.HasIndex("SrcPoemId"); + + b.ToTable("GanjoorDuplicates"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorGeoLocation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Latitude") + .HasColumnType("decimal(12,9)"); + + b.Property("Longitude") + .HasColumnType("decimal(12,9)"); + + b.Property("MachineGenerated") + .HasColumnType("bit"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("GanjoorGeoLocations"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorHealthCheckError", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("BrokenLink") + .HasColumnType("bit"); + + b.Property("MulipleTargets") + .HasColumnType("bit"); + + b.Property("ReferrerPageUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("TargetUrl") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("GanjoorHealthCheckErrors"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorLanguage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Code") + .HasColumnType("nvarchar(max)"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasColumnType("nvarchar(450)"); + + b.Property("NativeName") + .HasColumnType("nvarchar(max)"); + + b.Property("RightToLeft") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique() + .HasFilter("[Name] IS NOT NULL"); + + b.ToTable("GanjoorLanguages"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorMetre", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("Rhythm") + .HasColumnType("nvarchar(max)"); + + b.Property("UrlSlug") + .HasColumnType("nvarchar(max)"); + + b.Property("VerseCount") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("GanjoorMetres"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorNumbering", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("EndCatId") + .HasColumnType("int"); + + b.Property("LastCountingDate") + .HasColumnType("datetime2"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("StartCatId") + .HasColumnType("int"); + + b.Property("TotalCouplets") + .HasColumnType("int"); + + b.Property("TotalLines") + .HasColumnType("int"); + + b.Property("TotalParagraphs") + .HasColumnType("int"); + + b.Property("TotalVerses") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("EndCatId"); + + b.HasIndex("StartCatId"); + + b.ToTable("GanjoorNumberings"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPage", b => + { + b.Property("Id") + .HasColumnType("int"); + + b.Property("CatId") + .HasColumnType("int"); + + b.Property("FullTitle") + .HasColumnType("nvarchar(max)"); + + b.Property("FullUrl") + .HasColumnType("nvarchar(450)"); + + b.Property("GanjoorPageType") + .HasColumnType("int"); + + b.Property("HtmlText") + .HasColumnType("nvarchar(max)"); + + b.Property("NoIndex") + .HasColumnType("bit"); + + b.Property("PageOrder") + .HasColumnType("int"); + + b.Property("ParentId") + .HasColumnType("int"); + + b.Property("PoemId") + .HasColumnType("int"); + + b.Property("PoetId") + .HasColumnType("int"); + + b.Property("PostDate") + .HasColumnType("datetime2"); + + b.Property("Published") + .HasColumnType("bit"); + + b.Property("RedirectFromFullUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("SecondPoetId") + .HasColumnType("int"); + + b.Property("Title") + .HasColumnType("nvarchar(max)"); + + b.Property("UrlSlug") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("CatId"); + + b.HasIndex("FullUrl"); + + b.HasIndex("ParentId"); + + b.HasIndex("PoemId"); + + b.HasIndex("PoetId"); + + b.HasIndex("SecondPoetId"); + + b.ToTable("GanjoorPages"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPageSnapshot", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("GanjoorPageId") + .HasColumnType("int"); + + b.Property("HtmlText") + .HasColumnType("nvarchar(max)"); + + b.Property("MadeObsoleteByUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("Note") + .HasColumnType("nvarchar(max)"); + + b.Property("OldTag") + .HasColumnType("nvarchar(max)"); + + b.Property("OldTagPageUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("RecordDate") + .HasColumnType("datetime2"); + + b.Property("RhymeLetters") + .HasColumnType("nvarchar(max)"); + + b.Property("Rhythm") + .HasColumnType("nvarchar(max)"); + + b.Property("SourceName") + .HasColumnType("nvarchar(max)"); + + b.Property("SourceUrlSlug") + .HasColumnType("nvarchar(max)"); + + b.Property("Title") + .HasColumnType("nvarchar(max)"); + + b.Property("UrlSlug") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("GanjoorPageId"); + + b.HasIndex("MadeObsoleteByUserId"); + + b.ToTable("GanjoorPageSnapshots"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPersonAffiliation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AffiliationType") + .HasColumnType("int"); + + b.Property("Note") + .HasColumnType("nvarchar(max)"); + + b.Property("Person1Id") + .HasColumnType("int"); + + b.Property("Person2Id") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("Person1Id"); + + b.HasIndex("Person2Id"); + + b.ToTable("GanjoorPersonAffiliations"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPersonEditSuggestion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Date") + .HasColumnType("datetime2"); + + b.Property("PersonId") + .HasColumnType("int"); + + b.Property("Result") + .HasColumnType("int"); + + b.Property("ReviewDate") + .HasColumnType("datetime2"); + + b.Property("ReviewNote") + .HasColumnType("nvarchar(max)"); + + b.Property("Reviewed") + .HasColumnType("bit"); + + b.Property("ReviewerUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("SuggestedBirthLocationId") + .HasColumnType("int"); + + b.Property("SuggestedBirthYearInLHijri") + .HasColumnType("int"); + + b.Property("SuggestedDeathLocationId") + .HasColumnType("int"); + + b.Property("SuggestedDeathYearInLHijri") + .HasColumnType("int"); + + b.Property("SuggestedDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("SuggestedFamilyTreeCaption") + .HasColumnType("nvarchar(max)"); + + b.Property("SuggestedForDeletion") + .HasColumnType("bit"); + + b.Property("SuggestedGender") + .HasColumnType("int"); + + b.Property("SuggestedImportance") + .HasColumnType("int"); + + b.Property("SuggestedName") + .HasColumnType("nvarchar(max)"); + + b.Property("SuggestedValidBirthDate") + .HasColumnType("bit"); + + b.Property("SuggestedValidDeathDate") + .HasColumnType("bit"); + + b.Property("SuggestedWikiUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("SuggestionNote") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("PersonId"); + + b.HasIndex("ReviewerUserId"); + + b.HasIndex("SuggestedBirthLocationId"); + + b.HasIndex("SuggestedDeathLocationId"); + + b.HasIndex("UserId"); + + b.ToTable("GanjoorPersonEditSuggestions"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPersonRelation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("DegreeHint") + .HasColumnType("int"); + + b.Property("Note") + .HasColumnType("nvarchar(max)"); + + b.Property("Person1Id") + .HasColumnType("int"); + + b.Property("Person2Id") + .HasColumnType("int"); + + b.Property("RelationType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("Person1Id"); + + b.HasIndex("Person2Id"); + + b.ToTable("GanjoorPersonRelations"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPersonRelationEditSuggestion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Action") + .HasColumnType("int"); + + b.Property("Date") + .HasColumnType("datetime2"); + + b.Property("ExistingAffiliationId") + .HasColumnType("int"); + + b.Property("ExistingRelationId") + .HasColumnType("int"); + + b.Property("Kind") + .HasColumnType("int"); + + b.Property("Person1Id") + .HasColumnType("int"); + + b.Property("Person2Id") + .HasColumnType("int"); + + b.Property("Result") + .HasColumnType("int"); + + b.Property("ReviewDate") + .HasColumnType("datetime2"); + + b.Property("ReviewNote") + .HasColumnType("nvarchar(max)"); + + b.Property("Reviewed") + .HasColumnType("bit"); + + b.Property("ReviewerUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("SuggestedAffiliationType") + .HasColumnType("int"); + + b.Property("SuggestedDegreeHint") + .HasColumnType("int"); + + b.Property("SuggestedNote") + .HasColumnType("nvarchar(max)"); + + b.Property("SuggestedRelationType") + .HasColumnType("int"); + + b.Property("SuggestionNote") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("ExistingAffiliationId"); + + b.HasIndex("ExistingRelationId"); + + b.HasIndex("Person1Id"); + + b.HasIndex("Person2Id"); + + b.HasIndex("ReviewerUserId"); + + b.HasIndex("UserId"); + + b.ToTable("GanjoorPersonRelationEditSuggestions"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPoem", b => + { + b.Property("Id") + .HasColumnType("int"); + + b.Property("CatId") + .HasColumnType("int"); + + b.Property("ClaimedByMultiplePoets") + .HasColumnType("bit"); + + b.Property("FullTitle") + .HasMaxLength(1500) + .HasColumnType("nvarchar(1500)"); + + b.Property("FullUrl") + .HasColumnType("nvarchar(450)"); + + b.Property("GanjoorMetreId") + .HasColumnType("int"); + + b.Property("HtmlText") + .HasColumnType("nvarchar(max)"); + + b.Property("Language") + .HasMaxLength(8) + .HasColumnType("nvarchar(8)"); + + b.Property("MixedModeOrder") + .HasColumnType("int"); + + b.Property("OldTag") + .HasMaxLength(16) + .HasColumnType("nvarchar(16)"); + + b.Property("OldTagPageUrl") + .HasMaxLength(32) + .HasColumnType("nvarchar(32)"); + + b.Property("PlainText") + .HasColumnType("nvarchar(max)"); + + b.Property("PoemSummary") + .HasMaxLength(3000) + .HasColumnType("nvarchar(3000)"); + + b.Property("Published") + .HasColumnType("bit"); + + b.Property("RhymeLetters") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SourceName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SourceUrlSlug") + .HasMaxLength(16) + .HasColumnType("nvarchar(16)"); + + b.Property("Title") + .HasMaxLength(1500) + .HasColumnType("nvarchar(1500)"); + + b.Property("UrlSlug") + .HasMaxLength(32) + .HasColumnType("nvarchar(32)"); + + b.HasKey("Id"); + + b.HasIndex("CatId"); + + b.HasIndex("FullUrl"); + + b.HasIndex("GanjoorMetreId"); + + b.HasIndex("Id"); + + b.ToTable("GanjoorPoems"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPoemCorrection", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AffectedThePoem") + .HasColumnType("bit"); + + b.Property("ApplicationOrder") + .HasColumnType("int"); + + b.Property("Date") + .HasColumnType("datetime2"); + + b.Property("HideMyName") + .HasColumnType("bit"); + + b.Property("Language") + .HasColumnType("nvarchar(max)"); + + b.Property("LanguageReviewResult") + .HasColumnType("int"); + + b.Property("Note") + .HasColumnType("nvarchar(max)"); + + b.Property("OriginalLanguage") + .HasColumnType("nvarchar(max)"); + + b.Property("OriginalPoemFormat") + .HasColumnType("int"); + + b.Property("OriginalPoemSummary") + .HasColumnType("nvarchar(max)"); + + b.Property("OriginalRhymeLetters") + .HasColumnType("nvarchar(max)"); + + b.Property("OriginalRhythm") + .HasColumnType("nvarchar(max)"); + + b.Property("OriginalRhythm2") + .HasColumnType("nvarchar(max)"); + + b.Property("OriginalRhythm3") + .HasColumnType("nvarchar(max)"); + + b.Property("OriginalRhythm4") + .HasColumnType("nvarchar(max)"); + + b.Property("OriginalTitle") + .HasColumnType("nvarchar(max)"); + + b.Property("PoemFormat") + .HasColumnType("int"); + + b.Property("PoemFormatReviewResult") + .HasColumnType("int"); + + b.Property("PoemId") + .HasColumnType("int"); + + b.Property("PoemSummary") + .HasColumnType("nvarchar(max)"); + + b.Property("Result") + .HasColumnType("int"); + + b.Property("ReviewDate") + .HasColumnType("datetime2"); + + b.Property("ReviewNote") + .HasColumnType("nvarchar(max)"); + + b.Property("Reviewed") + .HasColumnType("bit"); + + b.Property("ReviewerUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("RhymeLetters") + .HasColumnType("nvarchar(max)"); + + b.Property("RhymeLettersReviewResult") + .HasColumnType("int"); + + b.Property("Rhythm") + .HasColumnType("nvarchar(max)"); + + b.Property("Rhythm2") + .HasColumnType("nvarchar(max)"); + + b.Property("Rhythm2Result") + .HasColumnType("int"); + + b.Property("Rhythm3") + .HasColumnType("nvarchar(max)"); + + b.Property("Rhythm3Result") + .HasColumnType("int"); + + b.Property("Rhythm4") + .HasColumnType("nvarchar(max)"); + + b.Property("Rhythm4Result") + .HasColumnType("int"); + + b.Property("RhythmResult") + .HasColumnType("int"); + + b.Property("SummaryReviewResult") + .HasColumnType("int"); + + b.Property("Title") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("PoemId"); + + b.HasIndex("ReviewerUserId"); + + b.HasIndex("UserId"); + + b.ToTable("GanjoorPoemCorrections"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPoemGeoDateTagCorrection", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CoupletIndex") + .HasColumnType("int"); + + b.Property("ExistingTagId") + .HasColumnType("int"); + + b.Property("GanjoorPoemCorrectionId") + .HasColumnType("int"); + + b.Property("IgnoreInCategory") + .HasColumnType("bit"); + + b.Property("LocationId") + .HasColumnType("int"); + + b.Property("LunarDay") + .HasColumnType("int"); + + b.Property("LunarMonth") + .HasColumnType("int"); + + b.Property("LunarYear") + .HasColumnType("int"); + + b.Property("MarkForDelete") + .HasColumnType("bit"); + + b.Property("PersonId") + .HasColumnType("int"); + + b.Property("Result") + .HasColumnType("int"); + + b.Property("ReviewNote") + .HasColumnType("nvarchar(max)"); + + b.Property("SuggestedLatitude") + .HasColumnType("float"); + + b.Property("SuggestedLocationName") + .HasColumnType("nvarchar(max)"); + + b.Property("SuggestedLongitude") + .HasColumnType("float"); + + b.Property("SuggestedPersonGraphJson") + .HasColumnType("nvarchar(max)"); + + b.Property("SuggestionNote") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("GanjoorPoemCorrectionId"); + + b.HasIndex("LocationId"); + + b.HasIndex("PersonId"); + + b.ToTable("GanjoorPoemGeoDateTagCorrection"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPoemProbableMetre", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Metre") + .HasColumnType("nvarchar(max)"); + + b.Property("PoemId") + .HasColumnType("int"); + + b.Property("SectionId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("PoemId"); + + b.ToTable("GanjoorPoemProbableMetres"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPoemSection", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CachedFirstCoupletIndex") + .HasColumnType("int"); + + b.Property("CoupletsCount") + .HasColumnType("int"); + + b.Property("GanjoorMetreId") + .HasColumnType("int"); + + b.Property("GanjoorMetreRefSectionIndex") + .HasColumnType("int"); + + b.Property("HtmlText") + .HasColumnType("nvarchar(max)"); + + b.Property("Index") + .HasColumnType("int"); + + b.Property("Language") + .HasColumnType("nvarchar(max)"); + + b.Property("Number") + .HasColumnType("int"); + + b.Property("PlainText") + .HasColumnType("nvarchar(max)"); + + b.Property("PoemFormat") + .HasColumnType("int"); + + b.Property("PoemId") + .HasColumnType("int"); + + b.Property("PoetId") + .HasColumnType("int"); + + b.Property("RhymeLetters") + .HasColumnType("nvarchar(450)"); + + b.Property("SectionType") + .HasColumnType("int"); + + b.Property("VerseType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("PoetId"); + + b.HasIndex("RhymeLetters"); + + b.HasIndex("GanjoorMetreId", "RhymeLetters"); + + b.HasIndex("PoemId", "Index"); + + b.HasIndex("GanjoorMetreId", "RhymeLetters", "Id"); + + b.HasIndex("GanjoorMetreId", "RhymeLetters", "SectionType"); + + b.ToTable("GanjoorPoemSections"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPoemSectionCorrection", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AffectedThePoem") + .HasColumnType("bit"); + + b.Property("ApplicationOrder") + .HasColumnType("int"); + + b.Property("BreakFromVerse10VOrder") + .HasColumnType("int"); + + b.Property("BreakFromVerse10VOrderResult") + .HasColumnType("int"); + + b.Property("BreakFromVerse1VOrder") + .HasColumnType("int"); + + b.Property("BreakFromVerse1VOrderResult") + .HasColumnType("int"); + + b.Property("BreakFromVerse2VOrder") + .HasColumnType("int"); + + b.Property("BreakFromVerse2VOrderResult") + .HasColumnType("int"); + + b.Property("BreakFromVerse3VOrder") + .HasColumnType("int"); + + b.Property("BreakFromVerse3VOrderResult") + .HasColumnType("int"); + + b.Property("BreakFromVerse4VOrder") + .HasColumnType("int"); + + b.Property("BreakFromVerse4VOrderResult") + .HasColumnType("int"); + + b.Property("BreakFromVerse5VOrder") + .HasColumnType("int"); + + b.Property("BreakFromVerse5VOrderResult") + .HasColumnType("int"); + + b.Property("BreakFromVerse6VOrder") + .HasColumnType("int"); + + b.Property("BreakFromVerse6VOrderResult") + .HasColumnType("int"); + + b.Property("BreakFromVerse7VOrder") + .HasColumnType("int"); + + b.Property("BreakFromVerse7VOrderResult") + .HasColumnType("int"); + + b.Property("BreakFromVerse8VOrder") + .HasColumnType("int"); + + b.Property("BreakFromVerse8VOrderResult") + .HasColumnType("int"); + + b.Property("BreakFromVerse9VOrder") + .HasColumnType("int"); + + b.Property("BreakFromVerse9VOrderResult") + .HasColumnType("int"); + + b.Property("Date") + .HasColumnType("datetime2"); + + b.Property("HideMyName") + .HasColumnType("bit"); + + b.Property("Language") + .HasColumnType("nvarchar(max)"); + + b.Property("LanguageReviewResult") + .HasColumnType("int"); + + b.Property("Note") + .HasColumnType("nvarchar(max)"); + + b.Property("OriginalLanguage") + .HasColumnType("nvarchar(max)"); + + b.Property("OriginalPoemFormat") + .HasColumnType("int"); + + b.Property("OriginalRhymeLetters") + .HasColumnType("nvarchar(max)"); + + b.Property("OriginalRhythm") + .HasColumnType("nvarchar(max)"); + + b.Property("OriginalRhythm2") + .HasColumnType("nvarchar(max)"); + + b.Property("PoemFormat") + .HasColumnType("int"); + + b.Property("PoemFormatReviewResult") + .HasColumnType("int"); + + b.Property("ReviewDate") + .HasColumnType("datetime2"); + + b.Property("ReviewNote") + .HasColumnType("nvarchar(max)"); + + b.Property("Reviewed") + .HasColumnType("bit"); + + b.Property("ReviewerUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("RhymeLetters") + .HasColumnType("nvarchar(max)"); + + b.Property("RhymeLettersReviewResult") + .HasColumnType("int"); + + b.Property("Rhythm") + .HasColumnType("nvarchar(max)"); + + b.Property("Rhythm2") + .HasColumnType("nvarchar(max)"); + + b.Property("RhythmResult") + .HasColumnType("int"); + + b.Property("RhythmResult2") + .HasColumnType("int"); + + b.Property("SectionId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("ReviewerUserId"); + + b.HasIndex("SectionId"); + + b.HasIndex("UserId"); + + b.ToTable("GanjoorPoemSectionCorrections"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPoet", b => + { + b.Property("Id") + .HasColumnType("int"); + + b.Property("BirthLocationId") + .HasColumnType("int"); + + b.Property("BirthYearInLHijri") + .HasColumnType("int"); + + b.Property("DeathLocationId") + .HasColumnType("int"); + + b.Property("DeathYearInLHijri") + .HasColumnType("int"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("Nickname") + .HasColumnType("nvarchar(max)"); + + b.Property("PinOrder") + .HasColumnType("int"); + + b.Property("Published") + .HasColumnType("bit"); + + b.Property("RImageId") + .HasColumnType("uniqueidentifier"); + + b.Property("ValidBirthDate") + .HasColumnType("bit"); + + b.Property("ValidDeathDate") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("BirthLocationId"); + + b.HasIndex("DeathLocationId"); + + b.HasIndex("RImageId"); + + b.HasIndex("Published", "Id"); + + SqlServerIndexBuilderExtensions.IncludeProperties(b.HasIndex("Published", "Id"), new[] { "Name", "Nickname", "RImageId" }); + + b.ToTable("GanjoorPoets"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPoetSuggestedPicture", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ChosenOne") + .HasColumnType("bit"); + + b.Property("PicOrder") + .HasColumnType("int"); + + b.Property("PictureId") + .HasColumnType("uniqueidentifier"); + + b.Property("PoetId") + .HasColumnType("int"); + + b.Property("PublicationDate") + .HasColumnType("datetime2"); + + b.Property("Published") + .HasColumnType("bit"); + + b.Property("SuggestedById") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("PictureId"); + + b.HasIndex("PoetId"); + + b.HasIndex("SuggestedById"); + + b.ToTable("GanjoorPoetSuggestedPictures"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPoetSuggestedSpecLine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Contents") + .HasColumnType("nvarchar(max)"); + + b.Property("LineOrder") + .HasColumnType("int"); + + b.Property("PoetId") + .HasColumnType("int"); + + b.Property("PublicationDate") + .HasColumnType("datetime2"); + + b.Property("Published") + .HasColumnType("bit"); + + b.Property("SuggestedById") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("PoetId"); + + b.HasIndex("SuggestedById"); + + b.ToTable("GanjoorPoetSuggestedSpecLines"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorQuotedPoem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CachedRelatedPoemFullTitle") + .HasColumnType("nvarchar(max)"); + + b.Property("CachedRelatedPoemFullUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("CachedRelatedPoemPoetDeathYearInLHijri") + .HasColumnType("int"); + + b.Property("CachedRelatedPoemPoetImage") + .HasColumnType("nvarchar(max)"); + + b.Property("CachedRelatedPoemPoetName") + .HasColumnType("nvarchar(max)"); + + b.Property("CachedRelatedPoemPoetUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("ChosenForMainList") + .HasColumnType("bit"); + + b.Property("ClaimedByBothPoets") + .HasColumnType("bit"); + + b.Property("CoupletIndex") + .HasColumnType("int"); + + b.Property("CoupletVerse1") + .HasColumnType("nvarchar(max)"); + + b.Property("CoupletVerse1ShouldBeEmphasized") + .HasColumnType("bit"); + + b.Property("CoupletVerse2") + .HasColumnType("nvarchar(max)"); + + b.Property("CoupletVerse2ShouldBeEmphasized") + .HasColumnType("bit"); + + b.Property("IndirectQuotation") + .HasColumnType("bit"); + + b.Property("IsPriorToRelated") + .HasColumnType("bit"); + + b.Property("Note") + .HasColumnType("nvarchar(max)"); + + b.Property("PoemId") + .HasColumnType("int"); + + b.Property("PoetId") + .HasColumnType("int"); + + b.Property("Published") + .HasColumnType("bit"); + + b.Property("Rejected") + .HasColumnType("bit"); + + b.Property("RelatedCoupletIndex") + .HasColumnType("int"); + + b.Property("RelatedCoupletVerse1") + .HasColumnType("nvarchar(max)"); + + b.Property("RelatedCoupletVerse1ShouldBeEmphasized") + .HasColumnType("bit"); + + b.Property("RelatedCoupletVerse2") + .HasColumnType("nvarchar(max)"); + + b.Property("RelatedCoupletVerse2ShouldBeEmphasized") + .HasColumnType("bit"); + + b.Property("RelatedPoemId") + .HasColumnType("int"); + + b.Property("RelatedPoetId") + .HasColumnType("int"); + + b.Property("ReviewDate") + .HasColumnType("datetime2"); + + b.Property("ReviewNote") + .HasColumnType("nvarchar(max)"); + + b.Property("ReviewerUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("SamePoemsQuotedCount") + .HasColumnType("int"); + + b.Property("SortOrder") + .HasColumnType("int"); + + b.Property("SuggestedById") + .HasColumnType("uniqueidentifier"); + + b.Property("SuggestionDate") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.HasIndex("PoemId"); + + b.HasIndex("ReviewerUserId"); + + b.HasIndex("SuggestedById"); + + b.ToTable("GanjoorQuotedPoems"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorRelatedPerson", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("BirthLocationId") + .HasColumnType("int"); + + b.Property("BirthYearInLHijri") + .HasColumnType("int"); + + b.Property("DeathLocationId") + .HasColumnType("int"); + + b.Property("DeathYearInLHijri") + .HasColumnType("int"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("FamilyTreeCaption") + .HasColumnType("nvarchar(max)"); + + b.Property("Gender") + .HasColumnType("int"); + + b.Property("Importance") + .HasColumnType("int"); + + b.Property("MachineGenerated") + .HasColumnType("bit"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("ValidBirthDate") + .HasColumnType("bit"); + + b.Property("ValidDeathDate") + .HasColumnType("bit"); + + b.Property("WikiUrl") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("BirthLocationId"); + + b.HasIndex("DeathLocationId"); + + b.ToTable("GanjoorRelatedPersons"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorSiteBanner", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("AlternateText") + .HasColumnType("nvarchar(max)"); + + b.Property("RImageId") + .HasColumnType("uniqueidentifier"); + + b.Property("TargetUrl") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("RImageId"); + + b.ToTable("GanjoorSiteBanners"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorTajikCat", b => + { + b.Property("Id") + .HasColumnType("int"); + + b.Property("PoetId") + .HasColumnType("int"); + + b.Property("TajikDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("TajikTitle") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("PoetId"); + + b.ToTable("TajikCats"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorTajikPage", b => + { + b.Property("Id") + .HasColumnType("int"); + + b.Property("TajikHtmlText") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("TajikPages"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorTajikPoem", b => + { + b.Property("Id") + .HasColumnType("int"); + + b.Property("CatId") + .HasColumnType("int"); + + b.Property("FullTitle") + .HasColumnType("nvarchar(max)"); + + b.Property("FullUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("TajikPlainText") + .HasColumnType("nvarchar(max)"); + + b.Property("TajikTitle") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("CatId"); + + b.ToTable("TajikPoems"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorTajikPoet", b => + { + b.Property("Id") + .HasColumnType("int"); + + b.Property("BirthYearInLHijri") + .HasColumnType("int"); + + b.Property("TajikDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("TajikNickname") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("TajikPoets"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorTajikVerse", b => + { + b.Property("Id") + .HasColumnType("int"); + + b.Property("PoemId") + .HasColumnType("int"); + + b.Property("TajikText") + .HasColumnType("nvarchar(max)"); + + b.Property("VOrder") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("TajikVerses"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorUserBookmark", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CoupletIndex") + .HasColumnType("int"); + + b.Property("DateTime") + .HasColumnType("datetime2"); + + b.Property("PoemId") + .HasColumnType("int"); + + b.Property("PrivateNote") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("Verse2Id") + .HasColumnType("int"); + + b.Property("VerseId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("PoemId"); + + b.HasIndex("UserId", "PoemId", "CoupletIndex"); + + b.ToTable("GanjoorUserBookmarks"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorUserPoemVisit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Counter") + .HasColumnType("int"); + + b.Property("DateTime") + .HasColumnType("datetime2"); + + b.Property("PoemId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("PoemId"); + + b.HasIndex("UserId"); + + b.HasIndex("UserId", "PoemId"); + + b.ToTable("GanjoorUserPoemVisits"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorVerse", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CoupletIndex") + .HasColumnType("int"); + + b.Property("CoupletSummary") + .HasMaxLength(4000) + .HasColumnType("nvarchar(4000)"); + + b.Property("LanguageId") + .HasColumnType("int"); + + b.Property("PoemId") + .HasColumnType("int"); + + b.Property("SectionIndex1") + .HasColumnType("int"); + + b.Property("SectionIndex2") + .HasColumnType("int"); + + b.Property("SectionIndex3") + .HasColumnType("int"); + + b.Property("SectionIndex4") + .HasColumnType("int"); + + b.Property("Text") + .HasColumnType("nvarchar(max)"); + + b.Property("VOrder") + .HasColumnType("int"); + + b.Property("VersePosition") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LanguageId"); + + b.HasIndex("PoemId"); + + b.HasIndex("PoemId", "CoupletIndex"); + + b.ToTable("GanjoorVerses"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorVerseNumber", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CoupletIndex") + .HasColumnType("int"); + + b.Property("IsPoemVerse") + .HasColumnType("bit"); + + b.Property("Number") + .HasColumnType("int"); + + b.Property("NumberingId") + .HasColumnType("int"); + + b.Property("PoemId") + .HasColumnType("int"); + + b.Property("SameTypeNumber") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("PoemId", "CoupletIndex"); + + b.HasIndex("NumberingId", "PoemId", "CoupletIndex") + .IsUnique(); + + b.ToTable("GanjoorVerseNumbers"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorVerseVOrderText", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CoupletIndex") + .HasColumnType("int"); + + b.Property("CoupletSummary") + .HasColumnType("nvarchar(max)"); + + b.Property("GanjoorPoemCorrectionId") + .HasColumnType("int"); + + b.Property("LanguageId") + .HasColumnType("int"); + + b.Property("LanguageReviewResult") + .HasColumnType("int"); + + b.Property("MarkForDelete") + .HasColumnType("bit"); + + b.Property("MarkForDeleteResult") + .HasColumnType("int"); + + b.Property("NewVerse") + .HasColumnType("bit"); + + b.Property("NewVerseResult") + .HasColumnType("int"); + + b.Property("OriginalCoupletSummary") + .HasColumnType("nvarchar(max)"); + + b.Property("OriginalLanguageId") + .HasColumnType("int"); + + b.Property("OriginalText") + .HasColumnType("nvarchar(max)"); + + b.Property("OriginalVersePosition") + .HasColumnType("int"); + + b.Property("Result") + .HasColumnType("int"); + + b.Property("ReviewNote") + .HasColumnType("nvarchar(max)"); + + b.Property("SummaryReviewResult") + .HasColumnType("int"); + + b.Property("Text") + .HasColumnType("nvarchar(max)"); + + b.Property("VORder") + .HasColumnType("int"); + + b.Property("VersePosition") + .HasColumnType("int"); + + b.Property("VersePositionResult") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("GanjoorPoemCorrectionId"); + + b.ToTable("GanjoorVerseVOrderText"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.PoemGeoDateTag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CoupletIndex") + .HasColumnType("int"); + + b.Property("IgnoreInCategory") + .HasColumnType("bit"); + + b.Property("LocationId") + .HasColumnType("int"); + + b.Property("LunarDateTotalNumber") + .HasColumnType("int"); + + b.Property("LunarDay") + .HasColumnType("int"); + + b.Property("LunarMonth") + .HasColumnType("int"); + + b.Property("LunarYear") + .HasColumnType("int"); + + b.Property("MachineGenerated") + .HasColumnType("bit"); + + b.Property("Note") + .HasColumnType("nvarchar(max)"); + + b.Property("PersonId") + .HasColumnType("int"); + + b.Property("PoemId") + .HasColumnType("int"); + + b.Property("VerifiedDate") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("LocationId"); + + b.HasIndex("PersonId"); + + b.HasIndex("PoemId"); + + b.ToTable("PoemGeoDateTags"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.PoemMusicTrack", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AlbumName") + .HasColumnType("nvarchar(max)"); + + b.Property("AlbumUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("ApprovalDate") + .HasColumnType("datetime2"); + + b.Property("Approved") + .HasColumnType("bit"); + + b.Property("ArtistName") + .HasColumnType("nvarchar(max)"); + + b.Property("ArtistUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("BrokenLink") + .HasColumnType("bit"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("GanjoorTrackId") + .HasColumnType("int"); + + b.Property("GolhaTrackId") + .HasColumnType("int"); + + b.Property("PoemId") + .HasColumnType("int"); + + b.Property("Rejected") + .HasColumnType("bit"); + + b.Property("RejectionCause") + .HasColumnType("nvarchar(max)"); + + b.Property("SingerId") + .HasColumnType("int"); + + b.Property("SongOrder") + .HasColumnType("int"); + + b.Property("SuggestedById") + .HasColumnType("uniqueidentifier"); + + b.Property("TrackName") + .HasColumnType("nvarchar(max)"); + + b.Property("TrackType") + .HasColumnType("int"); + + b.Property("TrackUrl") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("GanjoorTrackId"); + + b.HasIndex("GolhaTrackId"); + + b.HasIndex("PoemId"); + + b.HasIndex("SingerId"); + + b.HasIndex("SuggestedById"); + + b.HasIndex("Approved", "Rejected"); + + b.ToTable("GanjoorPoemMusicTracks"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.SemanticSearch.SemanticSearchQueryLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ClickedAtUtc") + .HasColumnType("datetime2"); + + b.Property("ClickedPoemId") + .HasColumnType("int"); + + b.Property("ClickedResultRank") + .HasColumnType("int"); + + b.Property("DateTimeUtc") + .HasColumnType("datetime2"); + + b.Property("DetectedCategoryName") + .HasColumnType("nvarchar(max)"); + + b.Property("DetectedPoetName") + .HasColumnType("nvarchar(max)"); + + b.Property("Query") + .HasColumnType("nvarchar(max)"); + + b.Property("RequestedTopK") + .HasColumnType("int"); + + b.Property("ResultCount") + .HasColumnType("int"); + + b.Property("ScopeDetected") + .HasColumnType("bit"); + + b.Property("ScopeDetectionDisabled") + .HasColumnType("bit"); + + b.Property("TopResultScore") + .HasColumnType("real"); + + b.HasKey("Id"); + + b.ToTable("SemanticSearchQueryLogs"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.UpdatingRelSectsLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("DateTime") + .HasColumnType("datetime2"); + + b.Property("MeterId") + .HasColumnType("int"); + + b.Property("RhymeLettes") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("UpdatingRelSectsLogs"); + }); + + modelBuilder.Entity("RMuseum.Models.GanjoorAudio.Recitation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AudioArtist") + .HasColumnType("nvarchar(max)"); + + b.Property("AudioArtistUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("AudioOrder") + .HasColumnType("int"); + + b.Property("AudioSrc") + .HasColumnType("nvarchar(max)"); + + b.Property("AudioSrcUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("AudioSyncStatus") + .HasColumnType("int"); + + b.Property("AudioTitle") + .HasColumnType("nvarchar(max)"); + + b.Property("FileLastUpdated") + .HasColumnType("datetime2"); + + b.Property("FileNameWithoutExtension") + .HasColumnType("nvarchar(max)"); + + b.Property("GanjoorAudioId") + .HasColumnType("int"); + + b.Property("GanjoorPostId") + .HasColumnType("int"); + + b.Property("InSyncWithText") + .HasColumnType("bit"); + + b.Property("InitialScore") + .HasColumnType("int"); + + b.Property("LegacyAudioGuid") + .HasColumnType("uniqueidentifier"); + + b.Property("LocalMp3FilePath") + .HasColumnType("nvarchar(max)"); + + b.Property("LocalXmlFilePath") + .HasColumnType("nvarchar(max)"); + + b.Property("Mp3FileCheckSum") + .HasColumnType("nvarchar(max)"); + + b.Property("Mp3SizeInBytes") + .HasColumnType("int"); + + b.Property("OggSizeInBytes") + .HasColumnType("int"); + + b.Property("OwnerId") + .HasColumnType("uniqueidentifier"); + + b.Property("RecitationType") + .HasColumnType("int"); + + b.Property("ReviewDate") + .HasColumnType("datetime2"); + + b.Property("ReviewMsg") + .HasColumnType("nvarchar(max)"); + + b.Property("ReviewStatus") + .HasColumnType("int"); + + b.Property("ReviewerId") + .HasColumnType("uniqueidentifier"); + + b.Property("SoundFilesFolder") + .HasColumnType("nvarchar(max)"); + + b.Property("UploadDate") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.HasIndex("GanjoorAudioId"); + + b.HasIndex("GanjoorPostId"); + + b.HasIndex("OwnerId"); + + b.HasIndex("ReviewerId"); + + b.HasIndex("ReviewStatus", "GanjoorPostId"); + + b.ToTable("Recitations"); + }); + + modelBuilder.Entity("RMuseum.Models.GanjoorAudio.RecitationApprovedMistake", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CoupletIndex") + .HasColumnType("int"); + + b.Property("Mistake") + .HasColumnType("nvarchar(max)"); + + b.Property("NumberOfLinesAffected") + .HasColumnType("int"); + + b.Property("RecitationId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RecitationId"); + + b.ToTable("RecitationApprovedMistakes"); + }); + + modelBuilder.Entity("RMuseum.Models.GanjoorAudio.RecitationErrorReport", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CoupletIndex") + .HasColumnType("int"); + + b.Property("DateTime") + .HasColumnType("datetime2"); + + b.Property("NumberOfLinesAffected") + .HasColumnType("int"); + + b.Property("ReasonText") + .HasColumnType("nvarchar(max)"); + + b.Property("RecitationId") + .HasColumnType("int"); + + b.Property("ReporterId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RecitationId"); + + b.HasIndex("ReporterId"); + + b.ToTable("RecitationErrorReports"); + }); + + modelBuilder.Entity("RMuseum.Models.GanjoorAudio.RecitationPublishingTracker", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("FinishDate") + .HasColumnType("datetime2"); + + b.Property("Finished") + .HasColumnType("bit"); + + b.Property("FirstDbUpdated") + .HasColumnType("bit"); + + b.Property("LastException") + .HasColumnType("nvarchar(max)"); + + b.Property("Mp3FileCopied") + .HasColumnType("bit"); + + b.Property("PoemNarrationId") + .HasColumnType("int"); + + b.Property("SecondDbUpdated") + .HasColumnType("bit"); + + b.Property("StartDate") + .HasColumnType("datetime2"); + + b.Property("XmlFileCopied") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("PoemNarrationId"); + + b.ToTable("RecitationPublishingTrackers"); + }); + + modelBuilder.Entity("RMuseum.Models.GanjoorAudio.RecitationUserUpVote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DateTime") + .HasColumnType("datetime2"); + + b.Property("RecitationId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.HasIndex("RecitationId", "UserId") + .IsUnique() + .HasFilter("[UserId] IS NOT NULL"); + + b.ToTable("RecitationUserUpVotes"); + }); + + modelBuilder.Entity("RMuseum.Models.GanjoorAudio.UserRecitationProfile", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ArtistName") + .HasColumnType("nvarchar(max)"); + + b.Property("ArtistUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("AudioSrc") + .HasColumnType("nvarchar(max)"); + + b.Property("AudioSrcUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("FileSuffixWithoutDash") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDefault") + .HasColumnType("bit"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("UserRecitationProfiles"); + }); + + modelBuilder.Entity("RMuseum.Models.GanjoorIntegration.GanjoorLink", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ArtifactId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayOnPage") + .HasColumnType("bit"); + + b.Property("GanjoorPostId") + .HasColumnType("int"); + + b.Property("GanjoorTitle") + .HasColumnType("nvarchar(max)"); + + b.Property("GanjoorUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("IsTextOriginalSource") + .HasColumnType("bit"); + + b.Property("ItemId") + .HasColumnType("uniqueidentifier"); + + b.Property("LinkToOriginalSource") + .HasColumnType("bit"); + + b.Property("OriginalSourceUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("ReviewDate") + .HasColumnType("datetime2"); + + b.Property("ReviewResult") + .HasColumnType("int"); + + b.Property("ReviewerId") + .HasColumnType("uniqueidentifier"); + + b.Property("SuggestedById") + .HasColumnType("uniqueidentifier"); + + b.Property("SuggestionDate") + .HasColumnType("datetime2"); + + b.Property("Synchronized") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("ArtifactId"); + + b.HasIndex("ItemId"); + + b.HasIndex("ReviewerId"); + + b.HasIndex("SuggestedById"); + + b.ToTable("GanjoorLinks"); + }); + + modelBuilder.Entity("RMuseum.Models.GanjoorIntegration.GanjoorPaperSource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BookFullTitle") + .HasColumnType("nvarchar(max)"); + + b.Property("BookFullUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("BookType") + .HasColumnType("int"); + + b.Property("CoverThumbnailImageUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("GanjoorCatFullTitle") + .HasColumnType("nvarchar(max)"); + + b.Property("GanjoorCatFullUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("GanjoorCatId") + .HasColumnType("int"); + + b.Property("GanjoorPoetId") + .HasColumnType("int"); + + b.Property("HumanReviewed") + .HasColumnType("bit"); + + b.Property("IsTextOriginalSource") + .HasColumnType("bit"); + + b.Property("MatchPercent") + .HasColumnType("int"); + + b.Property("NaskbanBookId") + .HasColumnType("int"); + + b.Property("OrderIndicator") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("GanjoorPaperSources"); + }); + + modelBuilder.Entity("RMuseum.Models.GanjoorIntegration.PDFGanjoorLink", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ExternalThumbnailImageUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("GanjoorPostId") + .HasColumnType("int"); + + b.Property("GanjoorTitle") + .HasColumnType("nvarchar(max)"); + + b.Property("GanjoorUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("IsTextOriginalSource") + .HasColumnType("bit"); + + b.Property("PDFBookId") + .HasColumnType("int"); + + b.Property("PDFPageTitle") + .HasColumnType("nvarchar(max)"); + + b.Property("PageNumber") + .HasColumnType("int"); + + b.Property("ReviewDate") + .HasColumnType("datetime2"); + + b.Property("ReviewResult") + .HasColumnType("int"); + + b.Property("ReviewerId") + .HasColumnType("uniqueidentifier"); + + b.Property("SuggestedById") + .HasColumnType("uniqueidentifier"); + + b.Property("SuggestedByMachine") + .HasColumnType("bit"); + + b.Property("SuggestionDate") + .HasColumnType("datetime2"); + + b.Property("Synchronized") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("ReviewerId"); + + b.HasIndex("SuggestedById"); + + b.ToTable("PDFGanjoorLinks"); + }); + + modelBuilder.Entity("RMuseum.Models.GanjoorIntegration.PinterestLink", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AltText") + .HasColumnType("nvarchar(max)"); + + b.Property("ArtifactId") + .HasColumnType("uniqueidentifier"); + + b.Property("GanjoorPostId") + .HasColumnType("int"); + + b.Property("GanjoorTitle") + .HasColumnType("nvarchar(max)"); + + b.Property("GanjoorUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("HumanReviewed") + .HasColumnType("bit"); + + b.Property("IsTextOriginalSource") + .HasColumnType("bit"); + + b.Property("ItemId") + .HasColumnType("uniqueidentifier"); + + b.Property("LinkType") + .HasColumnType("int"); + + b.Property("MatchPercent") + .HasColumnType("int"); + + b.Property("NaskbanLinkId") + .HasColumnType("uniqueidentifier"); + + b.Property("PDFBookId") + .HasColumnType("int"); + + b.Property("PageNumber") + .HasColumnType("int"); + + b.Property("PinterestImageUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("PinterestUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("ReviewDate") + .HasColumnType("datetime2"); + + b.Property("ReviewDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("ReviewResult") + .HasColumnType("int"); + + b.Property("ReviewerId") + .HasColumnType("uniqueidentifier"); + + b.Property("SuggestedById") + .HasColumnType("uniqueidentifier"); + + b.Property("SuggestionDate") + .HasColumnType("datetime2"); + + b.Property("Synchronized") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("ArtifactId"); + + b.HasIndex("ItemId"); + + b.HasIndex("ReviewerId"); + + b.HasIndex("SuggestedById"); + + b.ToTable("PinterestLinks"); + }); + + modelBuilder.Entity("RMuseum.Models.ImportJob.ImportJob", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ArtifactId") + .HasColumnType("uniqueidentifier"); + + b.Property("EndTime") + .HasColumnType("datetime2"); + + b.Property("Exception") + .HasColumnType("nvarchar(max)"); + + b.Property("FriendlyUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("JobType") + .HasColumnType("int"); + + b.Property("ProgressPercent") + .HasColumnType("decimal(18,2)"); + + b.Property("QueueTime") + .HasColumnType("datetime2"); + + b.Property("ResourceNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("SrcContent") + .HasColumnType("nvarchar(max)"); + + b.Property("SrcUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("StartTime") + .HasColumnType("datetime2"); + + b.Property("Status") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ArtifactId"); + + b.ToTable("ImportJobs"); + }); + + modelBuilder.Entity("RMuseum.Models.MusicCatalogue.GanjoorAlbum", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("SingerId") + .HasColumnType("int"); + + b.Property("Url") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("SingerId"); + + b.ToTable("GanjoorAlbum"); + }); + + modelBuilder.Entity("RMuseum.Models.MusicCatalogue.GanjoorSinger", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Name") + .HasColumnType("nvarchar(450)"); + + b.Property("RImageId") + .HasColumnType("uniqueidentifier"); + + b.Property("Url") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.HasIndex("RImageId"); + + b.ToTable("GanjoorSingers"); + }); + + modelBuilder.Entity("RMuseum.Models.MusicCatalogue.GanjoorTrack", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AlbumId") + .HasColumnType("int"); + + b.Property("BlockReason") + .HasColumnType("nvarchar(max)"); + + b.Property("Blocked") + .HasColumnType("bit"); + + b.Property("Name") + .HasColumnType("nvarchar(450)"); + + b.Property("Url") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("AlbumId"); + + b.HasIndex("Name"); + + b.ToTable("GanjoorMusicCatalogueTracks"); + }); + + modelBuilder.Entity("RMuseum.Models.MusicCatalogue.GolhaCollection", b => + { + b.Property("Id") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("GolhaCollections"); + }); + + modelBuilder.Entity("RMuseum.Models.MusicCatalogue.GolhaProgram", b => + { + b.Property("Id") + .HasColumnType("int"); + + b.Property("GolhaCollectionId") + .HasColumnType("int"); + + b.Property("Mp3") + .HasColumnType("nvarchar(max)"); + + b.Property("ProgramOrder") + .HasColumnType("int"); + + b.Property("Title") + .HasColumnType("nvarchar(max)"); + + b.Property("Url") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("GolhaCollectionId"); + + b.ToTable("GolhaPrograms"); + }); + + modelBuilder.Entity("RMuseum.Models.MusicCatalogue.GolhaTrack", b => + { + b.Property("Id") + .HasColumnType("int"); + + b.Property("BlockReason") + .HasColumnType("nvarchar(max)"); + + b.Property("Blocked") + .HasColumnType("bit"); + + b.Property("GolhaProgramId") + .HasColumnType("int"); + + b.Property("SingerId") + .HasColumnType("int"); + + b.Property("Timing") + .HasColumnType("nvarchar(max)"); + + b.Property("Title") + .HasColumnType("nvarchar(max)"); + + b.Property("TrackNo") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("GolhaProgramId"); + + b.HasIndex("SingerId"); + + b.ToTable("GolhaTracks"); + }); + + modelBuilder.Entity("RMuseum.Models.Note.RUserNote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DateTime") + .HasColumnType("datetime2"); + + b.Property("HtmlContent") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModified") + .HasColumnType("datetime2"); + + b.Property("Modified") + .HasColumnType("bit"); + + b.Property("NoteType") + .HasColumnType("int"); + + b.Property("RAppUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("RArtifactItemRecordId") + .HasColumnType("uniqueidentifier"); + + b.Property("RArtifactMasterRecordId") + .HasColumnType("uniqueidentifier"); + + b.Property("ReferenceNoteId") + .HasColumnType("uniqueidentifier"); + + b.Property("Status") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RAppUserId"); + + b.HasIndex("RArtifactItemRecordId"); + + b.HasIndex("RArtifactMasterRecordId"); + + b.HasIndex("ReferenceNoteId"); + + b.ToTable("UserNotes"); + }); + + modelBuilder.Entity("RMuseum.Models.Note.RUserNoteAbuseReport", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("NoteId") + .HasColumnType("uniqueidentifier"); + + b.Property("ReasonText") + .HasColumnType("nvarchar(max)"); + + b.Property("ReporterId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("NoteId"); + + b.HasIndex("ReporterId"); + + b.ToTable("ReportedUserNotes"); + }); + + modelBuilder.Entity("RMuseum.Models.PDFLibrary.Author", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Bio") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtenalImageUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("ImageId") + .HasColumnType("uniqueidentifier"); + + b.Property("LastModified") + .HasColumnType("datetime2"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("NameInOriginalLanguage") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ImageId"); + + b.ToTable("Authors"); + }); + + modelBuilder.Entity("RMuseum.Models.PDFLibrary.AuthorRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AuthorId") + .HasColumnType("int"); + + b.Property("BookId") + .HasColumnType("int"); + + b.Property("PDFBookId") + .HasColumnType("int"); + + b.Property("Role") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("AuthorId"); + + b.HasIndex("BookId"); + + b.HasIndex("PDFBookId"); + + b.ToTable("AuthorRole"); + }); + + modelBuilder.Entity("RMuseum.Models.PDFLibrary.Book", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CoverImageId") + .HasColumnType("uniqueidentifier"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtenalCoverImageUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModified") + .HasColumnType("datetime2"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("CoverImageId"); + + b.ToTable("Books"); + }); + + modelBuilder.Entity("RMuseum.Models.PDFLibrary.MultiVolumePDFCollection", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("BookId") + .HasColumnType("int"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("VolumeCount") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("BookId"); + + b.ToTable("MultiVolumePDFCollections"); + }); + + modelBuilder.Entity("RMuseum.Models.PDFLibrary.OCRQueue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("PDFBookId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("OCRQueuedItems"); + }); + + modelBuilder.Entity("RMuseum.Models.PDFLibrary.PDFBook", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AuthorsLine") + .HasColumnType("nvarchar(max)"); + + b.Property("BookId") + .HasColumnType("int"); + + b.Property("BookScriptType") + .HasColumnType("int"); + + b.Property("BookText") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimedPageCount") + .HasColumnType("int"); + + b.Property("CoverImageId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtenalCoverImageUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("ExternalPDFFileUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("FileMD5CheckSum") + .HasColumnType("nvarchar(max)"); + + b.Property("ISBN") + .HasColumnType("nvarchar(max)"); + + b.Property("IsTranslation") + .HasColumnType("bit"); + + b.Property("Language") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModified") + .HasColumnType("datetime2"); + + b.Property("MultiVolumePDFCollectionId") + .HasColumnType("int"); + + b.Property("OCRTime") + .HasColumnType("datetime2"); + + b.Property("OCRed") + .HasColumnType("bit"); + + b.Property("OriginalFileName") + .HasColumnType("nvarchar(max)"); + + b.Property("OriginalFileUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("OriginalSourceName") + .HasColumnType("nvarchar(max)"); + + b.Property("OriginalSourceUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("PDFFileId") + .HasColumnType("uniqueidentifier"); + + b.Property("PDFSourceId") + .HasColumnType("int"); + + b.Property("PageCount") + .HasColumnType("int"); + + b.Property("PublisherLine") + .HasColumnType("nvarchar(max)"); + + b.Property("PublishingDate") + .HasColumnType("nvarchar(max)"); + + b.Property("PublishingLocation") + .HasColumnType("nvarchar(max)"); + + b.Property("PublishingNumber") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("StorageFolderName") + .HasColumnType("nvarchar(max)"); + + b.Property("SubTitle") + .HasColumnType("nvarchar(max)"); + + b.Property("Title") + .HasColumnType("nvarchar(max)"); + + b.Property("TitleInOriginalLanguage") + .HasColumnType("nvarchar(max)"); + + b.Property("TranslatorsLine") + .HasColumnType("nvarchar(max)"); + + b.Property("VolumeOrder") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("BookId"); + + b.HasIndex("CoverImageId"); + + b.HasIndex("MultiVolumePDFCollectionId"); + + b.HasIndex("PDFFileId"); + + b.HasIndex("PDFSourceId"); + + b.ToTable("PDFBooks"); + }); + + modelBuilder.Entity("RMuseum.Models.PDFLibrary.PDFPage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtenalThumbnailImageUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("FullResolutionImageHeight") + .HasColumnType("int"); + + b.Property("FullResolutionImageWidth") + .HasColumnType("int"); + + b.Property("LastModified") + .HasColumnType("datetime2"); + + b.Property("OCRTime") + .HasColumnType("datetime2"); + + b.Property("OCRed") + .HasColumnType("bit"); + + b.Property("PDFBookId") + .HasColumnType("int"); + + b.Property("PageNumber") + .HasColumnType("int"); + + b.Property("PageText") + .HasColumnType("nvarchar(max)"); + + b.Property("ThumbnailImageId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("PDFBookId"); + + b.HasIndex("ThumbnailImageId"); + + b.ToTable("PDFPages"); + }); + + modelBuilder.Entity("RMuseum.Models.PDFLibrary.PDFSource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("Url") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("PDFSources"); + }); + + modelBuilder.Entity("RMuseum.Models.PDFLibrary.QueuedPDFBook", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuthorsLine") + .HasColumnType("nvarchar(max)"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DownloadOrder") + .HasColumnType("int"); + + b.Property("IsTranslation") + .HasColumnType("bit"); + + b.Property("Language") + .HasColumnType("nvarchar(max)"); + + b.Property("OriginalFileUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("OriginalSourceName") + .HasColumnType("nvarchar(max)"); + + b.Property("OriginalSourceUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("ProcessResult") + .HasColumnType("nvarchar(max)"); + + b.Property("Processed") + .HasColumnType("bit"); + + b.Property("ResultId") + .HasColumnType("int"); + + b.Property("Title") + .HasColumnType("nvarchar(max)"); + + b.Property("TranslatorsLine") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("QueuedPDFBooks"); + }); + + modelBuilder.Entity("RMuseum.Models.UploadSession.UploadSession", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ProcessEndTime") + .HasColumnType("datetime2"); + + b.Property("ProcessProgress") + .HasColumnType("int"); + + b.Property("ProcessStartTime") + .HasColumnType("datetime2"); + + b.Property("SessionType") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("UploadEndTime") + .HasColumnType("datetime2"); + + b.Property("UploadStartTime") + .HasColumnType("datetime2"); + + b.Property("UseId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("UploadSessions"); + }); + + modelBuilder.Entity("RMuseum.Models.UploadSession.UploadSessionFile", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ContentDisposition") + .HasColumnType("nvarchar(max)"); + + b.Property("ContentType") + .HasColumnType("nvarchar(max)"); + + b.Property("FileName") + .HasColumnType("nvarchar(max)"); + + b.Property("FilePath") + .HasColumnType("nvarchar(max)"); + + b.Property("Length") + .HasColumnType("bigint"); + + b.Property("MP3FileCheckSum") + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("ProcessResult") + .HasColumnType("bit"); + + b.Property("ProcessResultMsg") + .HasColumnType("nvarchar(max)"); + + b.Property("UploadSessionId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UploadSessionId"); + + b.ToTable("UploadedFiles"); + }); + + modelBuilder.Entity("RSecurityBackend.Models.Audit.Db.REvent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Duration") + .HasColumnType("int"); + + b.Property("EndDate") + .HasColumnType("datetime2"); + + b.Property("EventType") + .HasColumnType("nvarchar(max)"); + + b.Property("IpAddress") + .HasColumnType("nvarchar(max)"); + + b.Property("JsonData") + .HasColumnType("nvarchar(max)"); + + b.Property("RequestUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("ResponseStatusCode") + .HasColumnType("int"); + + b.Property("StartDate") + .HasColumnType("datetime2"); + + b.Property("UserName") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("AuditLogs"); + }); + + modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.BannedEmail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("NormalizedEmail") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumber") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("BannedEmails"); + }); + + modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.RAppRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex") + .HasFilter("[NormalizedName] IS NOT NULL"); + + b.ToTable("AspNetRoles", (string)null); + }); + + modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.RAppUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccessFailedCount") + .HasColumnType("int"); + + b.Property("Bio") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("CreateDate") + .HasColumnType("datetime2"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("EmailConfirmed") + .HasColumnType("bit"); + + b.Property("FirstName") + .HasColumnType("nvarchar(max)"); + + b.Property("LockoutEnabled") + .HasColumnType("bit"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("LockoutMessage") + .HasColumnType("nvarchar(max)"); + + b.Property("NickName") + .HasColumnType("nvarchar(max)"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("PasswordHash") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("bit"); + + b.Property("RImageId") + .HasColumnType("uniqueidentifier"); + + b.Property("ScreenName") + .HasColumnType("nvarchar(max)"); + + b.Property("SecurityStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("SurName") + .HasColumnType("nvarchar(max)"); + + b.Property("TwoFactorEnabled") + .HasColumnType("bit"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Website") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex") + .HasFilter("[NormalizedUserName] IS NOT NULL"); + + b.HasIndex("RImageId"); + + b.ToTable("AspNetUsers", (string)null); + }); + + modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.RCaptchaImage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DateTime") + .HasColumnType("datetime2"); + + b.Property("RImageId") + .HasColumnType("uniqueidentifier"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("RImageId"); + + b.ToTable("CaptchaImages"); + }); + + modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.RPermission", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("OperationShortName") + .HasColumnType("nvarchar(max)"); + + b.Property("RAppRoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("SecurableItemShortName") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("RAppRoleId"); + + b.ToTable("Permissions"); + }); + + modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.RTemporaryUserSession", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClientAppName") + .HasColumnType("nvarchar(max)"); + + b.Property("ClientIPAddress") + .HasColumnType("nvarchar(max)"); + + b.Property("Language") + .HasColumnType("nvarchar(max)"); + + b.Property("LastRenewal") + .HasColumnType("datetime2"); + + b.Property("LoginTime") + .HasColumnType("datetime2"); + + b.Property("RAppUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("Token") + .HasColumnType("nvarchar(max)"); + + b.Property("ValidUntil") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.HasIndex("RAppUserId"); + + b.ToTable("Sessions"); + }); + + modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.RUserBehaviourLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DateTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("UserBehaviourLogs"); + }); + + modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.RVerifyQueueItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClientAppName") + .HasColumnType("nvarchar(max)"); + + b.Property("ClientIPAddress") + .HasColumnType("nvarchar(max)"); + + b.Property("DateTime") + .HasColumnType("datetime2"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("Language") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("QueueType") + .HasColumnType("int"); + + b.Property("Secret") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Secret") + .IsUnique() + .HasFilter("[Secret] IS NOT NULL"); + + b.ToTable("VerifyQueueItems"); + }); + + modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.UserOldContact", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ChangeDate") + .HasColumnType("datetime2"); + + b.Property("IsEmail") + .HasColumnType("bit"); + + b.Property("NormalizedValue") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("UserOldContacts"); + }); + + modelBuilder.Entity("RSecurityBackend.Models.ChangeTracking.RChangeLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DateTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("EntityId") + .HasColumnType("int"); + + b.Property("EntityJson") + .HasColumnType("nvarchar(max)"); + + b.Property("EntityName") + .HasMaxLength(16) + .HasColumnType("nvarchar(16)"); + + b.Property("EntityUId") + .HasColumnType("uniqueidentifier"); + + b.Property("Operation") + .HasMaxLength(24) + .HasColumnType("nvarchar(24)"); + + b.Property("RAppUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("WorkspaceId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RAppUserId"); + + b.HasIndex("WorkspaceId"); + + b.ToTable("RChangeLogs"); + }); + + modelBuilder.Entity("RSecurityBackend.Models.Cloud.RWSPermission", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("OperationShortName") + .HasColumnType("nvarchar(max)"); + + b.Property("RWSRoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("SecurableItemShortName") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("RWSRoleId"); + + b.ToTable("RWSPermissions"); + }); + + modelBuilder.Entity("RSecurityBackend.Models.Cloud.RWSRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("NormalizedName") + .HasColumnType("nvarchar(max)"); + + b.Property("WorkspaceId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("WorkspaceId"); + + b.ToTable("RWSRoles"); + }); + + modelBuilder.Entity("RSecurityBackend.Models.Cloud.RWSUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("InviteDate") + .HasColumnType("datetime2"); + + b.Property("MemberFrom") + .HasColumnType("datetime2"); + + b.Property("RAppUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("RWorkspaceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("WorkspaceOrder") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RAppUserId"); + + b.HasIndex("RWorkspaceId"); + + b.ToTable("RWSUsers"); + }); + + modelBuilder.Entity("RSecurityBackend.Models.Cloud.RWSUserRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("WorkspaceId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId"); + + b.HasIndex("WorkspaceId"); + + b.ToTable("RWSUserRoles"); + }); + + modelBuilder.Entity("RSecurityBackend.Models.Cloud.RWorkspace", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("CreateDate") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("RWorkspaces"); + }); + + modelBuilder.Entity("RSecurityBackend.Models.Cloud.WorkspaceUserInvitation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("WorkspaceId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.HasIndex("WorkspaceId"); + + b.ToTable("WorkspaceUserInvitations"); + }); + + modelBuilder.Entity("RSecurityBackend.Models.Generic.Db.RGenericOption", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Name") + .HasColumnType("nvarchar(450)"); + + b.Property("RAppUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.Property("WorkspaceId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("WorkspaceId"); + + b.HasIndex("RAppUserId", "Name") + .IsUnique() + .HasFilter("[RAppUserId] IS NOT NULL AND [Name] IS NOT NULL"); + + b.ToTable("Options"); + }); + + modelBuilder.Entity("RSecurityBackend.Models.Generic.Db.RLongRunningJobStatus", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("EndTime") + .HasColumnType("datetime2"); + + b.Property("Exception") + .HasColumnType("nvarchar(max)"); + + b.Property("LastUpdate") + .HasColumnType("datetime2"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("Progress") + .HasColumnType("float"); + + b.Property("StartTime") + .HasColumnType("datetime2"); + + b.Property("Step") + .HasColumnType("nvarchar(max)"); + + b.Property("Succeeded") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.ToTable("LongRunningJobs"); + }); + + modelBuilder.Entity("RSecurityBackend.Models.Image.RImage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ContentType") + .HasColumnType("nvarchar(max)"); + + b.Property("DataTime") + .HasColumnType("datetime2"); + + b.Property("Discriminator") + .IsRequired() + .HasMaxLength(13) + .HasColumnType("nvarchar(13)"); + + b.Property("FileSizeInBytes") + .HasColumnType("bigint"); + + b.Property("FolderName") + .HasColumnType("nvarchar(max)"); + + b.Property("ImageHeight") + .HasColumnType("int"); + + b.Property("ImageWidth") + .HasColumnType("int"); + + b.Property("LastModified") + .HasColumnType("datetime2"); + + b.Property("OriginalFileName") + .HasColumnType("nvarchar(max)"); + + b.Property("StoredFileName") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("GeneralImages"); + + b.HasDiscriminator("Discriminator").HasValue("RImage"); + + b.UseTphMappingStrategy(); + }); + + modelBuilder.Entity("RSecurityBackend.Models.Notification.RUserNotification", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DateTime") + .HasColumnType("datetime2"); + + b.Property("HtmlText") + .HasColumnType("nvarchar(max)"); + + b.Property("NotificationType") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("Subject") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Notifications"); + }); + + modelBuilder.Entity("RMuseum.Models.Artifact.RPictureFile", b => + { + b.HasBaseType("RSecurityBackend.Models.Image.RImage"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DescriptionInEnglish") + .HasColumnType("nvarchar(max)"); + + b.Property("ExternalNormalSizeImageUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModifiedMeta") + .HasColumnType("datetime2"); + + b.Property("NormalSizeImageHeight") + .HasColumnType("int"); + + b.Property("NormalSizeImageStoredFileName") + .HasColumnType("nvarchar(max)"); + + b.Property("NormalSizeImageWidth") + .HasColumnType("int"); + + b.Property("Order") + .HasColumnType("int"); + + b.Property("RArtifactItemRecordId") + .HasColumnType("uniqueidentifier"); + + b.Property("SrcUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("ThumbnailImageHeight") + .HasColumnType("int"); + + b.Property("ThumbnailImageStoredFileName") + .HasColumnType("nvarchar(max)"); + + b.Property("ThumbnailImageWidth") + .HasColumnType("int"); + + b.Property("Title") + .HasColumnType("nvarchar(max)"); + + b.Property("TitleInEnglish") + .HasColumnType("nvarchar(max)"); + + b.HasIndex("RArtifactItemRecordId"); + + b.HasDiscriminator().HasValue("RPictureFile"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("RMuseum.Models.Accounting.DonationExpenditure", b => + { + b.HasOne("RMuseum.Models.Accounting.GanjoorDonation", "GanjoorDonation") + .WithMany() + .HasForeignKey("GanjoorDonationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("RMuseum.Models.Accounting.GanjoorExpense", null) + .WithMany("DonationExpenditures") + .HasForeignKey("GanjoorExpenseId"); + + b.Navigation("GanjoorDonation"); + }); + + modelBuilder.Entity("RMuseum.Models.Artifact.RArtifactItemRecord", b => + { + b.HasOne("RMuseum.Models.Artifact.RArtifactMasterRecord", null) + .WithMany("Items") + .HasForeignKey("RArtifactMasterRecordId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("RMuseum.Models.Artifact.RArtifactMasterRecord", b => + { + b.HasOne("RMuseum.Models.Artifact.RPictureFile", "CoverImage") + .WithMany() + .HasForeignKey("CoverImageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CoverImage"); + }); + + modelBuilder.Entity("RMuseum.Models.Artifact.RTagValue", b => + { + b.HasOne("RMuseum.Models.PDFLibrary.Book", null) + .WithMany("Tags") + .HasForeignKey("BookId"); + + b.HasOne("RMuseum.Models.PDFLibrary.PDFBook", null) + .WithMany("Tags") + .HasForeignKey("PDFBookId"); + + b.HasOne("RMuseum.Models.PDFLibrary.PDFPage", null) + .WithMany("Tags") + .HasForeignKey("PDFPageId"); + + b.HasOne("RMuseum.Models.Artifact.RArtifactItemRecord", null) + .WithMany("Tags") + .HasForeignKey("RArtifactItemRecordId"); + + b.HasOne("RMuseum.Models.Artifact.RArtifactMasterRecord", null) + .WithMany("Tags") + .HasForeignKey("RArtifactMasterRecordId"); + + b.HasOne("RMuseum.Models.Artifact.RTag", "RTag") + .WithMany() + .HasForeignKey("RTagId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("RTag"); + }); + + modelBuilder.Entity("RMuseum.Models.Bookmark.RUserBookmark", b => + { + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "RAppUser") + .WithMany() + .HasForeignKey("RAppUserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("RMuseum.Models.Artifact.RArtifactItemRecord", "RArtifactItemRecord") + .WithMany() + .HasForeignKey("RArtifactItemRecordId"); + + b.HasOne("RMuseum.Models.Artifact.RArtifactMasterRecord", "RArtifactMasterRecord") + .WithMany() + .HasForeignKey("RArtifactMasterRecordId"); + + b.Navigation("RAppUser"); + + b.Navigation("RArtifactItemRecord"); + + b.Navigation("RArtifactMasterRecord"); + }); + + modelBuilder.Entity("RMuseum.Models.FAQ.FAQItem", b => + { + b.HasOne("RMuseum.Models.FAQ.FAQCategory", "Category") + .WithMany() + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Category"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorCachedRelatedPoem", b => + { + b.HasOne("RMuseum.Models.Ganjoor.GanjoorPoem", "Poem") + .WithMany() + .HasForeignKey("PoemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Poem"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorCachedRelatedSection", b => + { + b.HasOne("RMuseum.Models.Ganjoor.GanjoorPoem", "Poem") + .WithMany() + .HasForeignKey("PoemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Poem"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorCat", b => + { + b.HasOne("RMuseum.Models.Ganjoor.GanjoorCat", "Parent") + .WithMany() + .HasForeignKey("ParentId"); + + b.HasOne("RMuseum.Models.Ganjoor.GanjoorPoet", "Poet") + .WithMany() + .HasForeignKey("PoetId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("RSecurityBackend.Models.Image.RImage", "RImage") + .WithMany() + .HasForeignKey("RImageId"); + + b.Navigation("Parent"); + + b.Navigation("Poet"); + + b.Navigation("RImage"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorCatCorrection", b => + { + b.HasOne("RMuseum.Models.Ganjoor.GanjoorCat", "Cat") + .WithMany() + .HasForeignKey("CatId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "ReviewerUser") + .WithMany() + .HasForeignKey("ReviewerUserId"); + + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Cat"); + + b.Navigation("ReviewerUser"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorCenturyPoet", b => + { + b.HasOne("RMuseum.Models.Ganjoor.GanjoorCentury", null) + .WithMany("Poets") + .HasForeignKey("GanjoorCenturyId"); + + b.HasOne("RMuseum.Models.Ganjoor.GanjoorPoet", "Poet") + .WithMany() + .HasForeignKey("PoetId"); + + b.Navigation("Poet"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorComment", b => + { + b.HasOne("RMuseum.Models.Ganjoor.GanjoorComment", "InReplyTo") + .WithMany() + .HasForeignKey("InReplyToId"); + + b.HasOne("RMuseum.Models.Ganjoor.GanjoorPoem", "Poem") + .WithMany() + .HasForeignKey("PoemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.HasOne("RMuseum.Models.Ganjoor.GanjoorVerse", "Verse1") + .WithMany() + .HasForeignKey("Verse1Id"); + + b.HasOne("RMuseum.Models.Ganjoor.GanjoorVerse", "Verse2") + .WithMany() + .HasForeignKey("Verse2Id"); + + b.Navigation("InReplyTo"); + + b.Navigation("Poem"); + + b.Navigation("User"); + + b.Navigation("Verse1"); + + b.Navigation("Verse2"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorCommentAbuseReport", b => + { + b.HasOne("RMuseum.Models.Ganjoor.GanjoorComment", "GanjoorComment") + .WithMany() + .HasForeignKey("GanjoorCommentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "ReportedBy") + .WithMany() + .HasForeignKey("ReportedById"); + + b.Navigation("GanjoorComment"); + + b.Navigation("ReportedBy"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorCommentReaction", b => + { + b.HasOne("RMuseum.Models.Ganjoor.GanjoorComment", "GanjoorComment") + .WithMany() + .HasForeignKey("GanjoorCommentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("GanjoorComment"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorDuplicate", b => + { + b.HasOne("RMuseum.Models.Ganjoor.GanjoorPoem", "DestPoem") + .WithMany() + .HasForeignKey("DestPoemId"); + + b.HasOne("RMuseum.Models.Ganjoor.GanjoorPoem", "SrcPoem") + .WithMany() + .HasForeignKey("SrcPoemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DestPoem"); + + b.Navigation("SrcPoem"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorNumbering", b => + { + b.HasOne("RMuseum.Models.Ganjoor.GanjoorCat", "EndCat") + .WithMany() + .HasForeignKey("EndCatId"); + + b.HasOne("RMuseum.Models.Ganjoor.GanjoorCat", "StartCat") + .WithMany() + .HasForeignKey("StartCatId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("EndCat"); + + b.Navigation("StartCat"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPage", b => + { + b.HasOne("RMuseum.Models.Ganjoor.GanjoorCat", "Cat") + .WithMany() + .HasForeignKey("CatId"); + + b.HasOne("RMuseum.Models.Ganjoor.GanjoorPage", "Parent") + .WithMany() + .HasForeignKey("ParentId"); + + b.HasOne("RMuseum.Models.Ganjoor.GanjoorPoem", "Poem") + .WithMany() + .HasForeignKey("PoemId"); + + b.HasOne("RMuseum.Models.Ganjoor.GanjoorPoet", "Poet") + .WithMany() + .HasForeignKey("PoetId"); + + b.HasOne("RMuseum.Models.Ganjoor.GanjoorPoet", "SecondPoet") + .WithMany() + .HasForeignKey("SecondPoetId"); + + b.Navigation("Cat"); + + b.Navigation("Parent"); + + b.Navigation("Poem"); + + b.Navigation("Poet"); + + b.Navigation("SecondPoet"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPageSnapshot", b => + { + b.HasOne("RMuseum.Models.Ganjoor.GanjoorPage", "GanjoorPage") + .WithMany() + .HasForeignKey("GanjoorPageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "MadeObsoleteByUser") + .WithMany() + .HasForeignKey("MadeObsoleteByUserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("GanjoorPage"); + + b.Navigation("MadeObsoleteByUser"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPersonAffiliation", b => + { + b.HasOne("RMuseum.Models.Ganjoor.GanjoorRelatedPerson", "Person1") + .WithMany() + .HasForeignKey("Person1Id") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("RMuseum.Models.Ganjoor.GanjoorRelatedPerson", "Person2") + .WithMany() + .HasForeignKey("Person2Id") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Person1"); + + b.Navigation("Person2"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPersonEditSuggestion", b => + { + b.HasOne("RMuseum.Models.Ganjoor.GanjoorRelatedPerson", "Person") + .WithMany() + .HasForeignKey("PersonId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "ReviewerUser") + .WithMany() + .HasForeignKey("ReviewerUserId"); + + b.HasOne("RMuseum.Models.Ganjoor.GanjoorGeoLocation", "SuggestedBirthLocation") + .WithMany() + .HasForeignKey("SuggestedBirthLocationId"); + + b.HasOne("RMuseum.Models.Ganjoor.GanjoorGeoLocation", "SuggestedDeathLocation") + .WithMany() + .HasForeignKey("SuggestedDeathLocationId"); + + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Person"); + + b.Navigation("ReviewerUser"); + + b.Navigation("SuggestedBirthLocation"); + + b.Navigation("SuggestedDeathLocation"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPersonRelation", b => + { + b.HasOne("RMuseum.Models.Ganjoor.GanjoorRelatedPerson", "Person1") + .WithMany() + .HasForeignKey("Person1Id") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("RMuseum.Models.Ganjoor.GanjoorRelatedPerson", "Person2") + .WithMany() + .HasForeignKey("Person2Id") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Person1"); + + b.Navigation("Person2"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPersonRelationEditSuggestion", b => + { + b.HasOne("RMuseum.Models.Ganjoor.GanjoorPersonAffiliation", "ExistingAffiliation") + .WithMany() + .HasForeignKey("ExistingAffiliationId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("RMuseum.Models.Ganjoor.GanjoorPersonRelation", "ExistingRelation") + .WithMany() + .HasForeignKey("ExistingRelationId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("RMuseum.Models.Ganjoor.GanjoorRelatedPerson", "Person1") + .WithMany() + .HasForeignKey("Person1Id") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("RMuseum.Models.Ganjoor.GanjoorRelatedPerson", "Person2") + .WithMany() + .HasForeignKey("Person2Id") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "ReviewerUser") + .WithMany() + .HasForeignKey("ReviewerUserId"); + + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ExistingAffiliation"); + + b.Navigation("ExistingRelation"); + + b.Navigation("Person1"); + + b.Navigation("Person2"); + + b.Navigation("ReviewerUser"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPoem", b => + { + b.HasOne("RMuseum.Models.Ganjoor.GanjoorCat", "Cat") + .WithMany() + .HasForeignKey("CatId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("RMuseum.Models.Ganjoor.GanjoorMetre", "GanjoorMetre") + .WithMany() + .HasForeignKey("GanjoorMetreId"); + + b.Navigation("Cat"); + + b.Navigation("GanjoorMetre"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPoemCorrection", b => + { + b.HasOne("RMuseum.Models.Ganjoor.GanjoorPoem", "Poem") + .WithMany() + .HasForeignKey("PoemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "ReviewerUser") + .WithMany() + .HasForeignKey("ReviewerUserId"); + + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Poem"); + + b.Navigation("ReviewerUser"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPoemGeoDateTagCorrection", b => + { + b.HasOne("RMuseum.Models.Ganjoor.GanjoorPoemCorrection", null) + .WithMany("GeoDateTags") + .HasForeignKey("GanjoorPoemCorrectionId"); + + b.HasOne("RMuseum.Models.Ganjoor.GanjoorGeoLocation", "Location") + .WithMany() + .HasForeignKey("LocationId"); + + b.HasOne("RMuseum.Models.Ganjoor.GanjoorRelatedPerson", "Person") + .WithMany() + .HasForeignKey("PersonId"); + + b.Navigation("Location"); + + b.Navigation("Person"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPoemProbableMetre", b => + { + b.HasOne("RMuseum.Models.Ganjoor.GanjoorPoem", "Poem") + .WithMany() + .HasForeignKey("PoemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Poem"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPoemSection", b => + { + b.HasOne("RMuseum.Models.Ganjoor.GanjoorMetre", "GanjoorMetre") + .WithMany() + .HasForeignKey("GanjoorMetreId"); + + b.HasOne("RMuseum.Models.Ganjoor.GanjoorPoem", "Poem") + .WithMany() + .HasForeignKey("PoemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("RMuseum.Models.Ganjoor.GanjoorPoet", "Poet") + .WithMany() + .HasForeignKey("PoetId"); + + b.Navigation("GanjoorMetre"); + + b.Navigation("Poem"); + + b.Navigation("Poet"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPoemSectionCorrection", b => + { + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "ReviewerUser") + .WithMany() + .HasForeignKey("ReviewerUserId"); + + b.HasOne("RMuseum.Models.Ganjoor.GanjoorPoemSection", "Section") + .WithMany() + .HasForeignKey("SectionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ReviewerUser"); + + b.Navigation("Section"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPoet", b => + { + b.HasOne("RMuseum.Models.Ganjoor.GanjoorGeoLocation", "BirthLocation") + .WithMany() + .HasForeignKey("BirthLocationId"); + + b.HasOne("RMuseum.Models.Ganjoor.GanjoorGeoLocation", "DeathLocation") + .WithMany() + .HasForeignKey("DeathLocationId"); + + b.HasOne("RSecurityBackend.Models.Image.RImage", "RImage") + .WithMany() + .HasForeignKey("RImageId"); + + b.Navigation("BirthLocation"); + + b.Navigation("DeathLocation"); + + b.Navigation("RImage"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPoetSuggestedPicture", b => + { + b.HasOne("RMuseum.Models.Artifact.RPictureFile", "Picture") + .WithMany() + .HasForeignKey("PictureId"); + + b.HasOne("RMuseum.Models.Ganjoor.GanjoorPoet", "Poet") + .WithMany() + .HasForeignKey("PoetId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "SuggestedBy") + .WithMany() + .HasForeignKey("SuggestedById"); + + b.Navigation("Picture"); + + b.Navigation("Poet"); + + b.Navigation("SuggestedBy"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPoetSuggestedSpecLine", b => + { + b.HasOne("RMuseum.Models.Ganjoor.GanjoorPoet", "Poet") + .WithMany() + .HasForeignKey("PoetId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "SuggestedBy") + .WithMany() + .HasForeignKey("SuggestedById"); + + b.Navigation("Poet"); + + b.Navigation("SuggestedBy"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorQuotedPoem", b => + { + b.HasOne("RMuseum.Models.Ganjoor.GanjoorPoem", "Poem") + .WithMany() + .HasForeignKey("PoemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "ReviewerUser") + .WithMany() + .HasForeignKey("ReviewerUserId"); + + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "SuggestedBy") + .WithMany() + .HasForeignKey("SuggestedById"); + + b.Navigation("Poem"); + + b.Navigation("ReviewerUser"); + + b.Navigation("SuggestedBy"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorRelatedPerson", b => + { + b.HasOne("RMuseum.Models.Ganjoor.GanjoorGeoLocation", "BirthLocation") + .WithMany() + .HasForeignKey("BirthLocationId"); + + b.HasOne("RMuseum.Models.Ganjoor.GanjoorGeoLocation", "DeathLocation") + .WithMany() + .HasForeignKey("DeathLocationId"); + + b.Navigation("BirthLocation"); + + b.Navigation("DeathLocation"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorSiteBanner", b => + { + b.HasOne("RSecurityBackend.Models.Image.RImage", "RImage") + .WithMany() + .HasForeignKey("RImageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("RImage"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorTajikCat", b => + { + b.HasOne("RMuseum.Models.Ganjoor.GanjoorTajikPoet", "Poet") + .WithMany() + .HasForeignKey("PoetId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Poet"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorTajikPoem", b => + { + b.HasOne("RMuseum.Models.Ganjoor.GanjoorTajikCat", "Cat") + .WithMany() + .HasForeignKey("CatId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Cat"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorUserBookmark", b => + { + b.HasOne("RMuseum.Models.Ganjoor.GanjoorPoem", "Poem") + .WithMany() + .HasForeignKey("PoemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Poem"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorUserPoemVisit", b => + { + b.HasOne("RMuseum.Models.Ganjoor.GanjoorPoem", "Poem") + .WithMany() + .HasForeignKey("PoemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.Navigation("Poem"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorVerse", b => + { + b.HasOne("RMuseum.Models.Ganjoor.GanjoorLanguage", "Language") + .WithMany() + .HasForeignKey("LanguageId"); + + b.HasOne("RMuseum.Models.Ganjoor.GanjoorPoem", "Poem") + .WithMany() + .HasForeignKey("PoemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Language"); + + b.Navigation("Poem"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorVerseNumber", b => + { + b.HasOne("RMuseum.Models.Ganjoor.GanjoorNumbering", "Numbering") + .WithMany() + .HasForeignKey("NumberingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Numbering"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorVerseVOrderText", b => + { + b.HasOne("RMuseum.Models.Ganjoor.GanjoorPoemCorrection", null) + .WithMany("VerseOrderText") + .HasForeignKey("GanjoorPoemCorrectionId"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.PoemGeoDateTag", b => + { + b.HasOne("RMuseum.Models.Ganjoor.GanjoorGeoLocation", "Location") + .WithMany() + .HasForeignKey("LocationId"); + + b.HasOne("RMuseum.Models.Ganjoor.GanjoorRelatedPerson", "Person") + .WithMany() + .HasForeignKey("PersonId"); + + b.HasOne("RMuseum.Models.Ganjoor.GanjoorPoem", "Poem") + .WithMany() + .HasForeignKey("PoemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Location"); + + b.Navigation("Person"); + + b.Navigation("Poem"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.PoemMusicTrack", b => + { + b.HasOne("RMuseum.Models.MusicCatalogue.GanjoorTrack", "GanjoorTrack") + .WithMany() + .HasForeignKey("GanjoorTrackId"); + + b.HasOne("RMuseum.Models.MusicCatalogue.GolhaTrack", "GolhaTrack") + .WithMany() + .HasForeignKey("GolhaTrackId"); + + b.HasOne("RMuseum.Models.Ganjoor.GanjoorPoem", "Poem") + .WithMany() + .HasForeignKey("PoemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("RMuseum.Models.MusicCatalogue.GanjoorSinger", "Singer") + .WithMany() + .HasForeignKey("SingerId"); + + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "SuggestedBy") + .WithMany() + .HasForeignKey("SuggestedById"); + + b.Navigation("GanjoorTrack"); + + b.Navigation("GolhaTrack"); + + b.Navigation("Poem"); + + b.Navigation("Singer"); + + b.Navigation("SuggestedBy"); + }); + + modelBuilder.Entity("RMuseum.Models.GanjoorAudio.Recitation", b => + { + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "Owner") + .WithMany() + .HasForeignKey("OwnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "Reviewer") + .WithMany() + .HasForeignKey("ReviewerId"); + + b.Navigation("Owner"); + + b.Navigation("Reviewer"); + }); + + modelBuilder.Entity("RMuseum.Models.GanjoorAudio.RecitationApprovedMistake", b => + { + b.HasOne("RMuseum.Models.GanjoorAudio.Recitation", "Recitation") + .WithMany() + .HasForeignKey("RecitationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Recitation"); + }); + + modelBuilder.Entity("RMuseum.Models.GanjoorAudio.RecitationErrorReport", b => + { + b.HasOne("RMuseum.Models.GanjoorAudio.Recitation", "Recitation") + .WithMany() + .HasForeignKey("RecitationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "Reporter") + .WithMany() + .HasForeignKey("ReporterId"); + + b.Navigation("Recitation"); + + b.Navigation("Reporter"); + }); + + modelBuilder.Entity("RMuseum.Models.GanjoorAudio.RecitationPublishingTracker", b => + { + b.HasOne("RMuseum.Models.GanjoorAudio.Recitation", "PoemNarration") + .WithMany() + .HasForeignKey("PoemNarrationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("PoemNarration"); + }); + + modelBuilder.Entity("RMuseum.Models.GanjoorAudio.RecitationUserUpVote", b => + { + b.HasOne("RMuseum.Models.GanjoorAudio.Recitation", "Recitation") + .WithMany() + .HasForeignKey("RecitationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.Navigation("Recitation"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("RMuseum.Models.GanjoorAudio.UserRecitationProfile", b => + { + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("RMuseum.Models.GanjoorIntegration.GanjoorLink", b => + { + b.HasOne("RMuseum.Models.Artifact.RArtifactMasterRecord", "Artifact") + .WithMany() + .HasForeignKey("ArtifactId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("RMuseum.Models.Artifact.RArtifactItemRecord", "Item") + .WithMany() + .HasForeignKey("ItemId"); + + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "Reviewer") + .WithMany() + .HasForeignKey("ReviewerId"); + + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "SuggestedBy") + .WithMany() + .HasForeignKey("SuggestedById") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Artifact"); + + b.Navigation("Item"); + + b.Navigation("Reviewer"); + + b.Navigation("SuggestedBy"); + }); + + modelBuilder.Entity("RMuseum.Models.GanjoorIntegration.PDFGanjoorLink", b => + { + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "Reviewer") + .WithMany() + .HasForeignKey("ReviewerId"); + + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "SuggestedBy") + .WithMany() + .HasForeignKey("SuggestedById") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Reviewer"); + + b.Navigation("SuggestedBy"); + }); + + modelBuilder.Entity("RMuseum.Models.GanjoorIntegration.PinterestLink", b => + { + b.HasOne("RMuseum.Models.Artifact.RArtifactMasterRecord", "Artifact") + .WithMany() + .HasForeignKey("ArtifactId"); + + b.HasOne("RMuseum.Models.Artifact.RArtifactItemRecord", "Item") + .WithMany() + .HasForeignKey("ItemId"); + + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "Reviewer") + .WithMany() + .HasForeignKey("ReviewerId"); + + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "SuggestedBy") + .WithMany() + .HasForeignKey("SuggestedById"); + + b.Navigation("Artifact"); + + b.Navigation("Item"); + + b.Navigation("Reviewer"); + + b.Navigation("SuggestedBy"); + }); + + modelBuilder.Entity("RMuseum.Models.ImportJob.ImportJob", b => + { + b.HasOne("RMuseum.Models.Artifact.RArtifactMasterRecord", "Artifact") + .WithMany() + .HasForeignKey("ArtifactId"); + + b.Navigation("Artifact"); + }); + + modelBuilder.Entity("RMuseum.Models.MusicCatalogue.GanjoorAlbum", b => + { + b.HasOne("RMuseum.Models.MusicCatalogue.GanjoorSinger", "Singer") + .WithMany("Albums") + .HasForeignKey("SingerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Singer"); + }); + + modelBuilder.Entity("RMuseum.Models.MusicCatalogue.GanjoorSinger", b => + { + b.HasOne("RSecurityBackend.Models.Image.RImage", "RImage") + .WithMany() + .HasForeignKey("RImageId"); + + b.Navigation("RImage"); + }); + + modelBuilder.Entity("RMuseum.Models.MusicCatalogue.GanjoorTrack", b => + { + b.HasOne("RMuseum.Models.MusicCatalogue.GanjoorAlbum", "Album") + .WithMany("Tracks") + .HasForeignKey("AlbumId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Album"); + }); + + modelBuilder.Entity("RMuseum.Models.MusicCatalogue.GolhaProgram", b => + { + b.HasOne("RMuseum.Models.MusicCatalogue.GolhaCollection", "GolhaCollection") + .WithMany("Programs") + .HasForeignKey("GolhaCollectionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("GolhaCollection"); + }); + + modelBuilder.Entity("RMuseum.Models.MusicCatalogue.GolhaTrack", b => + { + b.HasOne("RMuseum.Models.MusicCatalogue.GolhaProgram", "GolhaProgram") + .WithMany("Tracks") + .HasForeignKey("GolhaProgramId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("RMuseum.Models.MusicCatalogue.GanjoorSinger", "Singer") + .WithMany() + .HasForeignKey("SingerId"); + + b.Navigation("GolhaProgram"); + + b.Navigation("Singer"); + }); + + modelBuilder.Entity("RMuseum.Models.Note.RUserNote", b => + { + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "RAppUser") + .WithMany() + .HasForeignKey("RAppUserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("RMuseum.Models.Artifact.RArtifactItemRecord", "RArtifactItemRecord") + .WithMany() + .HasForeignKey("RArtifactItemRecordId"); + + b.HasOne("RMuseum.Models.Artifact.RArtifactMasterRecord", "RArtifactMasterRecord") + .WithMany() + .HasForeignKey("RArtifactMasterRecordId"); + + b.HasOne("RMuseum.Models.Note.RUserNote", "ReferenceNote") + .WithMany() + .HasForeignKey("ReferenceNoteId"); + + b.Navigation("RAppUser"); + + b.Navigation("RArtifactItemRecord"); + + b.Navigation("RArtifactMasterRecord"); + + b.Navigation("ReferenceNote"); + }); + + modelBuilder.Entity("RMuseum.Models.Note.RUserNoteAbuseReport", b => + { + b.HasOne("RMuseum.Models.Note.RUserNote", "Note") + .WithMany() + .HasForeignKey("NoteId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "Reporter") + .WithMany() + .HasForeignKey("ReporterId"); + + b.Navigation("Note"); + + b.Navigation("Reporter"); + }); + + modelBuilder.Entity("RMuseum.Models.PDFLibrary.Author", b => + { + b.HasOne("RSecurityBackend.Models.Image.RImage", "Image") + .WithMany() + .HasForeignKey("ImageId"); + + b.Navigation("Image"); + }); + + modelBuilder.Entity("RMuseum.Models.PDFLibrary.AuthorRole", b => + { + b.HasOne("RMuseum.Models.PDFLibrary.Author", "Author") + .WithMany() + .HasForeignKey("AuthorId"); + + b.HasOne("RMuseum.Models.PDFLibrary.Book", null) + .WithMany("Authors") + .HasForeignKey("BookId"); + + b.HasOne("RMuseum.Models.PDFLibrary.PDFBook", null) + .WithMany("Contributers") + .HasForeignKey("PDFBookId"); + + b.Navigation("Author"); + }); + + modelBuilder.Entity("RMuseum.Models.PDFLibrary.Book", b => + { + b.HasOne("RSecurityBackend.Models.Image.RImage", "CoverImage") + .WithMany() + .HasForeignKey("CoverImageId"); + + b.Navigation("CoverImage"); + }); + + modelBuilder.Entity("RMuseum.Models.PDFLibrary.MultiVolumePDFCollection", b => + { + b.HasOne("RMuseum.Models.PDFLibrary.Book", "Book") + .WithMany() + .HasForeignKey("BookId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Book"); + }); + + modelBuilder.Entity("RMuseum.Models.PDFLibrary.PDFBook", b => + { + b.HasOne("RMuseum.Models.PDFLibrary.Book", "Book") + .WithMany() + .HasForeignKey("BookId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("RSecurityBackend.Models.Image.RImage", "CoverImage") + .WithMany() + .HasForeignKey("CoverImageId"); + + b.HasOne("RMuseum.Models.PDFLibrary.MultiVolumePDFCollection", "MultiVolumePDFCollection") + .WithMany() + .HasForeignKey("MultiVolumePDFCollectionId"); + + b.HasOne("RSecurityBackend.Models.Image.RImage", "PDFFile") + .WithMany() + .HasForeignKey("PDFFileId"); + + b.HasOne("RMuseum.Models.PDFLibrary.PDFSource", "PDFSource") + .WithMany() + .HasForeignKey("PDFSourceId"); + + b.Navigation("Book"); + + b.Navigation("CoverImage"); + + b.Navigation("MultiVolumePDFCollection"); + + b.Navigation("PDFFile"); + + b.Navigation("PDFSource"); + }); + + modelBuilder.Entity("RMuseum.Models.PDFLibrary.PDFPage", b => + { + b.HasOne("RMuseum.Models.PDFLibrary.PDFBook", null) + .WithMany("Pages") + .HasForeignKey("PDFBookId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("RSecurityBackend.Models.Image.RImage", "ThumbnailImage") + .WithMany() + .HasForeignKey("ThumbnailImageId"); + + b.Navigation("ThumbnailImage"); + }); + + modelBuilder.Entity("RMuseum.Models.UploadSession.UploadSession", b => + { + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("RMuseum.Models.UploadSession.UploadSessionFile", b => + { + b.HasOne("RMuseum.Models.UploadSession.UploadSession", null) + .WithMany("UploadedFiles") + .HasForeignKey("UploadSessionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.RAppUser", b => + { + b.HasOne("RSecurityBackend.Models.Image.RImage", "RImage") + .WithMany() + .HasForeignKey("RImageId"); + + b.Navigation("RImage"); + }); + + modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.RCaptchaImage", b => + { + b.HasOne("RSecurityBackend.Models.Image.RImage", "RImage") + .WithMany() + .HasForeignKey("RImageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("RImage"); + }); + + modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.RPermission", b => + { + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppRole", null) + .WithMany("Permissions") + .HasForeignKey("RAppRoleId"); + }); + + modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.RTemporaryUserSession", b => + { + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "RAppUser") + .WithMany() + .HasForeignKey("RAppUserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("RAppUser"); + }); + + modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.RUserBehaviourLog", b => + { + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.UserOldContact", b => + { + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("RSecurityBackend.Models.ChangeTracking.RChangeLog", b => + { + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "RAppUser") + .WithMany() + .HasForeignKey("RAppUserId"); + + b.HasOne("RSecurityBackend.Models.Cloud.RWorkspace", "Workspace") + .WithMany() + .HasForeignKey("WorkspaceId"); + + b.Navigation("RAppUser"); + + b.Navigation("Workspace"); + }); + + modelBuilder.Entity("RSecurityBackend.Models.Cloud.RWSPermission", b => + { + b.HasOne("RSecurityBackend.Models.Cloud.RWSRole", null) + .WithMany("Permissions") + .HasForeignKey("RWSRoleId"); + }); + + modelBuilder.Entity("RSecurityBackend.Models.Cloud.RWSRole", b => + { + b.HasOne("RSecurityBackend.Models.Cloud.RWorkspace", "Workspace") + .WithMany() + .HasForeignKey("WorkspaceId"); + + b.Navigation("Workspace"); + }); + + modelBuilder.Entity("RSecurityBackend.Models.Cloud.RWSUser", b => + { + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "RAppUser") + .WithMany() + .HasForeignKey("RAppUserId"); + + b.HasOne("RSecurityBackend.Models.Cloud.RWorkspace", null) + .WithMany("Members") + .HasForeignKey("RWorkspaceId"); + + b.Navigation("RAppUser"); + }); + + modelBuilder.Entity("RSecurityBackend.Models.Cloud.RWSUserRole", b => + { + b.HasOne("RSecurityBackend.Models.Cloud.RWSRole", "Role") + .WithMany() + .HasForeignKey("RoleId"); + + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.HasOne("RSecurityBackend.Models.Cloud.RWorkspace", "Workspace") + .WithMany() + .HasForeignKey("WorkspaceId"); + + b.Navigation("Role"); + + b.Navigation("User"); + + b.Navigation("Workspace"); + }); + + modelBuilder.Entity("RSecurityBackend.Models.Cloud.WorkspaceUserInvitation", b => + { + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("RSecurityBackend.Models.Cloud.RWorkspace", "Workspace") + .WithMany() + .HasForeignKey("WorkspaceId"); + + b.Navigation("User"); + + b.Navigation("Workspace"); + }); + + modelBuilder.Entity("RSecurityBackend.Models.Generic.Db.RGenericOption", b => + { + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "RAppUser") + .WithMany() + .HasForeignKey("RAppUserId"); + + b.HasOne("RSecurityBackend.Models.Cloud.RWorkspace", "Workspace") + .WithMany() + .HasForeignKey("WorkspaceId"); + + b.Navigation("RAppUser"); + + b.Navigation("Workspace"); + }); + + modelBuilder.Entity("RSecurityBackend.Models.Notification.RUserNotification", b => + { + b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("RMuseum.Models.Artifact.RPictureFile", b => + { + b.HasOne("RMuseum.Models.Artifact.RArtifactItemRecord", null) + .WithMany("Images") + .HasForeignKey("RArtifactItemRecordId"); + }); + + modelBuilder.Entity("RMuseum.Models.Accounting.GanjoorExpense", b => + { + b.Navigation("DonationExpenditures"); + }); + + modelBuilder.Entity("RMuseum.Models.Artifact.RArtifactItemRecord", b => + { + b.Navigation("Images"); + + b.Navigation("Tags"); + }); + + modelBuilder.Entity("RMuseum.Models.Artifact.RArtifactMasterRecord", b => + { + b.Navigation("Items"); + + b.Navigation("Tags"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorCentury", b => + { + b.Navigation("Poets"); + }); + + modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPoemCorrection", b => + { + b.Navigation("GeoDateTags"); + + b.Navigation("VerseOrderText"); + }); + + modelBuilder.Entity("RMuseum.Models.MusicCatalogue.GanjoorAlbum", b => + { + b.Navigation("Tracks"); + }); + + modelBuilder.Entity("RMuseum.Models.MusicCatalogue.GanjoorSinger", b => + { + b.Navigation("Albums"); + }); + + modelBuilder.Entity("RMuseum.Models.MusicCatalogue.GolhaCollection", b => + { + b.Navigation("Programs"); + }); + + modelBuilder.Entity("RMuseum.Models.MusicCatalogue.GolhaProgram", b => + { + b.Navigation("Tracks"); + }); + + modelBuilder.Entity("RMuseum.Models.PDFLibrary.Book", b => + { + b.Navigation("Authors"); + + b.Navigation("Tags"); + }); + + modelBuilder.Entity("RMuseum.Models.PDFLibrary.PDFBook", b => + { + b.Navigation("Contributers"); + + b.Navigation("Pages"); + + b.Navigation("Tags"); + }); + + modelBuilder.Entity("RMuseum.Models.PDFLibrary.PDFPage", b => + { + b.Navigation("Tags"); + }); + + modelBuilder.Entity("RMuseum.Models.UploadSession.UploadSession", b => + { + b.Navigation("UploadedFiles"); + }); + + modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.RAppRole", b => + { + b.Navigation("Permissions"); + }); + + modelBuilder.Entity("RSecurityBackend.Models.Cloud.RWSRole", b => + { + b.Navigation("Permissions"); + }); + + modelBuilder.Entity("RSecurityBackend.Models.Cloud.RWorkspace", b => + { + b.Navigation("Members"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/RMuseum/Migrations/20261003143457_AddPersonGender.cs b/RMuseum/Migrations/20261003143457_AddPersonGender.cs new file mode 100644 index 00000000..538933e7 --- /dev/null +++ b/RMuseum/Migrations/20261003143457_AddPersonGender.cs @@ -0,0 +1,40 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace RMuseum.Migrations +{ + /// + public partial class AddPersonGender : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "Gender", + table: "GanjoorRelatedPersons", + type: "int", + nullable: false, + defaultValue: 0); + + migrationBuilder.AddColumn( + name: "SuggestedGender", + table: "GanjoorPersonEditSuggestions", + type: "int", + nullable: false, + defaultValue: 0); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Gender", + table: "GanjoorRelatedPersons"); + + migrationBuilder.DropColumn( + name: "SuggestedGender", + table: "GanjoorPersonEditSuggestions"); + } + } +} diff --git a/RMuseum/Migrations/RMuseumDbContextModelSnapshot.cs b/RMuseum/Migrations/RMuseumDbContextModelSnapshot.cs index 0b8d89c4..38683347 100644 --- a/RMuseum/Migrations/RMuseumDbContextModelSnapshot.cs +++ b/RMuseum/Migrations/RMuseumDbContextModelSnapshot.cs @@ -1478,6 +1478,9 @@ namespace RMuseum.Migrations b.Property("SuggestedForDeletion") .HasColumnType("bit"); + b.Property("SuggestedGender") + .HasColumnType("int"); + b.Property("SuggestedImportance") .HasColumnType("int"); @@ -2437,6 +2440,9 @@ namespace RMuseum.Migrations b.Property("FamilyTreeCaption") .HasColumnType("nvarchar(max)"); + b.Property("Gender") + .HasColumnType("int"); + b.Property("Importance") .HasColumnType("int"); diff --git a/RMuseum/Models/Ganjoor/GanjoorPersonEditSuggestion.cs b/RMuseum/Models/Ganjoor/GanjoorPersonEditSuggestion.cs index 8be9cbad..4eef7aec 100644 --- a/RMuseum/Models/Ganjoor/GanjoorPersonEditSuggestion.cs +++ b/RMuseum/Models/Ganjoor/GanjoorPersonEditSuggestion.cs @@ -113,6 +113,11 @@ namespace RMuseum.Models.Ganjoor /// public PersonImportance SuggestedImportance { get; set; } + /// + /// suggested gender (see GanjoorRelatedPerson.Gender) + /// + public PersonGender SuggestedGender { get; set; } + /// /// true if this suggestion is actually a request to delete the person outright, not to /// change their fields - when true, every Suggested* field above is ignored on approval diff --git a/RMuseum/Models/Ganjoor/GanjoorRelatedPerson.cs b/RMuseum/Models/Ganjoor/GanjoorRelatedPerson.cs index bad5f5b4..010d60a9 100644 --- a/RMuseum/Models/Ganjoor/GanjoorRelatedPerson.cs +++ b/RMuseum/Models/Ganjoor/GanjoorRelatedPerson.cs @@ -84,5 +84,12 @@ /// smaller (see PersonImportance and peoplegraph.js's nodeRadius()) - defaults to Normal /// public PersonImportance Importance { get; set; } + + /// + /// gender - only used by the family-tree chart to pick which parent is drawn as the tree's + /// spine when a child has two recorded parents who both have their own recorded ancestors + /// (see PersonGender and familytree.js's buildLayout()) - defaults to Unknown + /// + public PersonGender Gender { get; set; } } } diff --git a/RMuseum/Models/Ganjoor/PersonGender.cs b/RMuseum/Models/Ganjoor/PersonGender.cs new file mode 100644 index 00000000..09ef04c1 --- /dev/null +++ b/RMuseum/Models/Ganjoor/PersonGender.cs @@ -0,0 +1,30 @@ +namespace RMuseum.Models.Ganjoor +{ + /// + /// a GanjoorRelatedPerson's gender - used only by the family-tree chart (familytree.js's + /// buildLayout()) to break ties when a child has two recorded parents and both happen to have + /// their own recorded ancestors (so neither side can be preferred on "continues a documented + /// lineage" grounds alone): the father is preferred as the tree's spine parent, matching + /// conventional patrilineal genealogy-chart practice, with the mother then drawn attached + /// beside him. Never used to filter, rank or otherwise affect query results. New values can be + /// appended safely later (stored as int). + /// + public enum PersonGender + { + /// + /// default - not recorded. Falls back to the old ambiguous-tie-break behavior (ascending + /// person id) when it matters. + /// + Unknown = 0, + + /// + /// male + /// + Male = 1, + + /// + /// female + /// + Female = 2, + } +} diff --git a/RMuseum/Models/Ganjoor/ViewModels/PersonGraphSuggestion.cs b/RMuseum/Models/Ganjoor/ViewModels/PersonGraphSuggestion.cs index 952e95a9..9cf85865 100644 --- a/RMuseum/Models/Ganjoor/ViewModels/PersonGraphSuggestion.cs +++ b/RMuseum/Models/Ganjoor/ViewModels/PersonGraphSuggestion.cs @@ -67,6 +67,12 @@ namespace RMuseum.Models.Ganjoor.ViewModels /// Null/empty is treated as Normal. /// public string Importance { get; set; } + + /// + /// name of a PersonGender value ("Unknown", "Male", "Female") - same string-enum convention + /// as Importance above. Null/empty is treated as Unknown. + /// + public string Gender { get; set; } } /// diff --git a/RMuseum/RMuseum.xml b/RMuseum/RMuseum.xml index 67c4f4b0..dc46be5a 100644 --- a/RMuseum/RMuseum.xml +++ b/RMuseum/RMuseum.xml @@ -5010,6 +5010,18 @@ + + + + + + + + + + + + donation expenditures @@ -9534,6 +9546,11 @@ suggested importance (see GanjoorRelatedPerson.Importance) + + + suggested gender (see GanjoorRelatedPerson.Gender) + + true if this suggestion is actually a request to delete the person outright, not to @@ -11340,6 +11357,13 @@ smaller (see PersonImportance and peoplegraph.js's nodeRadius()) - defaults to Normal + + + gender - only used by the family-tree chart to pick which parent is drawn as the tree's + spine when a child has two recorded parents who both have their own recorded ancestors + (see PersonGender and familytree.js's buildLayout()) - defaults to Unknown + + ganjoor.net site banner @@ -11907,6 +11931,33 @@ doesn't fit any of the above - rely on Note for what the tie actually is + + + a GanjoorRelatedPerson's gender - used only by the family-tree chart (familytree.js's + buildLayout()) to break ties when a child has two recorded parents and both happen to have + their own recorded ancestors (so neither side can be preferred on "continues a documented + lineage" grounds alone): the father is preferred as the tree's spine parent, matching + conventional patrilineal genealogy-chart practice, with the mother then drawn attached + beside him. Never used to filter, rank or otherwise affect query results. New values can be + appended safely later (stored as int). + + + + + default - not recorded. Falls back to the old ambiguous-tie-break behavior (ascending + person id) when it matters. + + + + + male + + + + + female + + how editorially prominent a GanjoorRelatedPerson is treated as - purely a display/sizing @@ -15122,6 +15173,12 @@ Null/empty is treated as Normal. + + + name of a PersonGender value ("Unknown", "Male", "Female") - same string-enum convention + as Importance above. Null/empty is treated as Unknown. + + one edge in a PersonGraphSuggestion, between two nodes referenced by their LocalKey (Person1/ diff --git a/RMuseum/Services/Implementation/GanjoorRelatedPersonService.cs b/RMuseum/Services/Implementation/GanjoorRelatedPersonService.cs index 5941cb08..e6d15a0a 100644 --- a/RMuseum/Services/Implementation/GanjoorRelatedPersonService.cs +++ b/RMuseum/Services/Implementation/GanjoorRelatedPersonService.cs @@ -422,6 +422,7 @@ namespace RMuseum.Services.Implementation person.DeathLocationId = suggestion.SuggestedDeathLocationId; person.FamilyTreeCaption = suggestion.SuggestedFamilyTreeCaption; person.Importance = suggestion.SuggestedImportance; + person.Gender = suggestion.SuggestedGender; // Id and MachineGenerated on the person are intentionally left untouched } } diff --git a/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-ModeratePoemCorrection.cs b/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-ModeratePoemCorrection.cs index 74e04172..abaaee35 100644 --- a/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-ModeratePoemCorrection.cs +++ b/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-ModeratePoemCorrection.cs @@ -108,7 +108,7 @@ namespace RMuseum.Services.Implementation if(dbCorrection.SummaryReviewResult == CorrectionReviewResult.Approved) { dbCorrection.AffectedThePoem = true; - dbPoem.PoemSummary = moderation.PoemSummary.Replace("ۀ", "هٔ").Replace("ك", "ک"); + dbPoem.PoemSummary = moderation.PoemSummary.Replace("ۀ", "هٔ").Replace("ك", "ک").Replace("ي", "ی"); updatePoem = true; } } @@ -167,7 +167,11 @@ namespace RMuseum.Services.Implementation if (dbVerse.VersePositionResult == CorrectionReviewResult.Approved) poemVerse.VersePosition = (VersePosition)dbVerse.VersePosition; if (dbVerse.SummaryReviewResult == CorrectionReviewResult.Approved) - poemVerse.CoupletSummary = dbVerse.CoupletSummary; + // dbVerse.CoupletSummary was already run through this same substitution when the + // suggestion was first submitted (see Editor.cshtml.cs's OnPostSaveCorrectionsAsync), + // but re-applying it here too - same as Title/PoemSummary/verse Text above - keeps + // this field consistent even if a suggestion ever arrives through another path. + poemVerse.CoupletSummary = dbVerse.CoupletSummary?.Replace("ۀ", "هٔ").Replace("ك", "ک").Replace("ي", "ی"); if (dbVerse.LanguageReviewResult == CorrectionReviewResult.Approved) { if(dbVerse.LanguageId == 1)//fa-IR @@ -910,6 +914,12 @@ namespace RMuseum.Services.Implementation return new Tuple(0, $"درجهٔ اهمیت «{node.Importance}» نامعتبر است."); } + var gender = PersonGender.Unknown; + if (!string.IsNullOrWhiteSpace(node.Gender) && !Enum.TryParse(node.Gender, out gender)) + { + return new Tuple(0, $"جنسیت «{node.Gender}» نامعتبر است."); + } + var newPerson = new GanjoorRelatedPerson() { Name = node.Name.Trim(), @@ -923,6 +933,7 @@ namespace RMuseum.Services.Implementation DeathLocationId = node.DeathLocationId, FamilyTreeCaption = string.IsNullOrWhiteSpace(node.FamilyTreeCaption) ? null : node.FamilyTreeCaption.Trim(), Importance = importance, + Gender = gender, MachineGenerated = false, }; _context.GanjoorRelatedPersons.Add(newPerson);