#268 adding db migration

This commit is contained in:
Hamid Reza Mohammadi 2021-12-30 09:43:13 +03:30
parent bd5f8a4743
commit 86870eed89
3 changed files with 3705 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,43 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace RMuseum.Migrations
{
public partial class ProbableMetres : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "GanjoorPoemProbableMetres",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
PoemId = table.Column<int>(type: "int", nullable: false),
Metre = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_GanjoorPoemProbableMetres", x => x.Id);
table.ForeignKey(
name: "FK_GanjoorPoemProbableMetres_GanjoorPoems_PoemId",
column: x => x.PoemId,
principalTable: "GanjoorPoems",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_GanjoorPoemProbableMetres_PoemId",
table: "GanjoorPoemProbableMetres",
column: "PoemId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "GanjoorPoemProbableMetres");
}
}
}

View File

@ -1060,6 +1060,27 @@ namespace RMuseum.Migrations
b.ToTable("GanjoorPoemCorrections");
});
modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPoemProbableMetre", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
b.Property<string>("Metre")
.HasColumnType("nvarchar(max)");
b.Property<int>("PoemId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("PoemId");
b.ToTable("GanjoorPoemProbableMetres");
});
modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPoemTranslation", b =>
{
b.Property<int>("Id")
@ -3020,6 +3041,17 @@ namespace RMuseum.Migrations
b.Navigation("User");
});
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.GanjoorPoemTranslation", b =>
{
b.HasOne("RMuseum.Models.Ganjoor.GanjoorLanguage", "Language")