#418 GanjoorPoem <=> GanjoorQuotedPoem db relation

This commit is contained in:
Hamid Reza Mohammadi 2023-12-15 21:17:33 +03:30
parent 2641c4d6f2
commit 5e0d995098
5 changed files with 5683 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,39 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace RMuseum.Migrations
{
/// <inheritdoc />
public partial class QPRelation : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateIndex(
name: "IX_GanjoorQuotedPoems_PoemId",
table: "GanjoorQuotedPoems",
column: "PoemId");
migrationBuilder.AddForeignKey(
name: "FK_GanjoorQuotedPoems_GanjoorPoems_PoemId",
table: "GanjoorQuotedPoems",
column: "PoemId",
principalTable: "GanjoorPoems",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_GanjoorQuotedPoems_GanjoorPoems_PoemId",
table: "GanjoorQuotedPoems");
migrationBuilder.DropIndex(
name: "IX_GanjoorQuotedPoems_PoemId",
table: "GanjoorQuotedPoems");
}
}
}

View File

@ -1889,6 +1889,8 @@ namespace RMuseum.Migrations
b.HasKey("Id");
b.HasIndex("PoemId");
b.ToTable("GanjoorQuotedPoems");
});
@ -4793,6 +4795,17 @@ namespace RMuseum.Migrations
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.Navigation("Poem");
});
modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorRelatedPerson", b =>
{
b.HasOne("RMuseum.Models.Ganjoor.GanjoorGeoLocation", "BirthLocation")

View File

@ -17,6 +17,11 @@ namespace RMuseum.Models.Ganjoor
/// </summary>
public int PoemId { get; set; }
/// <summary>
/// poem
/// </summary>
public GanjoorPoem Poem { get; set; }
/// <summary>
/// related poem id (this could be a poem we do not have it available)
/// </summary>

View File

@ -3695,6 +3695,18 @@
<member name="M:RMuseum.Migrations.QPRelatedInDirectly.BuildTargetModel(Microsoft.EntityFrameworkCore.ModelBuilder)">
<inheritdoc />
</member>
<member name="T:RMuseum.Migrations.QPRelation">
<inheritdoc />
</member>
<member name="M:RMuseum.Migrations.QPRelation.Up(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder)">
<inheritdoc />
</member>
<member name="M:RMuseum.Migrations.QPRelation.Down(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder)">
<inheritdoc />
</member>
<member name="M:RMuseum.Migrations.QPRelation.BuildTargetModel(Microsoft.EntityFrameworkCore.ModelBuilder)">
<inheritdoc />
</member>
<member name="T:RMuseum.Models.Accounting.DonationExpenditure">
<summary>
donation expenditures
@ -8840,6 +8852,11 @@
poem id
</summary>
</member>
<member name="P:RMuseum.Models.Ganjoor.GanjoorQuotedPoem.Poem">
<summary>
poem
</summary>
</member>
<member name="P:RMuseum.Models.Ganjoor.GanjoorQuotedPoem.RelatedPoemId">
<summary>
related poem id (this could be a poem we do not have it available)