#221 model changes and database migration
This commit is contained in:
parent
61801ac207
commit
a4a8ee32b2
@ -134,6 +134,12 @@ namespace RMuseum.DbContext
|
||||
builder.Entity<GanjoorVerseNumber>()
|
||||
.HasIndex(n => new { n.PoemId, n.CoupletIndex });
|
||||
|
||||
builder.Entity<GanjoorVerse>()
|
||||
.HasIndex(v => v.PoemId);//the next statement causes a drop index in the migration which this line prevents it
|
||||
|
||||
builder.Entity<GanjoorVerse>()
|
||||
.HasIndex(v => new { v.PoemId, v.CoupletIndex });
|
||||
|
||||
|
||||
//Index set suggested by SQL Server Tuning Wizard -- end
|
||||
|
||||
|
||||
3224
RMuseum/Migrations/20211009154010_GanjoorVerse-CoupletIndex.Designer.cs
generated
Normal file
3224
RMuseum/Migrations/20211009154010_GanjoorVerse-CoupletIndex.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,32 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace RMuseum.Migrations
|
||||
{
|
||||
public partial class GanjoorVerseCoupletIndex : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "CoupletIndex",
|
||||
table: "GanjoorVerses",
|
||||
type: "int",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GanjoorVerses_PoemId_CoupletIndex",
|
||||
table: "GanjoorVerses",
|
||||
columns: new[] { "PoemId", "CoupletIndex" });
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_GanjoorVerses_PoemId_CoupletIndex",
|
||||
table: "GanjoorVerses");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CoupletIndex",
|
||||
table: "GanjoorVerses");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1063,6 +1063,9 @@ namespace RMuseum.Migrations
|
||||
.HasColumnType("int")
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<int?>("CoupletIndex")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("PoemId")
|
||||
.HasColumnType("int");
|
||||
|
||||
@ -1079,6 +1082,8 @@ namespace RMuseum.Migrations
|
||||
|
||||
b.HasIndex("PoemId");
|
||||
|
||||
b.HasIndex("PoemId", "CoupletIndex");
|
||||
|
||||
b.ToTable("GanjoorVerses");
|
||||
});
|
||||
|
||||
|
||||
@ -34,5 +34,10 @@
|
||||
/// text
|
||||
/// </summary>
|
||||
public string Text { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// couplet index
|
||||
/// </summary>
|
||||
public int? CoupletIndex { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@ -5549,6 +5549,11 @@
|
||||
text
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:RMuseum.Models.Ganjoor.GanjoorVerse.CoupletIndex">
|
||||
<summary>
|
||||
couplet index
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:RMuseum.Models.Ganjoor.GanjoorVerseNumber.Id">
|
||||
<summary>
|
||||
id
|
||||
|
||||
Loading…
Reference in New Issue
Block a user