-- Hammerhead Workspace - Patch 4: Reports-To Hierarchy
-- reports_to_type/reports_to_id columns already exist on managers/employees
-- (added by the original schema extension). This just adds an index for
-- fast "who reports to me" lookups used by the hierarchy going forward.
-- Safe to re-run.

ALTER TABLE `managers` ADD INDEX IF NOT EXISTS `idx_reports_to` (`reports_to_type`, `reports_to_id`);
ALTER TABLE `employees` ADD INDEX IF NOT EXISTS `idx_reports_to` (`reports_to_type`, `reports_to_id`);
