oms/backend/database/migrations/20260911000200-add-images-to-products.js
liufumingren cbd16752a5 feat(backend): 商品、店铺、组合商品、仓库与库存模块
- 商品/商品图片、店铺、店铺商品、组合商品及明细
- 仓库、仓库商品(WMS itemId 映射)、仓库接口配置与字段定义(warehouseApi/warehouseApiField)
- 库存:stock_items、product_stocks(ZC/CC 双维度)与库存重算工具(utils/recalcStock.js)
- 库存单据与对接日志:stock orders、api_outbound_logs
- 相关迁移:shops/shop_products/stock_orders/warehouses/warehouse_apis/warehouse_products/product_stocks/files-images 等表与字段
2026-09-13 02:23:39 +08:00

20 lines
549 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use strict';
/**
* 商品图片组:products.images 存 URL 数组(JSON),首张为主图
* 保留原有 products.image 单图字段,作为主图冗余,兼容外部系统与历史数据
*/
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.addColumn('products', 'images', {
type: Sequelize.JSON,
allowNull: true,
comment: '图片组(URL 数组,首张为主图)',
});
},
async down(queryInterface) {
await queryInterface.removeColumn('products', 'images');
},
};