-- 业务体系归属字段:bizSystem + projectType + planeIdentifier 备份

ALTER TABLE `projects` ADD COLUMN `biz_system` enum('airhubs','airflow','aircore') NULL;
--> statement-breakpoint
ALTER TABLE `projects` ADD COLUMN `project_type` enum('hardware','software') NULL;
--> statement-breakpoint
ALTER TABLE `projects` ADD COLUMN `plane_identifier` varchar(200) NULL;
--> statement-breakpoint

-- 把现有 identifier 一次性备份到 plane_identifier(以防 AI 覆盖后丢失)
UPDATE `projects` SET `plane_identifier` = `identifier` WHERE `plane_identifier` IS NULL;
--> statement-breakpoint

CREATE INDEX `idx_projects_biz_system` ON `projects` (`biz_system`);
--> statement-breakpoint
CREATE INDEX `idx_projects_project_type` ON `projects` (`project_type`);
