CREATE TABLE pp_shop_producer ( id INT NOT NULL AUTO_INCREMENT, name VARCHAR(50) NULL DEFAULT NULL, status INT NULL DEFAULT '0', PRIMARY KEY (id) ) COLLATE='utf8_polish_ci';
ALTER TABLE pp_shop_producer ENGINE=InnoDB;
ALTER TABLE pp_shop_products ADD COLUMN producer_id INT(11) NULL DEFAULT NULL AFTER set_id;
ALTER TABLE pp_shop_products ADD INDEX producer_id (producer_id);
ALTER TABLE pp_shop_products ADD CONSTRAINT FK_pp_shop_products_pp_shop_producer FOREIGN KEY (producer_id) REFERENCES pp_shop_producer (id) ON UPDATE SET NULL ON DELETE SET NULL;