WMS_MAIN/database/migrations/20260725200000-add-item-quantity-sku-count-to-wms-pack-task.js
liufumingren 5b3180ff34 feat(workbench): 新增工作台/打包台模块 (workbench/pack_task)
- 新增 model: workbench, pack_task, pack_task_packer

- 新增 systemMethods: workbench (finishPack/sendWeight/操作日志)

- systems/workbench 扩展: 波次订单ID获取、打包操作日志白名单

- 10 条迁移: 建表→扩展→权限→重构
2026-07-27 03:46:37 +08:00

37 lines
1.2 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';
module.exports = {
/**
* 为打包任务表新增"商品数量"和"商品种类数"字段。
* @param {import('sequelize').QueryInterface} queryInterface 查询接口
* @param {import('sequelize')} Sequelize Sequelize 实例
* @return {Promise<void>} 无返回值
*/
async up(queryInterface, Sequelize) {
await queryInterface.addColumn('wms_pack_task', 'item_quantity', {
type: Sequelize.INTEGER.UNSIGNED,
allowNull: true,
defaultValue: 0,
comment: '商品总数量',
});
await queryInterface.addColumn('wms_pack_task', 'sku_count', {
type: Sequelize.INTEGER.UNSIGNED,
allowNull: true,
defaultValue: 0,
comment: '商品种类数(SKU数)',
});
},
/**
* 回滚删除打包任务表的"商品数量"和"商品种类数"字段。
* @param {import('sequelize').QueryInterface} queryInterface 查询接口
* @param {import('sequelize')} Sequelize Sequelize 实例
* @return {Promise<void>} 无返回值
*/
async down(queryInterface, Sequelize) {
await queryInterface.removeColumn('wms_pack_task', 'sku_count');
await queryInterface.removeColumn('wms_pack_task', 'item_quantity');
},
};