docs: #302 database migration
This commit is contained in:
parent
305bcad7cd
commit
ecda39ded9
3951
RMuseum/Migrations/20220327133930_DuplicatesDbModel.Designer.cs
generated
Normal file
3951
RMuseum/Migrations/20220327133930_DuplicatesDbModel.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
54
RMuseum/Migrations/20220327133930_DuplicatesDbModel.cs
Normal file
54
RMuseum/Migrations/20220327133930_DuplicatesDbModel.cs
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace RMuseum.Migrations
|
||||||
|
{
|
||||||
|
public partial class DuplicatesDbModel : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "GanjoorDuplicates",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
||||||
|
SrcCatId = table.Column<int>(type: "int", nullable: false),
|
||||||
|
SrcPoemId = table.Column<int>(type: "int", nullable: false),
|
||||||
|
DestPoemId = table.Column<int>(type: "int", nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_GanjoorDuplicates", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_GanjoorDuplicates_GanjoorPoems_DestPoemId",
|
||||||
|
column: x => x.DestPoemId,
|
||||||
|
principalTable: "GanjoorPoems",
|
||||||
|
principalColumn: "Id");
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_GanjoorDuplicates_GanjoorPoems_SrcPoemId",
|
||||||
|
column: x => x.SrcPoemId,
|
||||||
|
principalTable: "GanjoorPoems",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_GanjoorDuplicates_DestPoemId",
|
||||||
|
table: "GanjoorDuplicates",
|
||||||
|
column: "DestPoemId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_GanjoorDuplicates_SrcPoemId",
|
||||||
|
table: "GanjoorDuplicates",
|
||||||
|
column: "SrcPoemId");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "GanjoorDuplicates");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -765,6 +765,32 @@ namespace RMuseum.Migrations
|
|||||||
b.ToTable("GanjoorReportedComments");
|
b.ToTable("GanjoorReportedComments");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorDuplicate", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
|
||||||
|
|
||||||
|
b.Property<int?>("DestPoemId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("SrcCatId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("SrcPoemId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("DestPoemId");
|
||||||
|
|
||||||
|
b.HasIndex("SrcPoemId");
|
||||||
|
|
||||||
|
b.ToTable("GanjoorDuplicates");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorGeoLocation", b =>
|
modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorGeoLocation", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("Id")
|
b.Property<int>("Id")
|
||||||
@ -3151,6 +3177,23 @@ namespace RMuseum.Migrations
|
|||||||
b.Navigation("ReportedBy");
|
b.Navigation("ReportedBy");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorDuplicate", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("RMuseum.Models.Ganjoor.GanjoorPoem", "DestPoem")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("DestPoemId");
|
||||||
|
|
||||||
|
b.HasOne("RMuseum.Models.Ganjoor.GanjoorPoem", "SrcPoem")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("SrcPoemId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("DestPoem");
|
||||||
|
|
||||||
|
b.Navigation("SrcPoem");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorNumbering", b =>
|
modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorNumbering", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("RMuseum.Models.Ganjoor.GanjoorCat", "EndCat")
|
b.HasOne("RMuseum.Models.Ganjoor.GanjoorCat", "EndCat")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user