WMS_MAIN/database/migrations/20260916161000-cleanup-legacy-wms-number-rule.js
liufumingren c2a761ca26 feat(inbox): 新增开门/到货/进场/离场车牌登记与 extend_props 持久化
- functions 新增 openDoor/registerLicensePlate/enter/departure(规则表+权限分组)
- 到货登记表 wms_inbox_arrival_register(含消费字段,离场闭环,货主收货群优先推送)
- 回执 extend_props 持久化落库与定时补发送下发(重推兜底回读)
- 车牌提取正则兼容异体字(粤/粵)
- 售后类型/关键字/函数/回复 v2 模型与迁移
- INBOX V2 HTTP 测试报告与指南
2026-09-17 02:41:43 +08:00

37 lines
1.3 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use strict';
/**
* 清理旧命名的取号规则表 wms_number_rule(已改名为 wms_inbox_number_rule)。
*
* 背景:20260916160000 迁移最初以表名 wms_number_rule 在开发库执行过,
* 后与 wms_number_sequence 存在语义混淆风险,改名为 wms_inbox_number_rule。
* 本迁移仅负责开发库旧表清理与旧 SequelizeMeta 记录清理;生产库从未执行旧表名,
* up 中幂等跳过。
*/
const LEGACY_TABLE = 'wms_number_rule';
const LEGACY_MIGRATION_NAME = '20260916160000-create-wms-number-rule-and-link-sub-type.js';
module.exports = {
up: async queryInterface => {
const { sequelize } = queryInterface;
const tables = await queryInterface.showAllTables();
const legacyExists = tables.some(t => (typeof t === 'string' ? t : t.tableName) === LEGACY_TABLE);
// 旧表清理(仅开发库存在;旧表无数据,直接删除)
if (legacyExists) {
await queryInterface.dropTable(LEGACY_TABLE);
}
// 旧迁移记录清理(仅开发库有该记录)
await sequelize.query(
'DELETE FROM SequelizeMeta WHERE name = :name',
{ replacements: { name: LEGACY_MIGRATION_NAME } }
);
},
down: async () => {
// 旧表不重建(改名后不可逆回旧命名)
},
};