Files
session-mcp/migrations/008_task_commits.sql
Christian Gick 5015b1416f feat: Add version management, session tracking, and commit linking
Phase 1: Version Management
- Migration 006: Add git_tag, git_sha columns to versions
- New tools: version_add, version_list, version_show, version_update,
  version_release, version_assign_task
- Links versions to git tags for release tracking

Phase 2: Session/Task Activity Tracking
- Migration 007: Create task_activity table
- Track task changes per session (created, updated, status_change, closed)
- Session ID from env/cache file (usage-stats format)
- New tool: session_tasks to query tasks by session

Phase 3: Commit-Task Linking
- Migration 008: Create task_commits junction table
- New tools: task_commit_add, task_commit_remove, task_commits_list,
  task_link_commits (batch parsing)
- Stores SHA references only (Gitea MCP owns full data)
- Commits shown in task_show output

17 new MCP tools total. All migrations applied to docker-host postgres.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 10:28:21 +02:00

17 lines
711 B
SQL

-- Migration 008: Task-commit linking
-- Links tasks to git commits via SHA references (Gitea MCP owns full commit data)
CREATE TABLE IF NOT EXISTS task_commits (
id SERIAL PRIMARY KEY,
task_id TEXT NOT NULL REFERENCES tasks(id) ON DELETE CASCADE,
commit_sha TEXT NOT NULL,
repo TEXT NOT NULL,
source TEXT DEFAULT 'manual' CHECK (source IN ('manual', 'parsed', 'pr_merge')),
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
UNIQUE(task_id, commit_sha)
);
CREATE INDEX IF NOT EXISTS idx_task_commits_task ON task_commits(task_id);
CREATE INDEX IF NOT EXISTS idx_task_commits_sha ON task_commits(commit_sha);
CREATE INDEX IF NOT EXISTS idx_task_commits_repo ON task_commits(repo);