'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'); } }, };