cleanup_plans.sql 1.6 KB

1234567891011121314151617181920212223242526
  1. -- ******************************************************************
  2. -- 表 kku_cleanup_plans 的创建SQL
  3. -- 对应的Model: App\Module\Cleanup\Models\CleanupPlan
  4. -- 警告: 此文件由系统自动生成,禁止修改!
  5. -- ******************************************************************
  6. CREATE TABLE `kku_cleanup_plans` (
  7. `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  8. `plan_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '计划名称',
  9. `plan_type` tinyint unsigned NOT NULL COMMENT '计划类型:1全量清理,2模块清理,3分类清理,4自定义清理,5混合清理',
  10. `target_selection` json DEFAULT NULL COMMENT '目标选择配置',
  11. `global_conditions` json DEFAULT NULL COMMENT '全局清理条件',
  12. `backup_config` json DEFAULT NULL COMMENT '备份配置',
  13. `is_template` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否为模板',
  14. `is_enabled` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否启用',
  15. `description` text COLLATE utf8mb4_unicode_ci COMMENT '计划描述',
  16. `created_by` bigint unsigned DEFAULT NULL COMMENT '创建者用户ID',
  17. `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  18. `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  19. PRIMARY KEY (`id`),
  20. UNIQUE KEY `idx_plan_name` (`plan_name`),
  21. KEY `idx_plan_type` (`plan_type`),
  22. KEY `idx_is_template` (`is_template`),
  23. KEY `idx_is_enabled` (`is_enabled`),
  24. KEY `idx_created_by` (`created_by`)
  25. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='清理计划表';