diff --git a/app/model/order_delivery.js b/app/model/order_delivery.js index f5aeef2..1cf4951 100644 --- a/app/model/order_delivery.js +++ b/app/model/order_delivery.js @@ -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, diff --git a/database/migrations/20261008195000-add-is-b2b-to-order-delivery.js b/database/migrations/20261008195000-add-is-b2b-to-order-delivery.js new file mode 100644 index 0000000..50a877f --- /dev/null +++ b/database/migrations/20261008195000-add-is-b2b-to-order-delivery.js @@ -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); + }, +};