Improved Category Ladders

This commit is contained in:
Mbucari 2023-07-18 08:59:42 -06:00
parent ea6adeb58f
commit 3211b2dc85
11 changed files with 132 additions and 160 deletions

View file

@ -11,8 +11,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace DataLayer.Migrations
{
[DbContext(typeof(LibationContext))]
[Migration("20230717220642_AddCategoriesList")]
partial class AddCategoriesList
[Migration("20230718214617_AddCategoryLadder")]
partial class AddCategoryLadder
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@ -144,14 +144,6 @@ namespace DataLayer.Migrations
b.HasIndex("AudibleCategoryId");
b.ToTable("Categories");
b.HasData(
new
{
CategoryId = -1,
AudibleCategoryId = "",
Name = ""
});
});
modelBuilder.Entity("DataLayer.CategoryLadder", b =>
@ -163,12 +155,6 @@ namespace DataLayer.Migrations
b.HasKey("CategoryLadderId");
b.ToTable("CategoryLadders");
b.HasData(
new
{
CategoryLadderId = -1
});
});
modelBuilder.Entity("DataLayer.Contributor", b =>

View file

@ -5,7 +5,7 @@
namespace DataLayer.Migrations
{
/// <inheritdoc />
public partial class AddCategoriesList : Migration
public partial class AddCategoryLadder : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
@ -26,6 +26,11 @@ namespace DataLayer.Migrations
name: "IX_Books_CategoryId",
table: "Books");
migrationBuilder.DeleteData(
table: "Categories",
keyColumn: "CategoryId",
keyValue: -1);
migrationBuilder.DropColumn(
name: "ParentCategoryCategoryId",
table: "Categories");
@ -94,11 +99,6 @@ namespace DataLayer.Migrations
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.InsertData(
table: "CategoryLadders",
column: "CategoryLadderId",
value: -1);
migrationBuilder.CreateIndex(
name: "IX_BookCategory_BookId",
table: "BookCategory",
@ -140,12 +140,10 @@ namespace DataLayer.Migrations
nullable: false,
defaultValue: 0);
migrationBuilder.UpdateData(
migrationBuilder.InsertData(
table: "Categories",
keyColumn: "CategoryId",
keyValue: -1,
column: "ParentCategoryCategoryId",
value: null);
columns: new[] { "CategoryId", "AudibleCategoryId", "Name", "ParentCategoryCategoryId" },
values: new object[] { -1, "", "", null });
migrationBuilder.CreateIndex(
name: "IX_Categories_ParentCategoryCategoryId",

View file

@ -141,14 +141,6 @@ namespace DataLayer.Migrations
b.HasIndex("AudibleCategoryId");
b.ToTable("Categories");
b.HasData(
new
{
CategoryId = -1,
AudibleCategoryId = "",
Name = ""
});
});
modelBuilder.Entity("DataLayer.CategoryLadder", b =>
@ -160,12 +152,6 @@ namespace DataLayer.Migrations
b.HasKey("CategoryLadderId");
b.ToTable("CategoryLadders");
b.HasData(
new
{
CategoryLadderId = -1
});
});
modelBuilder.Entity("DataLayer.Contributor", b =>