#200 db migration
This commit is contained in:
parent
88ca47e0fa
commit
1e34118661
2900
RMuseum/Migrations/20210905162049_GanjoorComment-Verse12.Designer.cs
generated
Normal file
2900
RMuseum/Migrations/20210905162049_GanjoorComment-Verse12.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
85
RMuseum/Migrations/20210905162049_GanjoorComment-Verse12.cs
Normal file
85
RMuseum/Migrations/20210905162049_GanjoorComment-Verse12.cs
Normal 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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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 =>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user