product_comment.sql 547 B

1234567891011121314
  1. -- 1.冗余 SKU 图片地址, 规格
  2. alter table product_comment
  3. add column sku_pic_url varchar(256) not null comment '图片地址' after sku_id;
  4. alter table product_comment
  5. add column sku_properties varchar(512) null
  6. comment '属性数组,JSON 格式 [{propertId: , valueId: }, {propertId: , valueId: }]' after sku_pic_url;
  7. -- 2.修复已有数据
  8. update product_comment pc
  9. join product_sku ps on pc.spu_id = ps.spu_id
  10. set pc.sku_pic_url = ps.pic_url,
  11. pc.sku_properties = ps.properties
  12. where pc.sku_id is not null;