Phase 1: Edge schema consolidation infrastructure (Decision 004)
Add metadata and thread_id columns to dependencies table to support: - Edge metadata: JSON blob for type-specific data (similarity scores, etc.) - Thread queries: O(1) conversation threading via thread_id Changes: - New migration 020_edge_consolidation.go - Updated Dependency struct with Metadata and ThreadID fields - Added new entity types: authored-by, assigned-to, approved-by - Relaxed DependencyType validation (any non-empty string ≤50 chars) - Added IsWellKnown() and AffectsReadyWork() methods - Updated SQL queries to include new columns - Updated tests for new behavior This enables HOP knowledge graph requirements and Reddit-style threading. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -43,13 +43,15 @@ CREATE INDEX IF NOT EXISTS idx_issues_assignee ON issues(assignee);
|
||||
CREATE INDEX IF NOT EXISTS idx_issues_created_at ON issues(created_at);
|
||||
-- Note: idx_issues_external_ref is created in migrations/002_external_ref_column.go
|
||||
|
||||
-- Dependencies table
|
||||
-- Dependencies table (edge schema - Decision 004)
|
||||
CREATE TABLE IF NOT EXISTS dependencies (
|
||||
issue_id TEXT NOT NULL,
|
||||
depends_on_id TEXT NOT NULL,
|
||||
type TEXT NOT NULL DEFAULT 'blocks',
|
||||
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
created_by TEXT NOT NULL,
|
||||
metadata TEXT DEFAULT '{}', -- JSON blob for type-specific edge data
|
||||
thread_id TEXT DEFAULT '', -- For efficient conversation threading queries
|
||||
PRIMARY KEY (issue_id, depends_on_id),
|
||||
FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE,
|
||||
FOREIGN KEY (depends_on_id) REFERENCES issues(id) ON DELETE CASCADE
|
||||
@@ -59,6 +61,8 @@ CREATE INDEX IF NOT EXISTS idx_dependencies_issue ON dependencies(issue_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_dependencies_depends_on ON dependencies(depends_on_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_dependencies_depends_on_type ON dependencies(depends_on_id, type);
|
||||
CREATE INDEX IF NOT EXISTS idx_dependencies_depends_on_type_issue ON dependencies(depends_on_id, type, issue_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_dependencies_thread ON dependencies(thread_id) WHERE thread_id != '';
|
||||
CREATE INDEX IF NOT EXISTS idx_dependencies_thread_type ON dependencies(thread_id, type) WHERE thread_id != '';
|
||||
|
||||
-- Labels table
|
||||
CREATE TABLE IF NOT EXISTS labels (
|
||||
|
||||
Reference in New Issue
Block a user