ALTER TABLE ecommerceinfo DROP INDEX eBayUserId;
ALTER TABLE ecommerceinfo DROP INDEX eBayExpire;
ALTER TABLE ecommerceinfo DROP INDEX hubspotExpire;
ALTER TABLE ecommerceinfo DROP INDEX hubspotTOken;
ALTER TABLE ecommerceinfo DROP INDEX hubspotUserId;
ALTER TABLE ecommerceinfo DROP hubspotExpire;
ALTER TABLE ecommerceinfo DROP hubspotToken;
ALTER TABLE ecommerceinfo DROP hubspotUserId;
ALTER TABLE ecommerceinfo DROP eBayExpire;
ALTER TABLE ecommerceinfo DROP eBayUserId;

CREATE TABLE `ebayaccountinfo` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `storeExternalId` varchar(50) NOT NULL DEFAULT '',
    `storeName` varchar(150) NOT NULL DEFAULT '',
    `accessToken` text NOT NULL,
    `accessTokenExpiry` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `refreshToken` varchar(150) NOT NULL DEFAULT '',
    `refreshTokenExpiry` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `active` tinyint(1) NOT NULL DEFAULT '1',
    `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `createdById` int unsigned NOT NULL DEFAULT '10',
    `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `updatedById` int unsigned NOT NULL DEFAULT '10',
    PRIMARY KEY (`id`),
    KEY `createdById` (`createdById`),
    KEY `updatedById` (`updatedById`),
    KEY `storeExternalId` (`storeExternalId`),
    KEY `storeName` (`storeName`),
    KEY `accessTokenExpiry` (`accessTokenExpiry`),
    KEY `refreshToken` (`refreshToken`),
    KEY `refreshTokenExpiry` (`refreshTokenExpiry`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;

CREATE TABLE `ebaypolicy` (
   `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
   `ebayAccountInfoId` int(10) unsigned NOT NULL,
   `type` varchar(20) NOT NULL DEFAULT '',
   `policyId` varchar(40) NOT NULL DEFAULT '',
   `policyName` varchar(150) NOT NULL DEFAULT '',
   `isDefault` tinyint(1) NOT NULL DEFAULT '0',
   `active` tinyint(1) NOT NULL DEFAULT '1',
   `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
   `createdById` int unsigned NOT NULL DEFAULT '10',
   `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
   `updatedById` int unsigned NOT NULL DEFAULT '10',
   PRIMARY KEY (`id`),
   KEY `createdById` (`createdById`),
   KEY `updatedById` (`updatedById`),
   KEY `ebayAccountInfoId` (`ebayAccountInfoId`),
   KEY `type` (`type`),
   KEY `policyId` (`policyId`),
   KEY `policyName` (`policyName`),
   KEY `isDefault` (`isDefault`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
