WMS_MAIN/database/migrations/20260519110000-add-expense-record-to-wms-entry-order.js
liufumingren 8cf2c5befa 1
2026-05-20 16:31:29 +08:00

34 lines
1.0 KiB
JavaScript

'use strict';
/**
* 为入库单主表增加费用是否记录字段。
* @param {import('sequelize').QueryInterface} queryInterface 查询接口
* @param {import('sequelize')} Sequelize Sequelize 实例
* @return {Promise<void>} 无返回值
*/
module.exports = {
/**
* 执行迁移:新增 expense_record 字段。
* @param {import('sequelize').QueryInterface} queryInterface 查询接口
* @param {import('sequelize')} Sequelize Sequelize 实例
* @return {Promise<void>} 无返回值
*/
async up(queryInterface, Sequelize) {
await queryInterface.addColumn('wms_entry_order', 'expense_record', {
type: Sequelize.TINYINT(1),
allowNull: false,
defaultValue: 0,
comment: '费用是否记录',
});
},
/**
* 回滚迁移:删除 expense_record 字段。
* @param {import('sequelize').QueryInterface} queryInterface 查询接口
* @return {Promise<void>} 无返回值
*/
async down(queryInterface) {
await queryInterface.removeColumn('wms_entry_order', 'expense_record');
},
};