ALTER TABLE `{TABLE_PREFIX}sessions` ADD INDEX ( `session_time` )
ALTER TABLE `{TABLE_PREFIX}clients` ADD INDEX ( `change_id` )
ALTER TABLE `{TABLE_PREFIX}clients` ADD INDEX ( `email` )
ALTER TABLE `{TABLE_PREFIX}clients` ADD INDEX ( `firstname` , `lastname` )
ALTER TABLE `{TABLE_PREFIX}orders` ADD INDEX ( `change_id` )
ALTER TABLE `{TABLE_PREFIX}orders` ADD INDEX ( `order_date` )
ALTER TABLE `{TABLE_PREFIX}orders` ADD INDEX ( `affiliate_id` )
ALTER TABLE `{TABLE_PREFIX}orders` ADD INDEX ( `order_time` )
ALTER TABLE `{TABLE_PREFIX}orders` ADD INDEX ( `status` )
ALTER TABLE `{TABLE_PREFIX}items` ADD INDEX ( `uid` )
ALTER TABLE `{TABLE_PREFIX}items` ADD INDEX ( `download_uid` )
ALTER TABLE `{TABLE_PREFIX}items` ADD INDEX ( `order_status` )
ALTER TABLE `{TABLE_PREFIX}coupons` ADD INDEX ( `order_id` , `client_id` )
ALTER TABLE `{TABLE_PREFIX}coupons` ADD INDEX ( `coupondef_id` )
ALTER TABLE `{TABLE_PREFIX}emails` ADD INDEX ( `client_id` )
ALTER TABLE `{TABLE_PREFIX}emails` ADD INDEX ( `order_id` )
ALTER TABLE `{TABLE_PREFIX}emails` ADD INDEX ( `date` , `time` )
ALTER TABLE `{TABLE_PREFIX}templates` ADD INDEX ( `status` )
ALTER TABLE `{TABLE_PREFIX}templates` ADD INDEX ( `name` )
ALTER TABLE `{TABLE_PREFIX}esdlicenses` ADD INDEX ( `license_pending` )
ALTER TABLE `{TABLE_PREFIX}config` ADD PRIMARY KEY ( `config_key` )
ALTER TABLE `{TABLE_PREFIX}deleted` ADD INDEX ( `client_id` , `order_id` )
ALTER TABLE `{TABLE_PREFIX}downloadproducts` ADD INDEX ( `pid` )
ALTER TABLE `{TABLE_PREFIX}items` ADD `rebatable` TINYINT( 1 ) NOT NULL DEFAULT '1'
ALTER TABLE `{TABLE_PREFIX}coupons` ADD `mode` TINYINT( 1 ) NOT NULL DEFAULT '1'
ALTER TABLE `{TABLE_PREFIX}clients` ADD `coupon_id` VARCHAR( 32 ) NULL DEFAULT NULL
CREATE TABLE `{TABLE_PREFIX}billids` (`bill_id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE = MYISAM ;
ALTER TABLE `{TABLE_PREFIX}orders` ADD `bill_id` VARCHAR( 20 ) NULL DEFAULT NULL
ALTER TABLE `{TABLE_PREFIX}orders` CHANGE `payment_cost` `payment_amount` DECIMAL( 8, 2 ) NOT NULL
ALTER TABLE `{TABLE_PREFIX}orders` ADD `payment_absolute` TINYINT( 1 ) NOT NULL DEFAULT '0'
ALTER TABLE `{TABLE_PREFIX}orders` ADD `paymentrebate_amount`  DECIMAL( 8, 2 ) NOT NULL DEFAULT '0.00'
ALTER TABLE `{TABLE_PREFIX}orders` ADD `paymentrebate_absolute`  TINYINT( 1 ) NOT NULL DEFAULT '0'
ALTER TABLE `{TABLE_PREFIX}orders` ADD `bill_date` date NULL DEFAULT NULL
ALTER TABLE `{TABLE_PREFIX}clients` ADD INDEX ( `password` )
ALTER TABLE `{TABLE_PREFIX}orders` ADD INDEX ( `bill_id` )
ALTER TABLE `{TABLE_PREFIX}coupons` ADD INDEX ( `mode` )
ALTER TABLE `{TABLE_PREFIX}orders` CHANGE `bill_id` `bill_id` int (11) NULL DEFAULT NULL
ALTER TABLE `{TABLE_PREFIX}orders` ADD `order_id_prefix` VARCHAR( 10 ) NULL DEFAULT NULL
ALTER TABLE `{TABLE_PREFIX}orders` ADD `bill_id_prefix` VARCHAR( 10 ) NULL DEFAULT NULL
CREATE TABLE `{TABLE_PREFIX}orderids` (`order_id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE = MYISAM ;
ALTER TABLE `{TABLE_PREFIX}items` CHANGE `caption` `caption` text NOT NULL
ALTER TABLE `{TABLE_PREFIX}clients` ADD `custom_options` text DEFAULT NULL
ALTER TABLE `{TABLE_PREFIX}orders` ADD `pdf_creation` tinyint(1) NOT NULL DEFAULT 0
ALTER TABLE `{TABLE_PREFIX}clients` CHANGE `zip` `zip` varchar(10) NOT NULL
ALTER TABLE `{TABLE_PREFIX}clients` CHANGE `shipping_zip` `shipping_zip` varchar(10) DEFAULT NULL
ALTER TABLE `{TABLE_PREFIX}clients` CHANGE `client_id` `client_id` int(11) NOT NULL
ALTER TABLE `{TABLE_PREFIX}items` CHANGE `uid` `uid` varchar(36) DEFAULT NULL
ALTER TABLE `{TABLE_PREFIX}items` CHANGE `url` `url` text NOT NULL
ALTER TABLE `{TABLE_PREFIX}items` CHANGE `variationa` `variationa` tinyint(1) DEFAULT '0'
ALTER TABLE `{TABLE_PREFIX}items` CHANGE `variationb` `variationb` tinyint(1) DEFAULT '0'
ALTER TABLE `{TABLE_PREFIX}orders` CHANGE `payment_amount` `payment_amount` decimal(8,2) NOT NULL DEFAULT '0.00'
add_email_template(p)
ALTER TABLE `{TABLE_PREFIX}clients` ADD `shipping_packetstation_stationid` varchar(5) default NULL
ALTER TABLE `{TABLE_PREFIX}clients` ADD `shipping_packetstation_postalid` varchar(32) default NULL
ALTER TABLE `{TABLE_PREFIX}items` ADD `bid` varchar(32) default NULL
ALTER TABLE `{TABLE_PREFIX}clients` ADD `deviating_shipping_address_use_packetstation` TINYINT( 1 ) NOT NULL DEFAULT '0'
INSERT INTO `{TABLE_PREFIX}osconfig` (mode, mykey, value) VALUES ('ios', 'from_date', '0000-00-00')
INSERT INTO `{TABLE_PREFIX}osconfig` (mode, mykey, value) VALUES ('ios', 'until_date', '0000-00-00')
INSERT INTO `{TABLE_PREFIX}osconfig` (mode, mykey, value) VALUES ('ios', 'last_date', '0000-00-00')
INSERT INTO `{TABLE_PREFIX}osconfig` (mode, mykey, value) VALUES ('ios', 'now_date', '0000-00-00')
add_email_template(q)
ALTER TABLE `{TABLE_PREFIX}items` ADD `coupondef_id` smallint(6) default NULL
ALTER TABLE `{TABLE_PREFIX}items` ADD `coupon_id` varchar(32) default NULL
ALTER TABLE `{TABLE_PREFIX}items` ADD `certificate_id` varchar(32) default NULL
ALTER TABLE `{TABLE_PREFIX}items` ADD `certificate_text` text default NULL
ALTER TABLE `{TABLE_PREFIX}items` ADD `designer_id` varchar(32) default NULL
ALTER TABLE `{TABLE_PREFIX}items` ADD `is_service` tinyint(1) NOT NULL DEFAULT 0
ALTER TABLE `{TABLE_PREFIX}clients` ADD `payment_reference_id` varchar( 100 ) default NULL
ALTER TABLE `{TABLE_PREFIX}clients` ADD `bank_reason` varchar( 100 ) default NULL
ALTER TABLE `{TABLE_PREFIX}clients` ADD `bank_date` varchar( 20 ) default NULL
ALTER TABLE `{TABLE_PREFIX}orders` ADD `payment_instructions` varchar( 500 ) default NULL
ALTER TABLE `{TABLE_PREFIX}items` CHANGE `noship` `noship` varchar(512) DEFAULT NULL
ALTER TABLE `{TABLE_PREFIX}clients` CHANGE `password` `password` varchar(70) DEFAULT NULL