-- 表: import_tasks

DROP TABLE IF EXISTS `import_tasks`;
CREATE TABLE `import_tasks` (
  `id` varchar(32) NOT NULL,
  `source_api` varchar(500) NOT NULL DEFAULT '',
  `api_key` varchar(255) NOT NULL DEFAULT '',
  `programs_data` text,
  `status` enum('pending','processing','completed','failed') DEFAULT 'pending',
  `progress` int(11) DEFAULT '0',
  `current_program` varchar(255) DEFAULT NULL,
  `result` text,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_status` (`status`),
  KEY `idx_created_at` (`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
