docs: #306 db migration

This commit is contained in:
Hamid Reza Mohammadi 2022-04-01 12:13:36 +04:30
parent ca38a545b1
commit 9a9b2fa7d8
3 changed files with 4109 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,65 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace RMuseum.Migrations
{
public partial class PoemSection : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "PoemSectionIndex",
table: "GanjoorVerses",
type: "int",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "SecondPoemSectionIndex",
table: "GanjoorVerses",
type: "int",
nullable: true);
migrationBuilder.CreateTable(
name: "GanjoorPoemSections",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Index = table.Column<int>(type: "int", nullable: false),
Number = table.Column<int>(type: "int", nullable: false),
SectionType = table.Column<int>(type: "int", nullable: false),
GanjoorMetreId = table.Column<int>(type: "int", nullable: true),
RhymeLetters = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_GanjoorPoemSections", x => x.Id);
table.ForeignKey(
name: "FK_GanjoorPoemSections_GanjoorMetres_GanjoorMetreId",
column: x => x.GanjoorMetreId,
principalTable: "GanjoorMetres",
principalColumn: "Id");
});
migrationBuilder.CreateIndex(
name: "IX_GanjoorPoemSections_GanjoorMetreId",
table: "GanjoorPoemSections",
column: "GanjoorMetreId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "GanjoorPoemSections");
migrationBuilder.DropColumn(
name: "PoemSectionIndex",
table: "GanjoorVerses");
migrationBuilder.DropColumn(
name: "SecondPoemSectionIndex",
table: "GanjoorVerses");
}
}
}

View File

@ -1219,6 +1219,36 @@ namespace RMuseum.Migrations
b.ToTable("GanjoorPoemProbableMetres");
});
modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPoemSection", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
b.Property<int?>("GanjoorMetreId")
.HasColumnType("int");
b.Property<int>("Index")
.HasColumnType("int");
b.Property<int>("Number")
.HasColumnType("int");
b.Property<string>("RhymeLetters")
.HasColumnType("nvarchar(max)");
b.Property<int>("SectionType")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("GanjoorMetreId");
b.ToTable("GanjoorPoemSections");
});
modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPoemTranslation", b =>
{
b.Property<int>("Id")
@ -1487,6 +1517,12 @@ namespace RMuseum.Migrations
b.Property<int>("PoemId")
.HasColumnType("int");
b.Property<int?>("PoemSectionIndex")
.HasColumnType("int");
b.Property<int?>("SecondPoemSectionIndex")
.HasColumnType("int");
b.Property<string>("Text")
.HasColumnType("nvarchar(max)");
@ -3319,6 +3355,15 @@ namespace RMuseum.Migrations
b.Navigation("Poem");
});
modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPoemSection", b =>
{
b.HasOne("RMuseum.Models.Ganjoor.GanjoorMetre", "GanjoorMetre")
.WithMany()
.HasForeignKey("GanjoorMetreId");
b.Navigation("GanjoorMetre");
});
modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPoemTranslation", b =>
{
b.HasOne("RMuseum.Models.Ganjoor.GanjoorLanguage", "Language")