ALTER TABLE `order` MODIFY COLUMN `marketplace` varchar(50) NULL DEFAULT null AFTER `notSendInvoice`;

INSERT INTO systemsettings (type, value, description, active, created, createdById, updated, updatedById)
VALUES ('tracking_category_in_xero', '', 'Add tracking category in XERO, like {"Platform":"", "JobId":"", "ACTIVITY":""}', '1', UTC_TIMESTAMP, '10', UTC_TIMESTAMP, '10');

DROP TABLE IF EXISTS `xerotrackingcategory`;
CREATE TABLE `xerotrackingcategory` (
   `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
   `trackingCategoryName` varchar(50) NOT NULL DEFAULT '',
   `trackingCategoryId` varchar(50) NOT NULL DEFAULT '',
   `optionName` varchar(50) NOT NULL DEFAULT '',
   `optionId` varchar(50) NOT NULL DEFAULT '',
   `active` tinyint(1) NOT NULL DEFAULT 1,
   `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
   `createdById` int(10) UNSIGNED NOT NULL DEFAULT 0 ,
   `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
   `updatedById` int(10) UNSIGNED NOT NULL DEFAULT 0,
   PRIMARY KEY (`id`),
   INDEX `trackingCategoryName` (`trackingCategoryName`) USING BTREE,
   INDEX `trackingCategoryId` (`trackingCategoryId`) USING BTREE,
   INDEX `optionName` (`optionName`) USING BTREE,
   INDEX `optionId` (`optionId`) USING BTREE
)ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `shopifyproductinfo`;
CREATE TABLE `shopifyproductinfo` (
    `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
    `storeId` int(10) UNSIGNED NOT NULL,
    `productId` int(10) UNSIGNED NOT NULL,
    `productGid` varchar(50) NOT NULL DEFAULT '',
    `variantGid` varchar(50) NOT NULL DEFAULT '',
    `inventoryItemGid` varchar(50) NOT NULL DEFAULT '',
    `locationGid` varchar(50) NOT NULL DEFAULT '',
    `active` tinyint(1) NOT NULL DEFAULT 1,
    `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `createdById` int(10) UNSIGNED NOT NULL DEFAULT 0 ,
    `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `updatedById` int(10) UNSIGNED NOT NULL DEFAULT 0,
    PRIMARY KEY (`id`),
    INDEX `storeId` (`storeId`) USING BTREE,
    INDEX `productId` (`productId`) USING BTREE,
    INDEX `productGid` (`productGid`) USING BTREE,
    INDEX `variantGid` (`variantGid`) USING BTREE,
    INDEX `locationGid` (`locationGid`) USING BTREE,
    INDEX `inventoryItemGid` (`inventoryItemGid`) USING BTREE
)ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

