38 lines
1.1 KiB
JavaScript
38 lines
1.1 KiB
JavaScript
'use strict';
|
|
|
|
module.exports = {
|
|
/**
|
|
* 为打印台表新增主体配置字段。
|
|
* @param {import('sequelize').QueryInterface} queryInterface 查询接口
|
|
* @param {import('sequelize')} Sequelize Sequelize 实例
|
|
* @return {Promise<void>} 无返回值
|
|
*/
|
|
async up(queryInterface, Sequelize) {
|
|
const tableDefinition = await queryInterface.describeTable('wms_print_stations');
|
|
if (tableDefinition.subject_config) {
|
|
return;
|
|
}
|
|
|
|
await queryInterface.addColumn('wms_print_stations', 'subject_config', {
|
|
type: Sequelize.JSON,
|
|
allowNull: true,
|
|
comment: '打印台主体配置',
|
|
});
|
|
},
|
|
|
|
/**
|
|
* 回滚删除打印台表主体配置字段。
|
|
* @param {import('sequelize').QueryInterface} queryInterface 查询接口
|
|
* @param {import('sequelize')} Sequelize Sequelize 实例
|
|
* @return {Promise<void>} 无返回值
|
|
*/
|
|
async down(queryInterface) {
|
|
const tableDefinition = await queryInterface.describeTable('wms_print_stations');
|
|
if (!tableDefinition.subject_config) {
|
|
return;
|
|
}
|
|
|
|
await queryInterface.removeColumn('wms_print_stations', 'subject_config');
|
|
},
|
|
};
|