CREATE TABLE `woocommerceinfo` (
    `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
    `storeId` int(10) NOT NULL DEFAULT 1,
    `domainName` varchar(50) NOT NULL DEFAULT '',
    `consumerKey` varchar(50) NOT NULL DEFAULT '',
    `consumerSecret` varchar(50) NOT NULL DEFAULT '',
    `webhookSecret` varchar(40) NOT NULL DEFAULT '',
    `brandAttributeId` int(10) NULL DEFAULT 0,
    `active` tinyint(1) NOT NULL DEFAULT 1,
    `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `createdById` int(10) UNSIGNED NOT NULL DEFAULT 10 ,
    `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `updatedById` int(10) UNSIGNED NOT NULL DEFAULT 10,
    PRIMARY KEY (`id`),
    UNIQUE INDEX `domainName` (`domainName`) USING BTREE,
    INDEX `storeId` (`storeId`) USING BTREE,
    INDEX `consumerKey` (`consumerKey`) USING BTREE,
    INDEX `consumerSecret` (`consumerSecret`) USING BTREE,
    INDEX `active` (`active`) USING BTREE,
    INDEX `webhookSecret` (`webhookSecret`) USING BTREE,
    INDEX `brandAttributeId` (`brandAttributeId`) USING BTREE
)ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;


delete from systemsettings where type = 'woocommerce_consumer_key';
delete from systemsettings where type = 'woocommerce_consumer_secret';
delete from systemsettings where type = 'wp_domain_name';
delete from systemsettings where type = 'woocommerce_webhook_secret';
delete from systemsettings where type = 'woocommerce_stock_status_match';
delete from systemsettings where type = 'wp_last_import_time';
delete from systemsettings where type = 'eBay_last_order_update_time';

delete from productstatus where id = 1;
delete from productstatus where id = 6;

ALTER TABLE `product` DROP INDEX `asNewFromDate`;
ALTER TABLE `product` DROP INDEX `asNewToDate`;
ALTER TABLE `product` DROP COLUMN `asNewFromDate`;
ALTER TABLE `product` DROP COLUMN `asNewToDate`;

ALTER TABLE `systemsettings` MODIFY COLUMN `description` varchar(255) NOT NULL DEFAULT '' AFTER `value`;

update systemsettings
set description = 'AusPost Production Credentials{"username":"","password":"","account_number":"","parcel_post_product_id":"","express_post_product_id":"","transit_cover":1,"signature_on_delivery":0,"branded":1,"print_label_on_ship":1}'
where type = 'auspost_credentials';
