Add IsPinned and IsDeleted properties to Note entity with corresponding database configurations and migrations

This commit enhances the Note entity by introducing two new properties: IsPinned and IsDeleted, allowing for better management of note visibility and status. The NoteConfiguration class has been updated to include indexes for these properties, improving query performance. Additionally, new migrations have been created to reflect these changes in the database schema. The UI components have been updated to support pinning and restoring notes, enhancing user interaction and functionality within the note management system.
This commit is contained in:
2026-01-16 23:12:18 -05:00
parent 5f2d7b5b31
commit 8b0451c2ec
16 changed files with 1261 additions and 56 deletions
@@ -11,8 +11,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace Data.Migrations
{
[DbContext(typeof(AppDbContext))]
[Migration("20260115185640_AddNotesAndNoteHistory")]
partial class AddNotesAndNoteHistory
[Migration("20260116235231_AddNoteIsPinnedAndIsDeleted")]
partial class AddNoteIsPinnedAndIsDeleted
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@@ -196,6 +196,12 @@ namespace Data.Migrations
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<bool>("IsDeleted")
.HasColumnType("INTEGER");
b.Property<bool>("IsPinned")
.HasColumnType("INTEGER");
b.Property<string>("LastModifiedBy")
.HasMaxLength(255)
.HasColumnType("TEXT");
@@ -212,6 +218,10 @@ namespace Data.Migrations
b.HasIndex("CreatedAt");
b.HasIndex("IsDeleted");
b.HasIndex("IsPinned");
b.HasIndex("Title");
b.ToTable("Notes");
@@ -6,7 +6,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
namespace Data.Migrations
{
/// <inheritdoc />
public partial class AddNotesAndNoteHistory : Migration
public partial class AddNoteIsPinnedAndIsDeleted : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
@@ -22,7 +22,9 @@ namespace Data.Migrations
CreatedAt = table.Column<DateTime>(type: "TEXT", nullable: false),
UpdatedAt = table.Column<DateTime>(type: "TEXT", nullable: false),
CreatedBy = table.Column<string>(type: "TEXT", maxLength: 255, nullable: true),
LastModifiedBy = table.Column<string>(type: "TEXT", maxLength: 255, nullable: true)
LastModifiedBy = table.Column<string>(type: "TEXT", maxLength: 255, nullable: true),
IsPinned = table.Column<bool>(type: "INTEGER", nullable: false),
IsDeleted = table.Column<bool>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
@@ -73,6 +75,16 @@ namespace Data.Migrations
table: "Notes",
column: "CreatedAt");
migrationBuilder.CreateIndex(
name: "IX_Notes_IsDeleted",
table: "Notes",
column: "IsDeleted");
migrationBuilder.CreateIndex(
name: "IX_Notes_IsPinned",
table: "Notes",
column: "IsPinned");
migrationBuilder.CreateIndex(
name: "IX_Notes_Title",
table: "Notes",
@@ -193,6 +193,12 @@ namespace Data.Migrations
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<bool>("IsDeleted")
.HasColumnType("INTEGER");
b.Property<bool>("IsPinned")
.HasColumnType("INTEGER");
b.Property<string>("LastModifiedBy")
.HasMaxLength(255)
.HasColumnType("TEXT");
@@ -209,6 +215,10 @@ namespace Data.Migrations
b.HasIndex("CreatedAt");
b.HasIndex("IsDeleted");
b.HasIndex("IsPinned");
b.HasIndex("Title");
b.ToTable("Notes");