Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions apps/api/migrations/20261004120000_feeds_source.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-- Who created a live feed row: 'comment' (GitHub comment sync) or 'user'
-- (web, CLI, MCP, plugin). NULL on rows created before this column. Set on
-- insert only: a reused scope keeps its first source. The per-workspace cap
-- (apps/api/src/feeds.ts) counts live repo-scoped rows of any source (50) and
-- applies only to user creates; PR and issue feeds are uncapped, so comment
-- sync never falls back to /f/ links.
ALTER TABLE feeds ADD COLUMN source TEXT
CHECK (source IS NULL OR source IN ('comment', 'user'));
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-- PR title and state on the rollup row, for the Files "By pull request"
-- list and its state filter. Written by the pull_request webhook (rows whose
-- repo is linked to the row's workspace only) and backfilled by
-- GET /v1/workspaces/:ws/pulls from resolveTitles. NULL until either runs.
-- The cursor index serves ORDER BY last_media_at DESC, ref ASC keyset pages.
ALTER TABLE github_pr_activity ADD COLUMN title TEXT;
ALTER TABLE github_pr_activity ADD COLUMN state TEXT;
CREATE INDEX github_pr_activity_workspace_cursor_idx
ON github_pr_activity (workspace_name, last_media_at DESC, ref);
12 changes: 12 additions & 0 deletions apps/api/migrations/20261004120200_file_metadata_gh_repo_idx.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-- Newest-first scope reads (apps/api/src/pr-scope.ts: live links, Files
-- views, the pager) and the By repo list. Partial on purpose: only `gh.repo`
-- rows (one per GitHub-tagged object) pay the extra write, unlike the
-- all-rows value index dropped in 20260722190000. Serves
-- WHERE workspace = ? AND meta_key = 'gh.repo' AND meta_value = ?
-- ORDER BY updated_at DESC, object_key ASC
-- as a covering, in-order scan (no temp sort), so LIMIT stops early, and
-- the distinct-repo GROUP BY reads only this index. Queries must use the
-- literal 'gh.repo' (not a bound parameter) for SQLite to pick it.
CREATE INDEX IF NOT EXISTS file_metadata_gh_repo_recent_idx
ON file_metadata (workspace, meta_value, updated_at DESC, object_key)
WHERE meta_key = 'gh.repo';
1 change: 1 addition & 0 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"./gallery-service": "./src/gallery-service.ts",
"./feeds": "./src/feeds.ts",
"./feed-service": "./src/feed-service.ts",
"./scope-wire": "./src/scope-wire.ts",
"./external-references": "./src/external-references.ts",
"./uploader-identity": "./src/uploader-identity.ts",
"./github-comment-service": "./src/github-comment-service.ts",
Expand Down
Loading
Loading