-- 子项目层级化：不存子项目数量，改为基于 parent_project_id 动态统计

ALTER TABLE project
    ADD COLUMN parent_project_id BIGINT UNSIGNED NULL COMMENT '上级项目ID（为空表示一级项目）',
    DROP COLUMN sub_project_count;

ALTER TABLE project
    ADD KEY idx_tenant_parent_project (tenant_id, parent_project_id);
