docs: #352 poem geo date tags db migration

This commit is contained in:
Hamid Reza Mohammadi 2022-08-01 22:49:20 +04:30
parent eba5e0bc1b
commit ac8b141363
3 changed files with 4520 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,58 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace RMuseum.Migrations
{
public partial class PoemGeoDateTagFields : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "PoemGeoDateTags",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
PoemId = table.Column<int>(type: "int", nullable: false),
CoupletIndex = table.Column<int>(type: "int", nullable: false),
LocationId = table.Column<int>(type: "int", nullable: true),
LunarYear = table.Column<int>(type: "int", nullable: true),
LunarMonth = table.Column<int>(type: "int", nullable: true),
LunarDay = table.Column<int>(type: "int", nullable: true),
LunarDateTotalNumber = table.Column<int>(type: "int", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_PoemGeoDateTags", x => x.Id);
table.ForeignKey(
name: "FK_PoemGeoDateTags_GanjoorGeoLocations_LocationId",
column: x => x.LocationId,
principalTable: "GanjoorGeoLocations",
principalColumn: "Id");
table.ForeignKey(
name: "FK_PoemGeoDateTags_GanjoorPoems_PoemId",
column: x => x.PoemId,
principalTable: "GanjoorPoems",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_PoemGeoDateTags_LocationId",
table: "PoemGeoDateTags",
column: "LocationId");
migrationBuilder.CreateIndex(
name: "IX_PoemGeoDateTags_PoemId",
table: "PoemGeoDateTags",
column: "PoemId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "PoemGeoDateTags");
}
}
}

View File

@ -1920,6 +1920,44 @@ namespace RMuseum.Migrations
b.ToTable("GanjoorVerseVOrderText");
});
modelBuilder.Entity("RMuseum.Models.Ganjoor.PoemGeoDateTag", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
b.Property<int>("CoupletIndex")
.HasColumnType("int");
b.Property<int?>("LocationId")
.HasColumnType("int");
b.Property<int?>("LunarDateTotalNumber")
.HasColumnType("int");
b.Property<int?>("LunarDay")
.HasColumnType("int");
b.Property<int?>("LunarMonth")
.HasColumnType("int");
b.Property<int?>("LunarYear")
.HasColumnType("int");
b.Property<int>("PoemId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("LocationId");
b.HasIndex("PoemId");
b.ToTable("PoemGeoDateTags");
});
modelBuilder.Entity("RMuseum.Models.Ganjoor.PoemMusicTrack", b =>
{
b.Property<int>("Id")
@ -3896,6 +3934,23 @@ namespace RMuseum.Migrations
.HasForeignKey("GanjoorPoemCorrectionId");
});
modelBuilder.Entity("RMuseum.Models.Ganjoor.PoemGeoDateTag", b =>
{
b.HasOne("RMuseum.Models.Ganjoor.GanjoorGeoLocation", "Location")
.WithMany()
.HasForeignKey("LocationId");
b.HasOne("RMuseum.Models.Ganjoor.GanjoorPoem", "Poem")
.WithMany()
.HasForeignKey("PoemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Location");
b.Navigation("Poem");
});
modelBuilder.Entity("RMuseum.Models.Ganjoor.PoemMusicTrack", b =>
{
b.HasOne("RMuseum.Models.MusicCatalogue.GanjoorTrack", "GanjoorTrack")