CREATE TABLE `pp_shop_product_price_history` ( `id` INT NOT NULL AUTO_INCREMENT, `id_product` INT NOT NULL DEFAULT '0', `price` DECIMAL(12,2) NOT NULL DEFAULT 0, `date` DATETIME NOT NULL DEFAULT 0, PRIMARY KEY (`id`) ) COLLATE='utf8_polish_ci' ENGINE=InnoDB;
ALTER TABLE `pp_shop_products` ADD COLUMN `price_history_date` DATE NULL DEFAULT NULL AFTER `baselinker_product_id`;
ALTER TABLE `pp_shop_product_price_history`	ADD CONSTRAINT `FK_pp_shop_product_price_history_pp_shop_products` FOREIGN KEY (`id_product`) REFERENCES `pp_shop_products` (`id`) ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE `pp_shop_product_price_history`	CHANGE COLUMN `date` `date` DATE NULL DEFAULT NULL AFTER `price`;
ALTER TABLE `pp_shop_products` CHANGE COLUMN `price_history_date` `price_history_date` DATE NULL DEFAULT NULL AFTER `baselinker_product_id`;