docs: #319 db migrations for section corrections

This commit is contained in:
Hamid Reza Mohammadi 2022-05-12 20:38:29 +04:30
parent 020e108ae3
commit 8e10053e92
3 changed files with 4459 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,87 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace RMuseum.Migrations
{
public partial class SugCorrections4Sections : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "GanjoorPoemSectionCorrections",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
SectionId = table.Column<int>(type: "int", nullable: false),
Rhythm = table.Column<string>(type: "nvarchar(max)", nullable: true),
OriginalRhythm = table.Column<string>(type: "nvarchar(max)", nullable: true),
RhythmResult = table.Column<int>(type: "int", nullable: false),
Rhythm2 = table.Column<string>(type: "nvarchar(max)", nullable: true),
OriginalRhythm2 = table.Column<string>(type: "nvarchar(max)", nullable: true),
RhythmResult2 = table.Column<int>(type: "int", nullable: false),
BreakFromVerse1VOrder = table.Column<int>(type: "int", nullable: true),
BreakFromVerse1VOrderResult = table.Column<int>(type: "int", nullable: false),
BreakFromVerse2VOrder = table.Column<int>(type: "int", nullable: true),
BreakFromVerse2VOrderResult = table.Column<int>(type: "int", nullable: false),
BreakFromVerse3VOrder = table.Column<int>(type: "int", nullable: true),
BreakFromVerse3VOrderResult = table.Column<int>(type: "int", nullable: false),
BreakFromVerse4VOrder = table.Column<int>(type: "int", nullable: true),
BreakFromVerse4VOrderResult = table.Column<int>(type: "int", nullable: false),
Note = table.Column<string>(type: "nvarchar(max)", nullable: true),
Date = table.Column<DateTime>(type: "datetime2", nullable: false),
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Reviewed = table.Column<bool>(type: "bit", nullable: false),
ReviewDate = table.Column<DateTime>(type: "datetime2", nullable: false),
ReviewNote = table.Column<string>(type: "nvarchar(max)", nullable: true),
ReviewerUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
ApplicationOrder = table.Column<int>(type: "int", nullable: false),
AffectedThePoem = table.Column<bool>(type: "bit", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_GanjoorPoemSectionCorrections", x => x.Id);
table.ForeignKey(
name: "FK_GanjoorPoemSectionCorrections_AspNetUsers_ReviewerUserId",
column: x => x.ReviewerUserId,
principalTable: "AspNetUsers",
principalColumn: "Id");
table.ForeignKey(
name: "FK_GanjoorPoemSectionCorrections_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_GanjoorPoemSectionCorrections_GanjoorPoemSections_SectionId",
column: x => x.SectionId,
principalTable: "GanjoorPoemSections",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_GanjoorPoemSectionCorrections_ReviewerUserId",
table: "GanjoorPoemSectionCorrections",
column: "ReviewerUserId");
migrationBuilder.CreateIndex(
name: "IX_GanjoorPoemSectionCorrections_SectionId",
table: "GanjoorPoemSectionCorrections",
column: "SectionId");
migrationBuilder.CreateIndex(
name: "IX_GanjoorPoemSectionCorrections_UserId",
table: "GanjoorPoemSectionCorrections",
column: "UserId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "GanjoorPoemSectionCorrections");
}
}
}

View File

@ -1359,6 +1359,97 @@ namespace RMuseum.Migrations
b.ToTable("GanjoorPoemSections");
});
modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPoemSectionCorrection", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
b.Property<bool>("AffectedThePoem")
.HasColumnType("bit");
b.Property<int>("ApplicationOrder")
.HasColumnType("int");
b.Property<int?>("BreakFromVerse1VOrder")
.HasColumnType("int");
b.Property<int>("BreakFromVerse1VOrderResult")
.HasColumnType("int");
b.Property<int?>("BreakFromVerse2VOrder")
.HasColumnType("int");
b.Property<int>("BreakFromVerse2VOrderResult")
.HasColumnType("int");
b.Property<int?>("BreakFromVerse3VOrder")
.HasColumnType("int");
b.Property<int>("BreakFromVerse3VOrderResult")
.HasColumnType("int");
b.Property<int?>("BreakFromVerse4VOrder")
.HasColumnType("int");
b.Property<int>("BreakFromVerse4VOrderResult")
.HasColumnType("int");
b.Property<DateTime>("Date")
.HasColumnType("datetime2");
b.Property<string>("Note")
.HasColumnType("nvarchar(max)");
b.Property<string>("OriginalRhythm")
.HasColumnType("nvarchar(max)");
b.Property<string>("OriginalRhythm2")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("ReviewDate")
.HasColumnType("datetime2");
b.Property<string>("ReviewNote")
.HasColumnType("nvarchar(max)");
b.Property<bool>("Reviewed")
.HasColumnType("bit");
b.Property<Guid?>("ReviewerUserId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Rhythm")
.HasColumnType("nvarchar(max)");
b.Property<string>("Rhythm2")
.HasColumnType("nvarchar(max)");
b.Property<int>("RhythmResult")
.HasColumnType("int");
b.Property<int>("RhythmResult2")
.HasColumnType("int");
b.Property<int>("SectionId")
.HasColumnType("int");
b.Property<Guid>("UserId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.HasIndex("ReviewerUserId");
b.HasIndex("SectionId");
b.HasIndex("UserId");
b.ToTable("GanjoorPoemSectionCorrections");
});
modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPoemTranslation", b =>
{
b.Property<int>("Id")
@ -3505,6 +3596,31 @@ namespace RMuseum.Migrations
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.GanjoorPoemTranslation", b =>
{
b.HasOne("RMuseum.Models.Ganjoor.GanjoorLanguage", "Language")