WMS_MAIN/database/migrations/20261008195000-add-is-b2b-to-order-delivery.js
liufumingren 0ced089599 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;生产分表随部署后工厂自动补齐
2026-10-08 22:03:27 +08:00

31 lines
913 B
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_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);
},
};