WMS_MAIN/database/migrations/20260405015000-drop-extra-config-from-notification-webhook.js

26 lines
779 B
JavaScript

'use strict';
module.exports = {
async up(queryInterface) {
const [ columns ] = await queryInterface.sequelize.query("SHOW COLUMNS FROM `wms_notification_webhook` LIKE 'extra_config'");
if (columns.length === 0) {
return;
}
await queryInterface.removeColumn('wms_notification_webhook', 'extra_config');
},
async down(queryInterface, Sequelize) {
const [ columns ] = await queryInterface.sequelize.query("SHOW COLUMNS FROM `wms_notification_webhook` LIKE 'extra_config'");
if (columns.length > 0) {
return;
}
await queryInterface.addColumn('wms_notification_webhook', 'extra_config', {
type: Sequelize.JSON,
allowNull: true,
comment: '扩展配置,如签名、请求头、模板映射等',
});
},
};