#200 db migration

This commit is contained in:
Hamid Reza Mohammadi 2021-09-06 17:48:50 +04:30
parent 88ca47e0fa
commit 1e34118661
3 changed files with 3010 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,85 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace RMuseum.Migrations
{
public partial class GanjoorCommentVerse12 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "Verse12d",
table: "GanjoorComments",
type: "int",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "Verse1Id",
table: "GanjoorComments",
type: "int",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "Verse2Id",
table: "GanjoorComments",
type: "int",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_GanjoorComments_Verse1Id",
table: "GanjoorComments",
column: "Verse1Id");
migrationBuilder.CreateIndex(
name: "IX_GanjoorComments_Verse2Id",
table: "GanjoorComments",
column: "Verse2Id");
migrationBuilder.AddForeignKey(
name: "FK_GanjoorComments_GanjoorVerses_Verse1Id",
table: "GanjoorComments",
column: "Verse1Id",
principalTable: "GanjoorVerses",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_GanjoorComments_GanjoorVerses_Verse2Id",
table: "GanjoorComments",
column: "Verse2Id",
principalTable: "GanjoorVerses",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_GanjoorComments_GanjoorVerses_Verse1Id",
table: "GanjoorComments");
migrationBuilder.DropForeignKey(
name: "FK_GanjoorComments_GanjoorVerses_Verse2Id",
table: "GanjoorComments");
migrationBuilder.DropIndex(
name: "IX_GanjoorComments_Verse1Id",
table: "GanjoorComments");
migrationBuilder.DropIndex(
name: "IX_GanjoorComments_Verse2Id",
table: "GanjoorComments");
migrationBuilder.DropColumn(
name: "Verse12d",
table: "GanjoorComments");
migrationBuilder.DropColumn(
name: "Verse1Id",
table: "GanjoorComments");
migrationBuilder.DropColumn(
name: "Verse2Id",
table: "GanjoorComments");
}
}
}

View File

@ -500,6 +500,15 @@ namespace RMuseum.Migrations
b.Property<Guid?>("UserId")
.HasColumnType("uniqueidentifier");
b.Property<int?>("Verse12d")
.HasColumnType("int");
b.Property<int?>("Verse1Id")
.HasColumnType("int");
b.Property<int?>("Verse2Id")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CommentDate");
@ -512,6 +521,10 @@ namespace RMuseum.Migrations
b.HasIndex("UserId");
b.HasIndex("Verse1Id");
b.HasIndex("Verse2Id");
b.ToTable("GanjoorComments");
});
@ -2335,11 +2348,23 @@ namespace RMuseum.Migrations
.WithMany()
.HasForeignKey("UserId");
b.HasOne("RMuseum.Models.Ganjoor.GanjoorVerse", "Verse1")
.WithMany()
.HasForeignKey("Verse1Id");
b.HasOne("RMuseum.Models.Ganjoor.GanjoorVerse", "Verse2")
.WithMany()
.HasForeignKey("Verse2Id");
b.Navigation("InReplyTo");
b.Navigation("Poem");
b.Navigation("User");
b.Navigation("Verse1");
b.Navigation("Verse2");
});
modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorCommentAbuseReport", b =>