-- 工业智能体采用单组织模式:从通用导入命令表移除租户维度。
|
-- 执行前请确认目标库为 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`);
|