oms/backend/database/migrations/20260911000600-add-wms-item-id-to-warehouse-products.js
liufumingren cbd16752a5 feat(backend): 商品、店铺、组合商品、仓库与库存模块
- 商品/商品图片、店铺、店铺商品、组合商品及明细
- 仓库、仓库商品(WMS itemId 映射)、仓库接口配置与字段定义(warehouseApi/warehouseApiField)
- 库存:stock_items、product_stocks(ZC/CC 双维度)与库存重算工具(utils/recalcStock.js)
- 库存单据与对接日志:stock orders、api_outbound_logs
- 相关迁移:shops/shop_products/stock_orders/warehouses/warehouse_apis/warehouse_products/product_stocks/files-images 等表与字段
2026-09-13 02:23:39 +08:00

20 lines
678 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_item_id:记录该商品在 WMS 内部的商品主键ID,
* 推送(singleitem.synchronize)成功时由 WMS 返回,用于后续按 itemId 批量查询 WMS 库存(inventory.query)
*/
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.addColumn('warehouse_products', 'wms_item_id', {
type: Sequelize.BIGINT.UNSIGNED,
allowNull: true,
comment: 'WMS 内部商品ID(singleitem.synchronize 返回),用于按 itemId 查询库存',
});
},
async down(queryInterface) {
await queryInterface.removeColumn('warehouse_products', 'wms_item_id');
},
};