feat: Add more link types to task system
New link types added: - depends_on: Task depends on another task to complete first - needs: Task needs another task (weaker dependency) - implements: Task implements a feature/requirement - fixes: Task fixes an issue identified in another task - causes: Task causes/introduces issue in another task - subtask_of: Task is a subtask of another (parent-child) Preserves existing types: blocks, relates_to, duplicates Changes: - Migration 021 updates database constraint - Updated TypeScript types and MCP tool schema - Applied to production database Implements CF-385 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
39
migrations/021_add_link_types.sql
Normal file
39
migrations/021_add_link_types.sql
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
-- Migration 021: Add more link types to task_links table
|
||||||
|
-- CF-385: Add more link types to task system (needs, depends_on, etc.)
|
||||||
|
--
|
||||||
|
-- New link types:
|
||||||
|
-- depends_on - Task depends on another task to complete first
|
||||||
|
-- needs - Task needs another task (similar to depends_on but weaker)
|
||||||
|
-- implements - Task implements a feature/requirement from another task
|
||||||
|
-- fixes - Task fixes an issue identified in another task
|
||||||
|
-- causes - Task causes/introduces issue in another task
|
||||||
|
-- subtask_of - Task is a subtask of another (parent-child relationship)
|
||||||
|
--
|
||||||
|
-- Existing types preserved:
|
||||||
|
-- blocks - Task blocks another task
|
||||||
|
-- relates_to - Generic relationship
|
||||||
|
-- duplicates - Task is a duplicate of another
|
||||||
|
|
||||||
|
-- Drop existing constraint
|
||||||
|
ALTER TABLE task_links DROP CONSTRAINT IF EXISTS task_links_link_type_check;
|
||||||
|
|
||||||
|
-- Add new constraint with extended link types
|
||||||
|
ALTER TABLE task_links ADD CONSTRAINT task_links_link_type_check
|
||||||
|
CHECK (link_type IN (
|
||||||
|
'blocks',
|
||||||
|
'relates_to',
|
||||||
|
'duplicates',
|
||||||
|
'depends_on',
|
||||||
|
'needs',
|
||||||
|
'implements',
|
||||||
|
'fixes',
|
||||||
|
'causes',
|
||||||
|
'subtask_of'
|
||||||
|
));
|
||||||
|
|
||||||
|
-- Add comments for documentation
|
||||||
|
COMMENT ON COLUMN task_links.link_type IS 'Type of relationship between tasks: blocks, relates_to, duplicates, depends_on, needs, implements, fixes, causes, subtask_of (CF-385)';
|
||||||
|
|
||||||
|
-- Record migration
|
||||||
|
INSERT INTO schema_migrations (version, applied_at) VALUES ('021_add_link_types', NOW())
|
||||||
|
ON CONFLICT DO NOTHING;
|
||||||
@@ -133,7 +133,7 @@ export const toolDefinitions = [
|
|||||||
properties: {
|
properties: {
|
||||||
from_id: { type: 'string', description: 'Source task ID' },
|
from_id: { type: 'string', description: 'Source task ID' },
|
||||||
to_id: { type: 'string', description: 'Target task ID' },
|
to_id: { type: 'string', description: 'Target task ID' },
|
||||||
link_type: { type: 'string', enum: ['blocks', 'relates_to', 'duplicates'], description: 'Relationship type' },
|
link_type: { type: 'string', enum: ['blocks', 'relates_to', 'duplicates', 'depends_on', 'needs', 'implements', 'fixes', 'causes', 'subtask_of'], description: 'Relationship type' },
|
||||||
},
|
},
|
||||||
required: ['from_id', 'to_id', 'link_type'],
|
required: ['from_id', 'to_id', 'link_type'],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export interface TaskLink {
|
|||||||
id: number;
|
id: number;
|
||||||
from_task_id: string;
|
from_task_id: string;
|
||||||
to_task_id: string;
|
to_task_id: string;
|
||||||
link_type: 'blocks' | 'relates_to' | 'duplicates';
|
link_type: 'blocks' | 'relates_to' | 'duplicates' | 'depends_on' | 'needs' | 'implements' | 'fixes' | 'causes' | 'subtask_of';
|
||||||
created_at: Date;
|
created_at: Date;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user