#255 adding db migration

This commit is contained in:
Hamid Reza Mohammadi 2021-12-08 20:00:01 +03:30
parent 28a60ae901
commit 293ed9afe4
6 changed files with 3622 additions and 2 deletions

View File

@ -395,5 +395,10 @@ namespace RMuseum.DbContext
/// </summary>
public DbSet<RUserNoteAbuseReport> ReportedUserNotes { get; set; }
/// <summary>
/// recitation error reports
/// </summary>
public DbSet<RecitationErrorReport> RecitationErrorReports { get; set; }
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,56 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace RMuseum.Migrations
{
public partial class RecitationErrors : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "RecitationErrorReports",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
RecitationId = table.Column<int>(type: "int", nullable: false),
ReasonText = table.Column<string>(type: "nvarchar(max)", nullable: true),
ReporterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_RecitationErrorReports", x => x.Id);
table.ForeignKey(
name: "FK_RecitationErrorReports_AspNetUsers_ReporterId",
column: x => x.ReporterId,
principalTable: "AspNetUsers",
principalColumn: "Id");
table.ForeignKey(
name: "FK_RecitationErrorReports_Recitations_RecitationId",
column: x => x.RecitationId,
principalTable: "Recitations",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_RecitationErrorReports_RecitationId",
table: "RecitationErrorReports",
column: "RecitationId");
migrationBuilder.CreateIndex(
name: "IX_RecitationErrorReports_ReporterId",
table: "RecitationErrorReports",
column: "ReporterId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "RecitationErrorReports");
}
}
}

View File

@ -1520,6 +1520,35 @@ namespace RMuseum.Migrations
b.ToTable("Recitations");
});
modelBuilder.Entity("RMuseum.Models.GanjoorAudio.RecitationErrorReport", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
b.Property<DateTime>("DateTime")
.HasColumnType("datetime2");
b.Property<string>("ReasonText")
.HasColumnType("nvarchar(max)");
b.Property<int>("RecitationId")
.HasColumnType("int");
b.Property<Guid?>("ReporterId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.HasIndex("RecitationId");
b.HasIndex("ReporterId");
b.ToTable("RecitationErrorReports");
});
modelBuilder.Entity("RMuseum.Models.GanjoorAudio.RecitationPublishingTracker", b =>
{
b.Property<Guid>("Id")
@ -3103,6 +3132,23 @@ namespace RMuseum.Migrations
b.Navigation("Reviewer");
});
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")

View File

@ -31,12 +31,12 @@ namespace RMuseum.Models.GanjoorAudio
/// <summary>
/// Reporter User Id
/// </summary>
public Guid ReporterId { get; set; }
public Guid? ReporterId { get; set; }
/// <summary>
/// Reporter User
/// </summary>
public RAppUser Reporter { get; set; }
public virtual RAppUser Reporter { get; set; }
/// <summary>
/// DateTime

View File

@ -2234,6 +2234,11 @@
Reported User Notes
</summary>
</member>
<member name="P:RMuseum.DbContext.RMuseumDbContext.RecitationErrorReports">
<summary>
recitation error reports
</summary>
</member>
<member name="T:RMuseum.Models.Accounting.DonationExpenditure">
<summary>
donation expenditures