'use strict'; module.exports = { async up(queryInterface, Sequelize) { const [ columns ] = await queryInterface.sequelize.query("SHOW COLUMNS FROM `wms_store_warehouse` LIKE 'policy_config'"); if (columns.length > 0) { return; } await queryInterface.addColumn('wms_store_warehouse', 'policy_config', { type: Sequelize.JSON, allowNull: true, comment: '货主在仓库的配置与策略', }); }, async down(queryInterface) { const [ columns ] = await queryInterface.sequelize.query("SHOW COLUMNS FROM `wms_store_warehouse` LIKE 'policy_config'"); if (columns.length === 0) { return; } await queryInterface.removeColumn('wms_store_warehouse', 'policy_config'); }, };