Add position column to pages (migration 020), update listBySpace to ORDER BY position, title, expose position in update(), add to patchSchema, and replace the space view flat table with a tree renderer grouping pages by parent_id under h4 section headers. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
4 lines
239 B
SQL
4 lines
239 B
SQL
-- 020: explicit page ordering within a space (and within a parent).
|
|
ALTER TABLE pages ADD COLUMN IF NOT EXISTS position integer NOT NULL DEFAULT 0;
|
|
CREATE INDEX IF NOT EXISTS idx_pages_space_position ON pages (space_id, position, title);
|