All checks were successful
Build and Deploy / deploy (push) Successful in 58s
下单/导入在 9610Summary 时校验并落库 ExportQualificationId(可回落默认备案),写入 9610 申报企业信息;专线小包模板长宽高改必填并增加资质备案列。 Co-authored-by: Cursor <cursoragent@cursor.com>
25 lines
719 B
SQL
25 lines
719 B
SQL
-- 存量库:t_order 增加出口资质备案 Id(9610Summary 选用)
|
||
-- 可重复执行。
|
||
|
||
SET @db := DATABASE();
|
||
|
||
SET @exists := (
|
||
SELECT COUNT(1)
|
||
FROM information_schema.COLUMNS
|
||
WHERE TABLE_SCHEMA = @db
|
||
AND TABLE_NAME = 't_order'
|
||
AND COLUMN_NAME = 'ExportQualificationId'
|
||
);
|
||
|
||
SET @sql := IF(
|
||
@exists = 0,
|
||
'ALTER TABLE `t_order`
|
||
ADD COLUMN `ExportQualificationId` INT NULL COMMENT ''出口资质备案 Id(t_customer_export_qualification.Id)'' AFTER `ExportCustomsMode`,
|
||
ADD KEY `idx_order_export_qualification` (`ExportQualificationId`)',
|
||
'SELECT ''t_order.ExportQualificationId already exists'' AS info'
|
||
);
|
||
|
||
PREPARE stmt FROM @sql;
|
||
EXECUTE stmt;
|
||
DEALLOCATE PREPARE stmt;
|