CREATE TABLE pp_shop_order_statuses (	id INT NOT NULL AUTO_INCREMENT,	order_id INT NULL DEFAULT '0', status_id INT NULL DEFAULT '0', date TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,	PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_polish_ci;
ALTER TABLE pp_shop_order_statuses ADD INDEX(order_id);
ALTER TABLE pp_shop_order_statuses ADD FOREIGN KEY (order_id) REFERENCES pp_shop_orders(id) ON DELETE CASCADE ON UPDATE CASCADE;
UPDATE pp_newsletter_templates SET name='#sklep-zmiana-statusu-zamowienia' WHERE name='#sklep-zmiana-statusu-zamowienie-oplacone';
DELETE FROM pp_newsletter_templates WHERE name='#sklep-zmiana-statusu-zamowienie-przyjete-do-realizacji';
DELETE FROM pp_newsletter_templates WHERE name='#sklep-zmiana-statusu-zamowienie-wyslane';
DELETE FROM pp_newsletter_templates WHERE name='#sklep-zmiana-statusu-zamowienie-zrealizowane';