CREATE TABLE pp_log (	id INT NOT NULL AUTO_INCREMENT,	message TEXT NOT NULL, date DATETIME NULL DEFAULT NULL, PRIMARY KEY (id) ) COLLATE='utf8_polish_ci';
ALTER TABLE pp_log ENGINE=InnoDB;
ALTER TABLE pp_log ADD COLUMN user_id INT NULL DEFAULT NULL AFTER message;
ALTER TABLE pp_log ADD INDEX user_id (user_id);
ALTER TABLE pp_log ADD CONSTRAINT FK_pp_log_pp_users FOREIGN KEY (user_id) REFERENCES pp_users (id) ON UPDATE SET NULL ON DELETE SET NULL;
ALTER TABLE pp_shop_products_stock DROP COLUMN permutation;
ALTER TABLE pp_shop_attributes DROP COLUMN stock_influences;
ALTER TABLE pp_shop_products	ADD COLUMN parent_id INT(11) NULL DEFAULT NULL AFTER id;
ALTER TABLE pp_shop_products ADD COLUMN permutation_hash VARCHAR(255) NULL DEFAULT NULL AFTER parent_id;
ALTER TABLE pp_shop_order_products DROP FOREIGN KEY pp_shop_order_products_ibfk_2;
ALTER TABLE pp_shop_product_sets_products	DROP FOREIGN KEY FK_pp_shop_product_sets_products_pp_shop_products;
ALTER TABLE pp_shop_product_sets_products DROP FOREIGN KEY FK_pp_shop_product_sets_products_pp_shop_product_sets;
ALTER TABLE pp_shop_products ADD COLUMN quantity INT(11) NOT NULL DEFAULT '0' AFTER stock_0_buy;