feat(order): 订单表新增 is_b2b 字段(是否B2B,默认N)

- app/model/order_delivery.js 加 is_b2b ENUM('Y','N') 默认 'N'(与 is_urgency 同款)
- 分表(wms_order_delivery_%)由 OrderDeliveryFactory 惰性同步自动补齐
  (describeTable 比对 + 单条 ALTER + 自增水位保护),无需手工迁移
- 基表 wms_order_delivery 由迁移 20261008195000 补列(已执行开发库并核验)
- 验证:DISPATCH_FACTORY_TEST_MYSQL=1 临时集成测试 1/1 PASS
  (getCurrentModel(1000028) 后分表 is_b2b 列自动就位,默认 N);
  ESLint 0 error;生产分表随部署后工厂自动补齐
This commit is contained in:
liufumingren 2026-10-08 22:03:27 +08:00
parent ee7f08b192
commit 0ced089599
2 changed files with 36 additions and 0 deletions

View File

@ -282,6 +282,12 @@ module.exports = app => {
defaultValue: 'N',
comment: '是否紧急',
},
is_b2b: {
type: ENUM('Y', 'N'),
allowNull: true,
defaultValue: 'N',
comment: '是否B2B:Y是 N否',
},
invoice_flag: {
type: ENUM(...StatusEnum.INVOICE),
allowNull: true,

View File

@ -0,0 +1,30 @@
'use strict';
/**
* 订单基表 wms_order_delivery 增加 is_b2b 列(是否B2B,默认 N)。
*
* 分表(wms_order_delivery_%)列由 order_delivery_factory 惰性同步补齐
* (首次访问分表时 describeTable 比对 + 单条 ALTER,带自增水位保护),
* 本迁移只补基表列,保持基表与分表结构一致。
*/
const TABLE_NAME = 'wms_order_delivery';
const COLUMN_NAME = 'is_b2b';
module.exports = {
// eslint-disable-next-line no-unused-vars
async up(queryInterface, Sequelize) {
const { ENUM } = Sequelize;
await queryInterface.addColumn(TABLE_NAME, COLUMN_NAME, {
type: ENUM('Y', 'N'),
allowNull: true,
defaultValue: 'N',
comment: '是否B2B:Y是 N否',
});
},
// eslint-disable-next-line no-unused-vars
async down(queryInterface, Sequelize) {
await queryInterface.removeColumn(TABLE_NAME, COLUMN_NAME);
},
};