notifyLock method + logs print.send logs order export methods + docs express model fields SPH/XHS/DW/JD + migration platform_shop_id migration notifyLock docs order export docs
47 lines
1.4 KiB
JavaScript
47 lines
1.4 KiB
JavaScript
'use strict';
|
|
|
|
/**
|
|
* 为快递接口配置表新增平台店铺 ID 字段。
|
|
* @param {import('sequelize').QueryInterface} queryInterface 查询接口
|
|
* @param {import('sequelize')} Sequelize Sequelize 实例
|
|
* @return {Promise<void>} 无返回值
|
|
*/
|
|
module.exports = {
|
|
/**
|
|
* 执行迁移:新增平台店铺 ID 字段(幂等)。
|
|
* @param {import('sequelize').QueryInterface} queryInterface 查询接口
|
|
* @param {import('sequelize')} Sequelize Sequelize 实例
|
|
* @return {Promise<void>} 无返回值
|
|
*/
|
|
async up(queryInterface, Sequelize) {
|
|
const tableName = 'wms_express_interface';
|
|
const columns = await queryInterface.describeTable(tableName);
|
|
|
|
if (columns.platform_shop_id) {
|
|
return;
|
|
}
|
|
|
|
await queryInterface.addColumn(tableName, 'platform_shop_id', {
|
|
type: Sequelize.BIGINT(20).UNSIGNED,
|
|
allowNull: true,
|
|
comment: '平台店铺ID',
|
|
});
|
|
},
|
|
|
|
/**
|
|
* 回滚迁移:删除平台店铺 ID 字段(幂等)。
|
|
* @param {import('sequelize').QueryInterface} queryInterface 查询接口
|
|
* @return {Promise<void>} 无返回值
|
|
*/
|
|
async down(queryInterface) {
|
|
const tableName = 'wms_express_interface';
|
|
const columns = await queryInterface.describeTable(tableName);
|
|
|
|
if (!columns.platform_shop_id) {
|
|
return;
|
|
}
|
|
|
|
await queryInterface.removeColumn(tableName, 'platform_shop_id');
|
|
},
|
|
};
|