WMS_MAIN/database/migrations/20260711160000-add-unlock-to-wms-stock-transaction.js
liufumingren 7ff7285222 feat(stock.transaction): 新增 UNLOCK 类型,取消锁定时写入 UNLOCK 而非 OUTBOUND
- stock_transaction 枚举新增 UNLOCK(取消锁定)

- stock_store 取消锁定时写 UNLOCK 流水

- 迁移: 20260711160000-add-unlock-to-wms-stock-transaction
2026-07-27 03:45:54 +08:00

28 lines
857 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_stock_transaction.transaction_type ENUM 增加 UNLOCK。
* UNLOCK:库存释放流水(如取消订单释放创建锁)。
*/
module.exports = {
async up(queryInterface) {
const { sequelize } = queryInterface;
await sequelize.query(`
ALTER TABLE wms_stock_transaction
MODIFY COLUMN transaction_type ENUM(
'INBOUND', 'OUTBOUND', 'LOCK', 'UNLOCK'
) NOT NULL COMMENT '出入库类型:INBOUND入库 OUTBOUND出库 LOCK锁定 UNLOCK解锁'
`);
},
async down(queryInterface) {
const { sequelize } = queryInterface;
await sequelize.query(`
ALTER TABLE wms_stock_transaction
MODIFY COLUMN transaction_type ENUM(
'INBOUND', 'OUTBOUND', 'LOCK'
) NOT NULL COMMENT '出入库类型:INBOUND入库 OUTBOUND出库 LOCK锁定'
`);
},
};