GPU_GUARD_MONOREPO/packages/backend/sql/init_cpu_guard.sql

99 lines
3.7 KiB
MySQL
Raw Normal View History

2026-05-20 21:39:12 +08:00
-- ============================================================
-- CPU Guard 数据库初始化脚本
-- 数据库: cpu_guard
-- 说明: Cool Admin 框架通过 TypeORM synchronize 自动建表,
-- 菜单通过 menu.json 自动导入。此脚本仅负责创建数据库。
-- ============================================================
-- 创建数据库(如已存在则跳过)
CREATE DATABASE IF NOT EXISTS `cpu_guard`
DEFAULT CHARACTER SET utf8mb4
DEFAULT COLLATE utf8mb4_unicode_ci;
-- 切换数据库
USE `cpu_guard`;
-- ============================================================
-- 表结构说明(由 TypeORM synchronize 自动创建,无需手动执行)
-- ============================================================
--
-- base 模块(系统管理):
-- base_sys_user - 系统用户
-- base_sys_role - 系统角色
-- base_sys_menu - 系统菜单
-- base_sys_department - 系统部门
-- base_sys_param - 系统参数
-- base_sys_conf - 系统配置
-- base_sys_log - 系统日志
-- base_sys_user_role - 用户角色关联
-- base_sys_role_menu - 角色菜单关联
-- base_sys_role_department - 角色部门关联
-- base - 基础实体
--
-- netaclaw 模块AI Agent 引擎):
-- netaclaw_agent - Agent 定义
-- netaclaw_agent_channel - Agent 渠道
-- netaclaw_agent_channel_group - Agent 渠道群组
-- netaclaw_agent_session - Agent 会话
-- netaclaw_agent_session_entry - Agent 会话入口
-- netaclaw_session - 会话
-- netaclaw_message - 消息
-- netaclaw_skill - 技能
-- netaclaw_model_channel - 模型渠道
-- netaclaw_tool - 工具
-- netaclaw_subagent_session - 子代理会话
-- netaclaw_memory - 记忆
-- netaclaw_memory_type - 记忆类型
-- netaclaw_crew - 团队
-- netaclaw_crew_agent - 团队成员
-- netaclaw_crew_run - 团队运行
-- netaclaw_crew_task - 团队任务
-- netaclaw_data_source - 数据源
-- netaclaw_data_source_query_audit - 数据源查询审核
--
-- audit 模块(审核订单管理):
-- audit_config - 审核配置
-- audit_order - 审核订单
-- audit_result - 审核结果
--
-- user 模块(应用用户):
-- user_info - 用户信息
-- user_wx - 微信用户
-- user_address - 用户地址
--
-- task 模块(定时任务):
-- task_info - 任务信息
-- task_log - 任务日志
--
-- dict 模块(字典管理):
-- dict_type - 字典类型
-- dict_info - 字典数据
--
-- space 模块(文件空间):
-- space_info - 文件信息
-- space_type - 文件类型
--
-- plugin 模块(插件管理):
-- plugin_info - 插件信息
--
-- notification 模块(通知管理):
-- notification_user - 通知用户
-- notification_message_log - 通知消息日志
--
-- recycle 模块(数据回收站):
-- recycle_data - 回收数据
--
-- desktop_op 模块(桌面操作):
-- desktop_op_config - 桌面操作配置
-- desktop_op_action_log - 桌面操作日志
--
-- demo 模块(示例):
-- demo_goods - 示例商品
--
-- ============================================================
-- 已移除模块(不再创建):
-- project_info, project_phase, project_task,
-- project_task_dependency, project_time_log
-- geo_account, geo_proxy_ip
-- ============================================================