异常记录检测修改
This commit is contained in:
@@ -0,0 +1,127 @@
|
||||
SET @coze_execute_id_exists := (
|
||||
SELECT COUNT(1)
|
||||
FROM information_schema.COLUMNS
|
||||
WHERE TABLE_SCHEMA = DATABASE()
|
||||
AND TABLE_NAME = 'biz_task_scope_state'
|
||||
AND COLUMN_NAME = 'coze_execute_id'
|
||||
);
|
||||
SET @sql_add_coze_execute_id := IF(
|
||||
@coze_execute_id_exists = 0,
|
||||
'ALTER TABLE biz_task_scope_state ADD COLUMN coze_execute_id VARCHAR(128) NULL COMMENT ''Coze execute id'' AFTER state_json',
|
||||
'SELECT 1'
|
||||
);
|
||||
PREPARE stmt_add_coze_execute_id FROM @sql_add_coze_execute_id;
|
||||
EXECUTE stmt_add_coze_execute_id;
|
||||
DEALLOCATE PREPARE stmt_add_coze_execute_id;
|
||||
|
||||
SET @coze_status_exists := (
|
||||
SELECT COUNT(1)
|
||||
FROM information_schema.COLUMNS
|
||||
WHERE TABLE_SCHEMA = DATABASE()
|
||||
AND TABLE_NAME = 'biz_task_scope_state'
|
||||
AND COLUMN_NAME = 'coze_status'
|
||||
);
|
||||
SET @sql_add_coze_status := IF(
|
||||
@coze_status_exists = 0,
|
||||
'ALTER TABLE biz_task_scope_state ADD COLUMN coze_status VARCHAR(32) NULL COMMENT ''Coze workflow status'' AFTER coze_execute_id',
|
||||
'SELECT 1'
|
||||
);
|
||||
PREPARE stmt_add_coze_status FROM @sql_add_coze_status;
|
||||
EXECUTE stmt_add_coze_status;
|
||||
DEALLOCATE PREPARE stmt_add_coze_status;
|
||||
|
||||
SET @coze_submitted_at_exists := (
|
||||
SELECT COUNT(1)
|
||||
FROM information_schema.COLUMNS
|
||||
WHERE TABLE_SCHEMA = DATABASE()
|
||||
AND TABLE_NAME = 'biz_task_scope_state'
|
||||
AND COLUMN_NAME = 'coze_submitted_at'
|
||||
);
|
||||
SET @sql_add_coze_submitted_at := IF(
|
||||
@coze_submitted_at_exists = 0,
|
||||
'ALTER TABLE biz_task_scope_state ADD COLUMN coze_submitted_at DATETIME NULL COMMENT ''Coze submitted time'' AFTER coze_status',
|
||||
'SELECT 1'
|
||||
);
|
||||
PREPARE stmt_add_coze_submitted_at FROM @sql_add_coze_submitted_at;
|
||||
EXECUTE stmt_add_coze_submitted_at;
|
||||
DEALLOCATE PREPARE stmt_add_coze_submitted_at;
|
||||
|
||||
SET @coze_last_polled_at_exists := (
|
||||
SELECT COUNT(1)
|
||||
FROM information_schema.COLUMNS
|
||||
WHERE TABLE_SCHEMA = DATABASE()
|
||||
AND TABLE_NAME = 'biz_task_scope_state'
|
||||
AND COLUMN_NAME = 'coze_last_polled_at'
|
||||
);
|
||||
SET @sql_add_coze_last_polled_at := IF(
|
||||
@coze_last_polled_at_exists = 0,
|
||||
'ALTER TABLE biz_task_scope_state ADD COLUMN coze_last_polled_at DATETIME NULL COMMENT ''Coze last polled time'' AFTER coze_submitted_at',
|
||||
'SELECT 1'
|
||||
);
|
||||
PREPARE stmt_add_coze_last_polled_at FROM @sql_add_coze_last_polled_at;
|
||||
EXECUTE stmt_add_coze_last_polled_at;
|
||||
DEALLOCATE PREPARE stmt_add_coze_last_polled_at;
|
||||
|
||||
SET @coze_completed_at_exists := (
|
||||
SELECT COUNT(1)
|
||||
FROM information_schema.COLUMNS
|
||||
WHERE TABLE_SCHEMA = DATABASE()
|
||||
AND TABLE_NAME = 'biz_task_scope_state'
|
||||
AND COLUMN_NAME = 'coze_completed_at'
|
||||
);
|
||||
SET @sql_add_coze_completed_at := IF(
|
||||
@coze_completed_at_exists = 0,
|
||||
'ALTER TABLE biz_task_scope_state ADD COLUMN coze_completed_at DATETIME NULL COMMENT ''Coze completed time'' AFTER coze_last_polled_at',
|
||||
'SELECT 1'
|
||||
);
|
||||
PREPARE stmt_add_coze_completed_at FROM @sql_add_coze_completed_at;
|
||||
EXECUTE stmt_add_coze_completed_at;
|
||||
DEALLOCATE PREPARE stmt_add_coze_completed_at;
|
||||
|
||||
SET @coze_attempt_count_exists := (
|
||||
SELECT COUNT(1)
|
||||
FROM information_schema.COLUMNS
|
||||
WHERE TABLE_SCHEMA = DATABASE()
|
||||
AND TABLE_NAME = 'biz_task_scope_state'
|
||||
AND COLUMN_NAME = 'coze_attempt_count'
|
||||
);
|
||||
SET @sql_add_coze_attempt_count := IF(
|
||||
@coze_attempt_count_exists = 0,
|
||||
'ALTER TABLE biz_task_scope_state ADD COLUMN coze_attempt_count INT NOT NULL DEFAULT 0 COMMENT ''Coze poll attempt count'' AFTER coze_completed_at',
|
||||
'SELECT 1'
|
||||
);
|
||||
PREPARE stmt_add_coze_attempt_count FROM @sql_add_coze_attempt_count;
|
||||
EXECUTE stmt_add_coze_attempt_count;
|
||||
DEALLOCATE PREPARE stmt_add_coze_attempt_count;
|
||||
|
||||
SET @coze_error_exists := (
|
||||
SELECT COUNT(1)
|
||||
FROM information_schema.COLUMNS
|
||||
WHERE TABLE_SCHEMA = DATABASE()
|
||||
AND TABLE_NAME = 'biz_task_scope_state'
|
||||
AND COLUMN_NAME = 'coze_error'
|
||||
);
|
||||
SET @sql_add_coze_error := IF(
|
||||
@coze_error_exists = 0,
|
||||
'ALTER TABLE biz_task_scope_state ADD COLUMN coze_error VARCHAR(1000) NULL COMMENT ''Coze error message'' AFTER coze_attempt_count',
|
||||
'SELECT 1'
|
||||
);
|
||||
PREPARE stmt_add_coze_error FROM @sql_add_coze_error;
|
||||
EXECUTE stmt_add_coze_error;
|
||||
DEALLOCATE PREPARE stmt_add_coze_error;
|
||||
|
||||
SET @idx_task_coze_status_exists := (
|
||||
SELECT COUNT(1)
|
||||
FROM information_schema.STATISTICS
|
||||
WHERE TABLE_SCHEMA = DATABASE()
|
||||
AND TABLE_NAME = 'biz_task_scope_state'
|
||||
AND INDEX_NAME = 'idx_task_coze_status'
|
||||
);
|
||||
SET @sql_add_idx_task_coze_status := IF(
|
||||
@idx_task_coze_status_exists = 0,
|
||||
'ALTER TABLE biz_task_scope_state ADD INDEX idx_task_coze_status (module_type, coze_status, updated_at)',
|
||||
'SELECT 1'
|
||||
);
|
||||
PREPARE stmt_add_idx_task_coze_status FROM @sql_add_idx_task_coze_status;
|
||||
EXECUTE stmt_add_idx_task_coze_status;
|
||||
DEALLOCATE PREPARE stmt_add_idx_task_coze_status;
|
||||
@@ -0,0 +1,15 @@
|
||||
SET @idx_file_task_delete_brand_history_updated_exists := (
|
||||
SELECT COUNT(1)
|
||||
FROM INFORMATION_SCHEMA.STATISTICS
|
||||
WHERE TABLE_SCHEMA = DATABASE()
|
||||
AND TABLE_NAME = 'biz_file_task'
|
||||
AND INDEX_NAME = 'idx_file_task_delete_brand_history_updated'
|
||||
);
|
||||
SET @sql_add_idx_file_task_delete_brand_history_updated := IF(
|
||||
@idx_file_task_delete_brand_history_updated_exists = 0,
|
||||
'ALTER TABLE biz_file_task ADD INDEX idx_file_task_delete_brand_history_updated (module_type, user_id, updated_at)',
|
||||
'SELECT 1'
|
||||
);
|
||||
PREPARE stmt_add_idx_file_task_delete_brand_history_updated FROM @sql_add_idx_file_task_delete_brand_history_updated;
|
||||
EXECUTE stmt_add_idx_file_task_delete_brand_history_updated;
|
||||
DEALLOCATE PREPARE stmt_add_idx_file_task_delete_brand_history_updated;
|
||||
14
backend-java/src/main/resources/db/V45__similar_asin.sql
Normal file
14
backend-java/src/main/resources/db/V45__similar_asin.sql
Normal file
@@ -0,0 +1,14 @@
|
||||
-- Similar ASIN detection reuses the generic file task/result/chunk tables.
|
||||
-- Register the frontend app menu column so permission queries can expose the page.
|
||||
INSERT INTO `columns` (`name`, `column_key`, `menu_type`, `route_path`, `sort_order`)
|
||||
SELECT '相似ASIN检测', 'similar_asin', 'app', 'similar-asin', 112
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1 FROM `columns` WHERE `column_key` = 'similar_asin'
|
||||
);
|
||||
|
||||
UPDATE `columns`
|
||||
SET `name` = '相似ASIN检测',
|
||||
`menu_type` = 'app',
|
||||
`route_path` = 'similar-asin',
|
||||
`sort_order` = 112
|
||||
WHERE `column_key` = 'similar_asin';
|
||||
Reference in New Issue
Block a user