ALTER TABLE `products` ADD `shopgate_status` INT(1) NOT NULL ;
ALTER TABLE `products` ADD `shopgate_quantity` INT NOT NULL ;
CREATE TABLE orders_paymentinstructions (`orders_paymentinstructions_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,`orders_id` INT NOT NULL ,`paymentinstructions` TEXT NOT NULL ,`date_saved` DATETIME NOT NULL , INDEX ( `orders_id` ) ) ENGINE = MYISAM;
ALTER TABLE `orders` ADD `source` VARCHAR( 8 ) NOT NULL ;
ALTER TABLE `orders` ADD `source_editor_id` INT(11) NOT NULL ;

CREATE TABLE `ebay_auctions_fees` ( `ebay_auctions_fees_id` INT(11) NOT NULL AUTO_INCREMENT,ebay_auctions_id INT(11) NOT NULL,`ebay_id` VARCHAR(32) NOT NULL,`RefNumber` VARCHAR(32),`AccountDetailsEntryType` VARCHAR(32) NOT NULL,`FeeFinalValue` FLOAT NOT NULL,`Description` TEXT NOT NULL,`date_saved` DATETIME NOT NULL,`GrossDetailAmount` FLOAT NOT NULL,`Memo` TEXT NOT NULL,`NetDetailAmount` FLOAT NOT NULL,`VATPercent` FLOAT NOT NULL, PRIMARY KEY (`ebay_auctions_fees_id`),KEY `ebay_auctions_id` (`ebay_auctions_id`) ) ENGINE=MyISAM;


ALTER TABLE  `distributors` ADD  `default_delivery_storage_id` INT NOT NULL ;
ALTER TABLE  `ebay_shippingmethods` ADD  `title` VARCHAR( 255 ) NOT NULL ;

ALTER TABLE branches ADD branch_company varchar(64) NOT NULL;
ALTER TABLE branches ADD branch_suburb varchar(64) NOT NULL;
ALTER TABLE branches ADD branch_name varchar(64) NOT NULL;
ALTER TABLE branches ADD branch_street_address varchar(64) NOT NULL;
ALTER TABLE branches ADD branch_city varchar(32) NOT NULL;
ALTER TABLE branches ADD branch_postcode varchar(10) NOT NULL;
ALTER TABLE branches ADD branch_country varchar(32) NOT NULL;
ALTER TABLE branches ADD branch_telephone varchar(32) NOT NULL;

ALTER TABLE storages ADD storage_company varchar(64) NOT NULL;
ALTER TABLE storages ADD storage_suburb varchar(64) NOT NULL;
ALTER TABLE storages ADD storage_name varchar(64) NOT NULL;
ALTER TABLE storages ADD storage_street_address varchar(64) NOT NULL;
ALTER TABLE storages ADD storage_city varchar(32) NOT NULL;
ALTER TABLE storages ADD storage_postcode varchar(10) NOT NULL;
ALTER TABLE storages ADD storage_country varchar(32) NOT NULL;
ALTER TABLE storages ADD storage_telephone varchar(32) NOT NULL;

ALTER TABLE  `branches` CHANGE  `branch_country`  `branch_country` TINYINT NOT NULL ;
ALTER TABLE  `storages` CHANGE  `storage_country`  `storage_country` TINYINT NOT NULL ;


ALTER TABLE  `admin_access` ADD  `stats_shopping_carts` INT( 1 ) NOT NULL ;
UPDATE `admin_access` SET stats_shopping_carts=1 WHERE customers_id=1;
ALTER TABLE  `history_bestand` ADD  `editor_id` INT NOT NULL , ADD  `source` VARCHAR( 8 ) NOT NULL ;
CREATE TABLE `wishlist_attributes` (  `attributes_id` int(11) NOT NULL auto_increment,  `customers_id` int(11) NOT NULL default '0',  `wishlist_products_id` int(11) NOT NULL default '0',  `products_options_id` int(11) NOT NULL default '0',  `products_options_value_id` int(11) NOT NULL default '0',  PRIMARY KEY  (`attributes_id`));
CREATE TABLE `wishlist_customers` (  `id` int(11) NOT NULL auto_increment,  `customers_id` int(11) NOT NULL default '0',  `create_date` datetime NOT NULL default '0000-00-00 00:00:00',  `memo` text NOT NULL,  PRIMARY KEY  (`id`));
CREATE TABLE `wishlist_products` (  `id` int(11) NOT NULL auto_increment,  `wishlist_customers_id` int(11) NOT NULL default '0',  `products_id` int(11) NOT NULL default '0',  `quantity` int(11) NOT NULL default '0',  `memo` text NOT NULL,  `wishstatus` int(1) NOT NULL default '0',  `ordered` int(3) NOT NULL default '0',  `create_date` datetime NOT NULL default '0000-00-00 00:00:00',  PRIMARY KEY  (`id`));
ALTER TABLE `admin_access` ADD `wishlist` INT( 1 ) DEFAULT '1' NOT NULL ;

DELETE FROM configuration WHERE configuration_key='WISHLIST_AUTO';
DELETE FROM configuration WHERE configuration_key='NAVTRAIL_PRODUCTS_TITLE';
INSERT INTO `configuration` ( `configuration_id` , `configuration_key` , `configuration_value` , `configuration_group_id` , `sort_order` , `last_modified` , `date_added` , `use_function` , `set_function` )VALUES ('', 'WISHLIST_AUTO', 'true', '17', '99', NULL , '0000-00-00 00:00:00', NULL , 'xtc_cfg_select_option(array(''true'', ''false''),');
ALTER TABLE  `ebay_variations` ADD  `sort_order` TINYINT NOT NULL ;
INSERT INTO `configuration` (`configuration_id`, `configuration_key`, `configuration_value`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES (NULL, 'NAVTRAIL_PRODUCTS_TITLE', 'products_model', '1', '100', '2014-05-12 00:00:00', '2014-05-12 00:00:00', 'xtc_get_navtrail_product_title_type', 'xtc_cfg_pull_down_navtrail_product_title_types(');

ALTER TABLE categories ADD shopgate_block INT(1) NOT NULL;
ALTER TABLE products ADD shopgate_block INT(1) NOT NULL;



ALTER TABLE products ADD INDEX (`manufacturers_id`);
ALTER TABLE products ADD INDEX (`products_status`);

ALTER TABLE  `products_description` ADD  `products_description_amazon` TEXT NOT NULL ;
ALTER TABLE categories ADD INDEX (`categories_status`);


