Commit 06fa479a by 真的三个金的鑫

fix: widen wayline job_id so breakpoint resume tasks can insert

Resume jobs append -1 to the name and exceeded varchar(45), causing create failure after low-battery RTH.

Co-authored-by: Cursor <cursoragent@cursor.com>
parent 1b548210
...@@ -468,7 +468,7 @@ CREATE TABLE `media_file` ( ...@@ -468,7 +468,7 @@ CREATE TABLE `media_file` (
`is_original` tinyint(1) NOT NULL COMMENT 'Whether is the original image.', `is_original` tinyint(1) NOT NULL COMMENT 'Whether is the original image.',
`drone` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'undefined' COMMENT 'The sn of the drone which create the file.', `drone` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'undefined' COMMENT 'The sn of the drone which create the file.',
`payload` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'undefined' COMMENT 'The name of the drone payload which create the file.', `payload` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'undefined' COMMENT 'The name of the drone payload which create the file.',
`job_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT 'The job_id in the wayline_job table. Whether the file belongs to the dock task.', `job_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT 'The job_id in the wayline_job table. Whether the file belongs to the dock task.',
`create_time` bigint NOT NULL, `create_time` bigint NOT NULL,
`update_time` bigint NOT NULL, `update_time` bigint NOT NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
...@@ -509,7 +509,7 @@ DROP TABLE IF EXISTS `wayline_job`; ...@@ -509,7 +509,7 @@ DROP TABLE IF EXISTS `wayline_job`;
CREATE TABLE `wayline_job` ( CREATE TABLE `wayline_job` (
`id` int unsigned NOT NULL AUTO_INCREMENT, `id` int unsigned NOT NULL AUTO_INCREMENT,
`job_id` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT 'uuid', `job_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT 'job id',
`name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT 'The name of the job.', `name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT 'The name of the job.',
`file_id` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT 'The wayline file used for this job.', `file_id` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT 'The wayline file used for this job.',
`dock_sn` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT 'Which dock executes the job.', `dock_sn` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT 'Which dock executes the job.',
...@@ -528,7 +528,7 @@ CREATE TABLE `wayline_job` ( ...@@ -528,7 +528,7 @@ CREATE TABLE `wayline_job` (
`media_count` int NOT NULL DEFAULT '0', `media_count` int NOT NULL DEFAULT '0',
`create_time` bigint NOT NULL, `create_time` bigint NOT NULL,
`update_time` bigint NOT NULL, `update_time` bigint NOT NULL,
`parent_id` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL, `parent_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
UNIQUE KEY `job_id_UNIQUE` (`job_id`) UNIQUE KEY `job_id_UNIQUE` (`job_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Wayline mission information of the dock.'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Wayline mission information of the dock.';
......
-- Fix: auto breakpoint resume fails when job_id exceeds varchar(45)
-- Example: HSITPsurrounding1008-1-2026-10-08-11-19-30-xxxx (47 chars)
-- Deploy: run this ALTER before deploying the application that generates longer job_id values.
ALTER TABLE `wayline_job`
MODIFY COLUMN `job_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT 'job id',
MODIFY COLUMN `parent_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL;
ALTER TABLE `media_file`
MODIFY COLUMN `job_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT 'The job_id in the wayline_job table. Whether the file belongs to the dock task.';
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment