ALTER TABLE admin_access add orders_edit int(1) not null DEFAULT '0' AFTER blacklist;
ALTER TABLE customers add customers_vat_id varchar (20) AFTER customers_cid;
ALTER TABLE customers add customers_vat_id_status int(2) DEFAULT '0' not null AFTER customers_vat_id;
ALTER TABLE customers add password_request_key varchar(32) not null AFTER account_type;
ALTER TABLE orders add customers_vat_id varchar(20) AFTER customers_cid;
ALTER TABLE products add products_ean varchar(128) AFTER products_id;
ALTER TABLE specials add specials_quantity int(4) not null AFTER products_id;
ALTER TABLE content_manager add group_ids text AFTER parent_id;
ALTER TABLE content_manager add sort_order int(4) AFTER content_text;
ALTER TABLE products_content add group_ids text AFTER products_id;

CREATE TABLE newsletter_recipients(mail_id int(11) NOT NULL auto_increment,
customers_email_address varchar(96) NOT NULL default '',
customers_id int(11) NOT NULL default '0',
customers_status int(5) NOT NULL default '0',
customers_firstname varchar(32) NOT NULL default '',
customers_lastname varchar(32) NOT NULL default '',
mail_status int(1) NOT NULL default '0',
mail_key varchar(32) NOT NULL default '',
date_added datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (mail_id));



CREATE TABLE orders_recalculate(orders_recalculate_id int(11) NOT NULL auto_increment,
orders_id int(11) NOT NULL default '0',
n_price decimal(15,4) NOT NULL default '0.0000',
b_price decimal(15,4) NOT NULL default '0.0000',
tax decimal(15,4) NOT NULL default '0.0000',
tax_rate decimal(7,4) NOT NULL default '0.0000',
class varchar(32) NOT NULL default '',
PRIMARY KEY (orders_recalculate_id)
);



CREATE TABLE products_images (
image_id INT NOT NULL auto_increment,
products_id INT NOT NULL ,
image_nr SMALLINT NOT NULL ,
image_name VARCHAR( 254 ) NOT NULL ,
PRIMARY KEY ( image_id )
);



Drop TABLE if exists payment_qenta;
CREATE TABLE payment_qenta (
q_TRID varchar(255) NOT NULL default '',
q_DATE datetime NOT NULL default '0000-00-00 00:00:00',
q_QTID bigint(18) unsigned NOT NULL default '0',
q_ORDERDESC varchar(255) NOT NULL default '',
q_STATUS tinyint(1) NOT NULL default '0',
q_ORDERID int(11) unsigned NOT NULL default '0',
PRIMARY KEY (q_TRID)
);

