############ SQL Changes For PRODUCT PICKER #############
INSERT INTO `productTypes` (`id`,`name`) VALUES ('3','Picker');

-- need to create productPicker Table 
DROP TABLE productPicker_resultProduct;

CREATE TABLE productPicker_resultProduct (
     id              int(11) NOT NULL auto_increment,
     productPickerID int(11) NOT NULL,
     resultProductID int(11) NOT NULL,
     PRIMARY KEY (id)
);


ALTER TABLE productPicker_resultProduct
       ADD  ( CONSTRAINT FK_entity_entity_entity FOREIGN KEY (productPickerID)
                             REFERENCES entity(id));

ALTER TABLE productPicker_resultProduct
       ADD  ( CONSTRAINT FK_entity_entity_entity_2 FOREIGN KEY (resultProductID)
                             REFERENCES entity(id));
############ END SQL Changes For PRODUCT PICKER #############

##need to insert the producttype field
INSERT INTO `property` (`column`,`name`,`datatype`,`description`,`locked`,`hidden`,`isunique`,`seq`,`canView`,`canEdit`,`entityQuoteLink`,`searchResults`)
VALUES ('producttype','Product Type','Integer','','1','0','0','9999','1','1','0','0');

INSERT INTO `property_set` (`setID`,`property`,`propertyID`) 
VALUES ((SELECT `id` FROM `sets` WHERE `name` = 'Product'),'producttype',(SELECT `propertyID` FROM `property` WHERE `column` = 'producttype'));