-- 006_add_description_column.sql
-- daily_work_reports 테이블에 description 컬럼 추가

-- description 컬럼 추가 (이미 존재하는 경우 무시)
SET @sql = (SELECT IF(
    (SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS 
     WHERE table_name = 'daily_work_reports' 
     AND table_schema = 'hyungi' 
     AND column_name = 'description') = 0,
    'ALTER TABLE daily_work_reports ADD COLUMN description TEXT COMMENT ''작업 설명'' AFTER work_hours',
    'SELECT ''description column already exists'' as message'
));

PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
