'use strict'; /** * 店铺增加「默认发货仓库」。 * * 取值来自店铺所属货主(下属公司)的仓库;设置后: * - 拉取订单(打单平台 / 数据库店铺)落待审核时自动带上该仓库; * - 该店铺尚未审核的订单也会回填为该仓库(已有仓库且不是旧默认值的保持不动)。 */ module.exports = { async up(queryInterface, Sequelize) { await queryInterface.addColumn('shops', 'default_warehouse_id', { type: Sequelize.BIGINT.UNSIGNED, allowNull: true, comment: '默认发货仓库ID(关联 warehouses,须属于店铺货主)', after: 'subsidiary_id', }); await queryInterface.addIndex('shops', [ 'default_warehouse_id' ], { name: 'idx_shops_default_warehouse', }); }, async down(queryInterface) { await queryInterface.removeIndex('shops', 'idx_shops_default_warehouse'); await queryInterface.removeColumn('shops', 'default_warehouse_id'); }, };