WMS_MAIN/database/migrations/20260728100000-remove-recording-config-fields-from-wms-print-computer.js

44 lines
1.6 KiB
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';
module.exports = {
/**
* 移除打印电脑表的录制配置字段(recording_size_value / recording_size_unit / recording_directory),
* 这些字段不再由 WMS 侧管理。
* @param {import('sequelize').QueryInterface} queryInterface 查询接口
* @param {import('sequelize')} Sequelize Sequelize 实例
* @return {Promise<void>} 无返回值
*/
async up(queryInterface, Sequelize) {
await queryInterface.removeColumn('wms_print_computer', 'recording_directory');
await queryInterface.removeColumn('wms_print_computer', 'recording_size_unit');
await queryInterface.removeColumn('wms_print_computer', 'recording_size_value');
},
/**
* 回滚:恢复录制配置字段。
* @param {import('sequelize').QueryInterface} queryInterface 查询接口
* @param {import('sequelize')} Sequelize Sequelize 实例
* @return {Promise<void>} 无返回值
*/
async down(queryInterface, Sequelize) {
await queryInterface.addColumn('wms_print_computer', 'recording_size_value', {
type: Sequelize.INTEGER.UNSIGNED,
allowNull: true,
defaultValue: null,
comment: '录制大小数值',
});
await queryInterface.addColumn('wms_print_computer', 'recording_size_unit', {
type: Sequelize.STRING(10),
allowNull: true,
defaultValue: null,
comment: '录制存储单位:KB/MB/GB/TB',
});
await queryInterface.addColumn('wms_print_computer', 'recording_directory', {
type: Sequelize.STRING(500),
allowNull: true,
defaultValue: null,
comment: '录制目录路径',
});
},
};