INSERT INTO `content_manager` VALUES (99998, 0, 0, '', 1, 'Sitemap', '', '', 0, 0, 'sitemap.php', 1, 8, 0);
INSERT INTO `content_manager` VALUES (99999, 0, 0, '', 2, 'Sitemap', '', '', 0, 0, 'sitemap.php', 1, 8, 0);
INSERT INTO configuration (configuration_id, configuration_key, configuration_value, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'MAX_DISPLAY_NEW_PRODUCTS_DAYS', '30', 3, 22, 'NULL', '', NULL, NULL);
INSERT INTO configuration (configuration_id, configuration_key, configuration_value, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'MO_PICS', '0', '4', '3', '', '0000-00-00 00:00:00', NULL , NULL);
INSERT INTO configuration (configuration_id, configuration_key, configuration_value, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'IMAGE_MANIPULATOR', 'image_manipulator_GD2.php', '4', '3', '', '0000-00-00 00:00:00', NULL , "xtc_cfg_select_option(array('image_manipulator_GD2.php', 'image_manipulator_GD1.php'),");
INSERT INTO configuration (configuration_id, configuration_key, configuration_value, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'DB_CACHE', 'false', 11, 5, NULL, '', NULL, "xtc_cfg_select_option(array('true', 'false'),");
INSERT INTO configuration (configuration_id, configuration_key, configuration_value, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'DB_CACHE_EXPIRE', '3600', 11, 6, NULL, '', NULL, NULL);
INSERT INTO configuration (configuration_id, configuration_key, configuration_value, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'DOWNLOAD_UNALLOWED_PAYMENT', 'banktransfer,cod,invoice,moneyorder', 13, 5, NULL, '', NULL, NULL);
INSERT INTO configuration (configuration_id, configuration_key, configuration_value, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'DOWNLOAD_MIN_ORDERS_STATUS', '1', 13, 5, NULL, '', NULL, NULL);
INSERT INTO configuration (configuration_id, configuration_key, configuration_value, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'ACCOUNT_COMPANY_VAT_CHECK', 'true', 18, 4, '', '', NULL, "xtc_cfg_select_option(array('true', 'false'),");
INSERT INTO configuration (configuration_id, configuration_key, configuration_value, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'STORE_OWNER_VAT_ID', '', 18, 3, '', '', NULL, NULL);
INSERT INTO configuration (configuration_id, configuration_key, configuration_value, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'DEFAULT_CUSTOMERS_VAT_STATUS_ID', '1', 18, 23, '', '', 'xtc_get_customers_status_name', 'xtc_cfg_pull_down_customers_status_list(');
INSERT INTO configuration (configuration_id, configuration_key, configuration_value, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'ACCOUNT_COMPANY_VAT_LIVE_CHECK', 'true', 18, 4, '', '', NULL, "xtc_cfg_select_option(array('true', 'false'),");
INSERT INTO configuration (configuration_id, configuration_key, configuration_value, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'ACCOUNT_COMPANY_VAT_GROUP', 'true', 18, 4, '', '', NULL, "xtc_cfg_select_option(array('true', 'false'),");
INSERT INTO configuration (configuration_id, configuration_key, configuration_value, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'ACCOUNT_VAT_BLOCK_ERROR', 'true', 18, 4, '', '', NULL, "xtc_cfg_select_option(array('true', 'false'),");
INSERT INTO configuration (configuration_id, configuration_key, configuration_value, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'GOOGLE_CONVERSION_ID', '', '19', '2', NULL , '0000-00-00 00:00:00', NULL , NULL);
INSERT INTO configuration (configuration_id, configuration_key, configuration_value, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'GOOGLE_LANG', 'de', '19', '3', NULL , '0000-00-00 00:00:00', NULL , NULL);
INSERT INTO configuration (configuration_id, configuration_key, configuration_value, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'GOOGLE_CONVERSION', 'false', '19', '0', NULL , '0000-00-00 00:00:00', NULL , "xtc_cfg_select_option(array('true', 'false'),");
INSERT INTO configuration_group VALUES ('18', 'Vat ID', 'Vat ID', '18', '1');
INSERT INTO configuration_group VALUES ('19', 'Google Conversion', 'Google Conversion-Tracking', '19', '1');
DELETE FROM configuration WHERE configuration_key = 'DOWNLOAD_MAX_DAYS';
DELETE FROM configuration WHERE configuration_key = 'DOWNLOAD_MAX_COUNT';

UPDATE zones_to_geo_zones SET geo_zone_id='5' WHERE zone_country_id='56';
UPDATE zones_to_geo_zones SET geo_zone_id='5' WHERE zone_country_id='189';
UPDATE zones_to_geo_zones SET geo_zone_id='5' WHERE zone_country_id='170';
UPDATE zones_to_geo_zones SET geo_zone_id='5' WHERE zone_country_id='97';
INSERT INTO `configuration` ( `configuration_id` , `configuration_key` , `configuration_value` , `configuration_group_id` , `sort_order` , `last_modified` , `date_added` , `use_function` , `set_function` )
VALUES (
'', 'DEFAULT_CUSTOMERS_VAT_STATUS_ID_LOCAL', '3', '18', '24', NULL , '0000-00-00 00:00:00', 'xtc_get_customers_status_name', 'xtc_cfg_pull_down_customers_status_list('
);

DELETE FROM configuration WHERE configuration_key='SESSION_BLOCK_SPIDERS';