am-freescan/am-backend/sql/freescan/004_cmvr_bridge_schema.sql

24 lines
1.0 KiB
MySQL
Raw Normal View History

2026-10-22 16:18:37 +08:00
-- Host mappings keep native CMVR UUIDs separate from lab Snowflake IDs.
CREATE TABLE IF NOT EXISTS `lab_cmvr_execution` (
`execution_id` bigint NOT NULL,
`test_case_id` varchar(64) NOT NULL,
`detection_item_id` varchar(64) NOT NULL,
`version_id` varchar(64) NOT NULL,
`version_no` int NOT NULL,
`flow_data` longtext NOT NULL,
`input_config` longtext DEFAULT NULL,
`cmvr_task_id` varchar(64) DEFAULT NULL,
`cmvr_inst_id` varchar(64) DEFAULT NULL,
`cmvr_status` varchar(32) DEFAULT NULL,
`actor_user_id` bigint DEFAULT NULL,
`creator` varchar(64) DEFAULT '',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updater` varchar(64) DEFAULT '',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`deleted` bit(1) NOT NULL DEFAULT b'0',
`tenant_id` bigint NOT NULL DEFAULT 1,
PRIMARY KEY (`execution_id`),
UNIQUE KEY `uk_cmvr_inst` (`cmvr_inst_id`),
KEY `idx_cmvr_task` (`cmvr_task_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;