cleanup_plans.sql 1.5 KB

123456789101112131415161718192021222324
  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. `selected_tables` json DEFAULT NULL COMMENT '选择的Model类列表,格式:["App\\Module\\System\\Models\\AdminActionlog"]',
  10. `global_conditions` json DEFAULT NULL COMMENT '全局清理条件',
  11. `backup_config` json DEFAULT NULL COMMENT '备份配置',
  12. `is_template` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否为模板',
  13. `is_enabled` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否启用',
  14. `description` text COLLATE utf8mb4_unicode_ci COMMENT '计划描述',
  15. `created_by` bigint unsigned DEFAULT NULL COMMENT '创建者用户ID',
  16. `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  17. `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  18. PRIMARY KEY (`id`),
  19. UNIQUE KEY `idx_plan_name` (`plan_name`),
  20. KEY `idx_is_template` (`is_template`),
  21. KEY `idx_is_enabled` (`is_enabled`),
  22. KEY `idx_created_by` (`created_by`)
  23. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='清理计划表';