#224 db migration
This commit is contained in:
parent
8e2cf5e048
commit
1526b9f885
3252
RMuseum/Migrations/20211021064655_GanjoorHalfCenturies.Designer.cs
generated
Normal file
3252
RMuseum/Migrations/20211021064655_GanjoorHalfCenturies.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
86
RMuseum/Migrations/20211021064655_GanjoorHalfCenturies.cs
Normal file
86
RMuseum/Migrations/20211021064655_GanjoorHalfCenturies.cs
Normal file
@ -0,0 +1,86 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace RMuseum.Migrations
|
||||
{
|
||||
public partial class GanjoorHalfCenturies : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "BirthYearInLHijri",
|
||||
table: "GanjoorPoets",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "DeathYearInLHijri",
|
||||
table: "GanjoorPoets",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "GanjoorHalfCenturyId",
|
||||
table: "GanjoorPoets",
|
||||
type: "int",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "GanjoorHalfCenturies",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
HalfCenturyOrder = table.Column<int>(type: "int", nullable: false),
|
||||
StartYear = table.Column<int>(type: "int", nullable: false),
|
||||
EndYear = table.Column<int>(type: "int", nullable: false),
|
||||
ShowInTimeLine = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_GanjoorHalfCenturies", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GanjoorPoets_GanjoorHalfCenturyId",
|
||||
table: "GanjoorPoets",
|
||||
column: "GanjoorHalfCenturyId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_GanjoorPoets_GanjoorHalfCenturies_GanjoorHalfCenturyId",
|
||||
table: "GanjoorPoets",
|
||||
column: "GanjoorHalfCenturyId",
|
||||
principalTable: "GanjoorHalfCenturies",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_GanjoorPoets_GanjoorHalfCenturies_GanjoorHalfCenturyId",
|
||||
table: "GanjoorPoets");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "GanjoorHalfCenturies");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_GanjoorPoets_GanjoorHalfCenturyId",
|
||||
table: "GanjoorPoets");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "BirthYearInLHijri",
|
||||
table: "GanjoorPoets");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DeathYearInLHijri",
|
||||
table: "GanjoorPoets");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "GanjoorHalfCenturyId",
|
||||
table: "GanjoorPoets");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -559,6 +559,33 @@ namespace RMuseum.Migrations
|
||||
b.ToTable("GanjoorReportedComments");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorHalfCentury", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<int>("EndYear")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("HalfCenturyOrder")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("ShowInTimeLine")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<int>("StartYear")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("GanjoorHalfCenturies");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorHealthCheckError", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
@ -967,9 +994,18 @@ namespace RMuseum.Migrations
|
||||
b.Property<int>("Id")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("BirthYearInLHijri")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("DeathYearInLHijri")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int?>("GanjoorHalfCenturyId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
@ -984,6 +1020,8 @@ namespace RMuseum.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("GanjoorHalfCenturyId");
|
||||
|
||||
b.HasIndex("RImageId");
|
||||
|
||||
b.HasIndex("Published", "Id")
|
||||
@ -2735,6 +2773,10 @@ namespace RMuseum.Migrations
|
||||
|
||||
modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPoet", b =>
|
||||
{
|
||||
b.HasOne("RMuseum.Models.Ganjoor.GanjoorHalfCentury", null)
|
||||
.WithMany("Poets")
|
||||
.HasForeignKey("GanjoorHalfCenturyId");
|
||||
|
||||
b.HasOne("RSecurityBackend.Models.Image.RImage", "RImage")
|
||||
.WithMany()
|
||||
.HasForeignKey("RImageId");
|
||||
@ -3158,6 +3200,11 @@ namespace RMuseum.Migrations
|
||||
b.Navigation("Tags");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorHalfCentury", b =>
|
||||
{
|
||||
b.Navigation("Poets");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPoemCorrection", b =>
|
||||
{
|
||||
b.Navigation("VerseOrderText");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user