WMS_MAIN/database/migrations/20260827170000-add-is-notified-to-wms-return-received.js

30 lines
936 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';
const TABLE = 'wms_return_received';
/**
* 退回收件登记表新增 is_notified 字段:
* 标记"登记已通知货主群"(0=未通知,1=已通知)。
* 供定时任务聚合通知(等 5 分钟无新登记后按货主合并推送,只对货主查退回时登记过的运单通知)。
*/
module.exports = {
up: async (queryInterface, Sequelize) => {
const columns = await queryInterface.describeTable(TABLE);
if (!columns.is_notified) {
await queryInterface.addColumn(TABLE, 'is_notified', {
type: Sequelize.TINYINT(1),
allowNull: false,
defaultValue: 0,
comment: '登记是否已通知货主群:0=未通知,1=已通知',
});
}
},
down: async queryInterface => {
const columns = await queryInterface.describeTable(TABLE);
if (columns.is_notified) {
await queryInterface.removeColumn(TABLE, 'is_notified');
}
},
};