ALTER TABLE `pp_shop_orders` ADD COLUMN `parsed` INT(11) NULL DEFAULT '0' AFTER `baselinker_order_id`;
CREATE TABLE `pp_shop_orders_products_intersection` ( `id` INT NOT NULL AUTO_INCREMENT, `product_1_id` INT NOT NULL DEFAULT '0', `product_2_id` INT NOT NULL DEFAULT '0', `intersection_count` INT NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) COLLATE='utf8_polish_ci';
ALTER TABLE `pp_shop_orders_products_intersection` ADD INDEX `product_1_id` (`product_1_id`);
ALTER TABLE `pp_shop_orders_products_intersection` ADD INDEX `product_2_id` (`product_2_id`);
ALTER TABLE `pp_shop_orders_products_intersection` ADD CONSTRAINT `FK_pp_shop_orders_products_intersection_pp_shop_products` FOREIGN KEY (`product_1_id`) REFERENCES `pp_shop_products` (`id`) ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE `pp_shop_orders_products_intersection` ADD CONSTRAINT `FK_pp_shop_orders_products_intersection_pp_shop_products_2` FOREIGN KEY (`product_2_id`) REFERENCES `pp_shop_products` (`id`) ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE `pp_shop_orders_products_intersection` CHANGE COLUMN `intersection_count` `count` INT(11) NOT NULL DEFAULT '0' AFTER `product_2_id`;