- 仓储实体与 db.sql 统一为小写 c_ 前缀,新增 migrate_rename_warehouse_C_to_c.sql - 专线小包批量模板精简版/标准版双模板,Excel 必填标红与发件地址上传参数 Co-authored-by: Cursor <cursoragent@cursor.com>
17 lines
544 B
SQL
17 lines
544 B
SQL
-- 已有库增量:c_parcel_item.AttributeText
|
||
-- 可重复执行
|
||
|
||
SET @col_exists := (
|
||
SELECT COUNT(1)
|
||
FROM information_schema.COLUMNS
|
||
WHERE TABLE_SCHEMA = DATABASE()
|
||
AND TABLE_NAME = 'c_parcel_item'
|
||
AND COLUMN_NAME = 'AttributeText'
|
||
);
|
||
SET @sql := IF(
|
||
@col_exists = 0,
|
||
'ALTER TABLE `c_parcel_item` ADD COLUMN `AttributeText` VARCHAR(256) NULL COMMENT ''规格属性'' AFTER `ProductName`',
|
||
'SELECT ''c_parcel_item.AttributeText already exists'' AS info'
|
||
);
|
||
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
|