'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'); }, };