-- ROI 引擎 AI 驱动因子文案表(月度快照)

CREATE TABLE IF NOT EXISTS `roi_driver_factors` (
  `id` varchar(50) NOT NULL PRIMARY KEY,
  `project_id` varchar(50) NOT NULL,
  `period_key` varchar(20) NOT NULL,
  `factors` json NOT NULL,
  `context` json NULL,
  `generated_at` datetime NOT NULL
);
--> statement-breakpoint
CREATE UNIQUE INDEX `uniq_driver_factors_project_period` ON `roi_driver_factors` (`project_id`, `period_key`);
