ALTER TABLE `Product`
  ADD COLUMN `isOnSale` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0' AFTER `lastUpdate`;

UPDATE Product p JOIN
  (Select productId, productVariantId, max(isOnSale) as isOnSale from ProductSku GROUP BY productId, productVariantId) t1
  on p.id = t1.productId and p.productVariantId = t1.productVariantId set p.isOnSale = t1.isOnSale;

ALTER TABLE `ProductSku`
  DROP COLUMN `isOnSale`;

ALTER TABLE `ProductSku`
  ADD INDEX `price` (`price`);