From 1f98c5ab9cc5cf0e0fd24cfe429adb31aeb43922 Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Wed, 26 Aug 2026 14:49:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/sql/头程数据库统一增量-MySQL8.sql | 15 +++++++++++++++ .../openapi/carrier-schedule-query-v1.yaml | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/deploy/sql/头程数据库统一增量-MySQL8.sql b/deploy/sql/头程数据库统一增量-MySQL8.sql index ae1f5ed12..00b8d3452 100644 --- a/deploy/sql/头程数据库统一增量-MySQL8.sql +++ b/deploy/sql/头程数据库统一增量-MySQL8.sql @@ -9075,6 +9075,21 @@ PREPARE ocean_add_carrier_code_stmt FROM @ocean_add_carrier_code; EXECUTE ocean_add_carrier_code_stmt; DEALLOCATE PREPARE ocean_add_carrier_code_stmt; +SET @ocean_drop_carrier_code_check = ( + SELECT IF(COUNT(*) > 0, + 'ALTER TABLE fl_ocean_booking DROP CHECK chk_ocean_booking_carrier_code', + 'SELECT 1') + FROM information_schema.table_constraints + WHERE constraint_schema=DATABASE() AND table_name='fl_ocean_booking' + AND constraint_name='chk_ocean_booking_carrier_code' AND constraint_type='CHECK' +); +PREPARE ocean_drop_carrier_code_check_stmt FROM @ocean_drop_carrier_code_check; +EXECUTE ocean_drop_carrier_code_check_stmt; +DEALLOCATE PREPARE ocean_drop_carrier_code_check_stmt; +ALTER TABLE fl_ocean_booking + ADD CONSTRAINT chk_ocean_booking_carrier_code CHECK + (carrier_code IS NULL OR carrier_code IN ('MATSON','SML','ZIM','COSCO','EMC','HEDE','OTHER')); + -- CREATE TABLE IF NOT EXISTS does not reconcile a database initialized before customer became optional. ALTER TABLE fl_ocean_booking MODIFY COLUMN customer_id BIGINT UNSIGNED NULL COMMENT '可选客户ID快照', diff --git a/firstleg/src/main/resources/openapi/carrier-schedule-query-v1.yaml b/firstleg/src/main/resources/openapi/carrier-schedule-query-v1.yaml index 2e5af0055..77b4052ea 100644 --- a/firstleg/src/main/resources/openapi/carrier-schedule-query-v1.yaml +++ b/firstleg/src/main/resources/openapi/carrier-schedule-query-v1.yaml @@ -18,7 +18,7 @@ paths: - {name: customerId, in: query, schema: {type: integer, format: int64, minimum: 1}} - {name: oceanBookingId, in: query, schema: {type: integer, format: int64, minimum: 1}} - {name: containerBookingId, in: query, schema: {type: integer, format: int64, minimum: 1}} - - {name: carrierCode, in: query, schema: {$ref: '#/components/schemas/CarrierCode'}} + - {name: carrierCode, in: query, schema: {$ref: '#/components/schemas/TaskCarrierCode'}} - {name: status, in: query, schema: {$ref: '#/components/schemas/QueryStatus'}} - {name: expired, in: query, schema: {type: boolean}} - {name: keyword, in: query, schema: {type: string, maxLength: 128}}