# Data Models and Schema Changes

## Existing Collections Analysis
The Directus instance has 26 custom collections including:
- **projects** - Project management with status, priority, ownership
- **tasks** - Task management with progress tracking, assignments
- **subtasks** - Hierarchical task breakdown
- **task_dependencies** - Inter-task relationships
- **ai_prompts** - Mature prompt management (164+ tools)

Current data includes 3 projects, 2 tasks, 11 tags, and prompt templates.

## Schema Integration Strategy

**Minimal Additive Changes:**
```sql
-- Extend existing tasks table
ALTER TABLE tasks ADD COLUMN task_master_id VARCHAR(255);
ALTER TABLE tasks ADD COLUMN external_refs JSON;
ALTER TABLE tasks ADD COLUMN ai_context JSON;

-- Extend existing projects table  
ALTER TABLE projects ADD COLUMN repository_url VARCHAR(255);
ALTER TABLE projects ADD COLUMN bmad_workflow_type VARCHAR(50);
ALTER TABLE projects ADD COLUMN task_master_project_path VARCHAR(255);
```

**Backward Compatibility:**
- All existing data preserved
- Current MCP tools continue unchanged
- Zero breaking changes
