34 lines
1.0 KiB
JavaScript
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');
|
|
},
|
|
};
|