Skip to content

Add sort_order and group columns to _emdash_collections #1

@ahliweb

Description

@ahliweb

Problem

Collections in the admin sidebar are sorted alphabetically by slug. There is no way to group collections (e.g., "Blog", "Products", "Team") -- everything is a flat list in the "Content" group.

Proposed Solution

Add sort_order (INTEGER, nullable) and group (TEXT, nullable) columns to _emdash_collections.

Migration

ALTER TABLE _emdash_collections ADD COLUMN sort_order INTEGER;
ALTER TABLE _emdash_collections ADD COLUMN group TEXT;

Changes

  • Update Collection interface in packages/core/src/schema/types.ts
  • Update CollectionConfig seed type to accept sortOrder and group
  • Update listCollectionsWithFields() to order by sort_order ASC, slug ASC
  • Seed apply/create handles sortOrder and group
  • Export-seed includes these fields

Acceptance Criteria

  • Migration created with up/down
  • Collection type includes sortOrder?: number and group?: string
  • listCollectionsWithFields() orders by sort_order ASC, slug ASC
  • Seed apply/create handles both fields
  • Backward compatible: existing collections get NULL

Notes

Depends on: none (foundational)
Blocks: #2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions