feat(data): list_folders table plus lists.folder_id
Sidebar folders get their own table rather than a flag on lists, so the places that enumerate lists (MCP tools, move-to-list, queue picker, repo import) need no folder filtering. ON DELETE SET NULL keeps a folder's lists alive when the folder goes.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
using ClaudeDo.Data.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace ClaudeDo.Data.Configuration;
|
||||
|
||||
public class ListFolderEntityConfiguration : IEntityTypeConfiguration<ListFolderEntity>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<ListFolderEntity> builder)
|
||||
{
|
||||
builder.ToTable("list_folders");
|
||||
|
||||
builder.HasKey(f => f.Id);
|
||||
builder.Property(f => f.Id).HasColumnName("id");
|
||||
builder.Property(f => f.Name).HasColumnName("name").IsRequired();
|
||||
builder.Property(f => f.CreatedAt).HasColumnName("created_at").IsRequired();
|
||||
builder.Property(f => f.Icon).HasColumnName("icon");
|
||||
builder.Property(f => f.SortOrder).HasColumnName("sort_order").IsRequired().HasDefaultValue(0);
|
||||
builder.Property(f => f.IsCollapsed).HasColumnName("is_collapsed").IsRequired().HasDefaultValue(false);
|
||||
|
||||
builder.HasIndex(f => f.SortOrder).HasDatabaseName("idx_list_folders_sort");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user