云
10 小时以前 95ae0c83d2aa58d86b4039e3f7f16ee93afb8f00
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
-- 工业智能体采用单组织模式:从通用导入命令表移除租户维度。
-- 执行前请确认目标库为 ruoyi-vue-pro,并备份 agent_import_command。
ALTER TABLE `agent_import_command`
  DROP INDEX `uk_agent_import_generic_command`,
  DROP INDEX `uk_agent_import_generic_idempotency`,
  DROP INDEX `idx_agent_import_generic_module`,
  DROP COLUMN `tenant_id`,
  ADD UNIQUE KEY `uk_agent_import_generic_command` (`owner_user_id`, `module_id`, `command_id`),
  ADD UNIQUE KEY `uk_agent_import_generic_idempotency` (`owner_user_id`, `module_id`, `idempotency_key`),
  ADD KEY `idx_agent_import_generic_module` (`module_id`, `create_time`);
 
ALTER TABLE `mdm_agent_import_command`
  DROP INDEX `uk_agent_import_command`,
  DROP INDEX `uk_agent_import_idempotency`,
  DROP INDEX `idx_agent_import_command_session`,
  DROP COLUMN `tenant_id`,
  ADD UNIQUE KEY `uk_agent_import_command` (`owner_user_id`, `command_id`),
  ADD UNIQUE KEY `uk_agent_import_idempotency` (`owner_user_id`, `idempotency_key`),
  ADD KEY `idx_agent_import_command_session` (`session_id`, `create_time`);