优化
This commit is contained in:
@@ -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快照',
|
||||
|
||||
Reference in New Issue
Block a user