-- Migration: Add task planning fields to project_tasks and project_phases
-- Date: 2025-01-XX
-- Description: Adds assignee_skill, complexity, quality, and required_days columns to project_tasks table, and team_size to project_phases table

-- ===== Add task planning fields =====
ALTER TABLE project_tasks 
ADD COLUMN assignee_skill ENUM('low', 'medium', 'high') DEFAULT NULL COMMENT '担当者スキル（低、中、高）' AFTER assignee,
ADD COLUMN complexity ENUM('low', 'medium', 'high') DEFAULT NULL COMMENT '複雑度（低、中、高）' AFTER assignee_skill,
ADD COLUMN quality ENUM('low', 'medium', 'high') DEFAULT NULL COMMENT '必要クオリティ（低、中、高）' AFTER complexity,
ADD COLUMN required_days DECIMAL(10, 2) DEFAULT NULL COMMENT '所要日数（小数点以下第2位まで）' AFTER quality;

-- Add indexes for better query performance
ALTER TABLE project_tasks 
ADD INDEX idx_assignee_skill (assignee_skill),
ADD INDEX idx_complexity (complexity),
ADD INDEX idx_quality (quality),
ADD INDEX idx_required_days (required_days);

-- ===== Add team size to project_phases =====
ALTER TABLE project_phases 
ADD COLUMN team_size INT DEFAULT NULL COMMENT '対応人数' AFTER end_date;

-- Add index for team_size
ALTER TABLE project_phases 
ADD INDEX idx_team_size (team_size);

